1 # -*- coding: utf-8 -*-
2 # Generated from the Telepathy spec
3 """Copyright © 2005-2009 Collabora Limited
4 Copyright © 2005-2009 Nokia Corporation
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 class ChannelInterfaceGroup(dbus.service.Interface):
28 Interface for channels which have multiple members, and where the members
29 of the channel can change during its lifetime. Your presence in the channel
30 cannot be presumed by the channel's existence (for example, a channel you
31 may request membership of but your request may not be granted).
33 This interface implements three lists: a list of current members
34 (Members), and two lists of local pending
35 and remote pending members
36 (LocalPendingMembers and
37 RemotePendingMembers, respectively).
38 Contacts on the remote
39 pending list have been invited to the channel, but the remote user has not
40 accepted the invitation. Contacts on the local pending list have requested
41 membership of the channel, but the local user of the framework must accept
42 their request before they may join. A single contact should never appear on
43 more than one of the three lists. The lists are empty when the channel is
44 created, and the MembersChanged signal
45 (and, if the channel's GroupFlags contains
46 Members_Changed_Detailed, the
47 MembersChangedDetailed signal)
48 should be emitted when information
49 is retrieved from the server, or changes occur.
51 If the MembersChanged or
52 MembersChangedDetailed signal indicates
53 that the SelfHandle has been removed from
54 the channel, and the channel subsequently emits Closed,
55 clients SHOULD consider the details given in the MembersChanged or
56 MembersChangedDetailed signal to be the reason why the channel closed.
58 Addition of members to the channel may be requested by using
60 remote acknowledgement is required, use of the AddMembers method will cause
61 users to appear on the remote pending list. If no acknowledgement is
62 required, AddMembers will add contacts to the member list directly. If a
63 contact is awaiting authorisation on the local pending list, AddMembers
64 will grant their membership request.
66 Removal of contacts from the channel may be requested by using
67 RemoveMembers. If a contact is awaiting
68 authorisation on the local pending
69 list, RemoveMembers will refuse their membership request. If a contact is
70 on the remote pending list but has not yet accepted the invitation,
71 RemoveMembers will rescind the request if possible.
73 It should not be presumed that the requester of a channel implementing this
74 interface is immediately granted membership, or indeed that they are a
75 member at all, unless they appear in the list. They may, for instance,
76 be placed into the remote pending list until a connection has been
77 established or the request acknowledged remotely.
79 If the local user joins a Group channel whose members or other state
80 cannot be discovered until the user joins (e.g. many chat room
81 implementations), the connection manager should ensure that the channel
82 is, as far as possible, in a consistent state before adding the local
83 contact to the members set; until this happens, the local contact should
84 be in the remote-pending set. For instance, if the connection manager
85 queries the server to find out the initial members list for the
86 channel, it should leave the local contact in the remote-pending set
87 until it has finished receiving the initial members list.
90 If the protocol provides no reliable way to tell whether the complete
91 initial members list has been received yet, the connection manager
92 should make a best-effort attempt to wait for the full list
93 (in the worst case, waiting for a suitable arbitrary timeout)
94 rather than requiring user interfaces to do so on its behalf.
98 self._interfaces.add('org.freedesktop.Telepathy.Channel.Interface.Group')
100 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Group', in_signature='aus', out_signature='')
101 def AddMembers(self, Contacts, Message):
103 Invite all the given contacts into the channel, or accept requests for
104 channel membership for contacts on the pending local list.
106 A message may be provided along with the request, which will be sent
107 to the server if supported. See the CHANNEL_GROUP_FLAG_MESSAGE_ADD and
108 CHANNEL_GROUP_FLAG_MESSAGE_ACCEPT
109 GroupFlags to see in which cases this
110 message should be provided.
112 Attempting to add contacts who are already members is allowed;
113 connection managers must silently accept this, without error.
116 raise NotImplementedError
118 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Group', in_signature='', out_signature='auauau')
119 def GetAllMembers(self):
121 Returns arrays of all current, local and remote pending channel
125 raise NotImplementedError
127 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Group', in_signature='', out_signature='u')
128 def GetGroupFlags(self):
130 Returns the value of the GroupFlags property.
133 raise NotImplementedError
135 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Group', in_signature='au', out_signature='au')
136 def GetHandleOwners(self, Handles):
138 If the CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES flag is set on
139 the channel, then the handles of the group members are specific
140 to this channel, and are not meaningful in a connection-wide
141 context such as contact lists. This method allows you to find
142 the owner of the handle if it can be discovered in this channel,
143 or 0 if the owner is not available.
146 raise NotImplementedError
148 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Group', in_signature='', out_signature='au')
149 def GetLocalPendingMembers(self):
151 Returns the To_Be_Added handle (only) for each structure in the
152 LocalPendingMembers property.
155 raise NotImplementedError
157 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Group', in_signature='', out_signature='a(uuus)')
158 def GetLocalPendingMembersWithInfo(self):
160 Returns the LocalPendingMembers property.
163 raise NotImplementedError
165 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Group', in_signature='', out_signature='au')
166 def GetMembers(self):
168 Returns the Members property.
171 raise NotImplementedError
173 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Group', in_signature='', out_signature='au')
174 def GetRemotePendingMembers(self):
176 Returns an array of handles representing contacts who have been
177 invited to the channel and are awaiting remote approval.
180 raise NotImplementedError
182 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Group', in_signature='', out_signature='u')
183 def GetSelfHandle(self):
185 Returns the value of the SelfHandle
189 raise NotImplementedError
191 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Group', in_signature='aus', out_signature='')
192 def RemoveMembers(self, Contacts, Message):
194 Requests the removal of contacts from a channel, reject their
195 request for channel membership on the pending local list, or
196 rescind their invitation on the pending remote list.
198 If the SelfHandle is in a Group,
199 it can be removed via this method, in order to leave the group
200 gracefully. This is the recommended way to leave a chatroom, close
201 or reject a StreamedMedia
204 Accordingly, connection managers SHOULD support
205 doing this, regardless of the value of
207 If doing so fails with PermissionDenied, this is considered to a bug
208 in the connection manager, but clients MUST recover by falling back
209 to closing the channel with the Close
212 Removing any contact from the local pending list is always
213 allowed. Removing contacts other than the
214 SelfHandle from the channel's members
215 is allowed if and only if Channel_Group_Flag_Can_Remove is in the
217 while removing contacts other than the
218 SelfHandle from the remote pending list
219 is allowed if and only if Channel_Group_Flag_Can_Rescind is in the
222 A message may be provided along with the request, which will be
223 sent to the server if supported. See the
224 Channel_Group_Flag_Message_Remove,
225 Channel_Group_Flag_Message_Depart,
226 Channel_Group_Flag_Message_Reject and
227 Channel_Group_Flag_Message_Rescind
228 GroupFlags to see in which cases this
229 message should be provided.
232 raise NotImplementedError
234 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Group', in_signature='ausu', out_signature='')
235 def RemoveMembersWithReason(self, Contacts, Message, Reason):
237 As RemoveMembers, but a reason code may
239 appropriate. The reason code may be ignored if the underlying
240 protocol is unable to represent the given reason.
243 raise NotImplementedError
245 @dbus.service.signal('org.freedesktop.Telepathy.Channel.Interface.Group', signature='a{uu}au')
246 def HandleOwnersChanged(self, Added, Removed):
248 Emitted whenever the HandleOwners
254 @dbus.service.signal('org.freedesktop.Telepathy.Channel.Interface.Group', signature='u')
255 def SelfHandleChanged(self, Self_Handle):
257 Emitted whenever the SelfHandle property
263 @dbus.service.signal('org.freedesktop.Telepathy.Channel.Interface.Group', signature='uu')
264 def GroupFlagsChanged(self, Added, Removed):
266 Emitted when the flags as returned by
267 GetGroupFlags are changed.
268 The user interface should be updated as appropriate.
273 @dbus.service.signal('org.freedesktop.Telepathy.Channel.Interface.Group', signature='sauauauauuu')
274 def MembersChanged(self, Message, Added, Removed, Local_Pending, Remote_Pending, Actor, Reason):
276 Emitted when contacts join any of the three lists (members, local
277 pending or remote pending) or when they leave any of the three lists.
278 There may also be a message from the server regarding this change,
279 which may be displayed to the user if desired.
281 All channel-specific handles that are mentioned in this signal
282 MUST be represented in the value of the
283 HandleOwners property.
284 In practice, this will mean that
285 HandleOwnersChanged is
286 emitted before emitting a MembersChanged signal in which
287 channel-specific handles are added, but that it is emitted
288 after emitting a MembersChanged signal in which
289 channel-specific handles are removed.
294 @dbus.service.signal('org.freedesktop.Telepathy.Channel.Interface.Group', signature='auauauaua{sv}')
295 def MembersChangedDetailed(self, Added, Removed, Local_Pending, Remote_Pending, Details):
297 Emitted when contacts join any of the three lists (members, local
298 pending or remote pending) or when they leave any of the three
299 lists. This signal provides a superset of the information provided by
301 if the channel's GroupFlags
302 contains Members_Changed_Detailed, then clients may listen exclusively
303 to this signal in preference to that signal.
305 All channel-specific handles that are mentioned in this signal
306 MUST be represented in the value of the
307 HandleOwners property. In practice,
309 HandleOwnersChanged is emitted
310 before emitting a MembersChangedDetailed signal in which
311 channel-specific handles are added, but that it is emitted
312 after emitting a MembersChangedDetailed signal in which
313 channel-specific handles are removed.