1 # -*- coding: utf-8 -*-
2 # Generated from the Telepathy spec
3 """ Copyright (C) 2005-2008 Collabora Limited
4 Copyright (C) 2005-2008 Nokia Corporation
5 Copyright (C) 2006 INdT
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 ChannelInterfaceHold(dbus.service.Interface):
28 Interface for channels where you may put the channel on hold.
29 This only makes sense for channels where
30 you are streaming media to or from the members. (To see whether the
31 other participant has put you on hold, see CallState.)
33 If you place a channel on hold, this indicates that you do not wish
34 to be sent media streams by any of its members and will be ignoring
35 any media streams you continue to receive. It also requests that the
36 connection manager free up any resources that are only needed for
37 an actively used channel (e.g. in a GSM or PBX call, it will be
38 necessary to place an active call on hold before you can start
43 self._interfaces.add('org.freedesktop.Telepathy.Channel.Interface.Hold')
45 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Hold', in_signature='', out_signature='uu')
46 def GetHoldState(self):
48 Return whether the local user has placed the channel on hold.
51 raise NotImplementedError
53 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Hold', in_signature='b', out_signature='')
54 def RequestHold(self, Hold):
56 Request that the channel be put on hold (be instructed not to send
57 any media streams to you) or be taken off hold.
59 If the connection manager can immediately tell that the requested
60 state change could not possibly succeed, this method SHOULD
61 return the NotAvailable error. If the requested state is the
62 same as the current state, this method SHOULD return successfully
63 without doing anything.
65 Otherwise, this method SHOULD immediately set the hold state to
66 Local_Hold_State_Pending_Hold or Local_Hold_State_Pending_Unhold
67 (as appropriate), emitting
68 HoldStateChanged if this is a change,
69 and return successfully.
71 The eventual success or failure of the request is indicated by a
72 subsequent HoldStateChanged signal, changing the hold state to
73 Local_Hold_State_Held or Local_Hold_State_Unheld.
75 If the channel has multiple streams, and the connection manager
76 succeeds in changing the hold state of one stream but fails to
77 change the hold state of another, it SHOULD attempt to revert
78 all streams to their previous hold states.
80 The following state transitions SHOULD be used, where
85 (Unheld, any reason) → (Pending_Hold, Requested) →
89 (Held, any reason) → (Pending_Unhold, Requested) →
92 Attempting to unhold fails at the first attempt to acquire a
94 (Held, any reason) → (Pending_Unhold, Requested) →
95 (Held, Resource_Not_Available)
97 Attempting to unhold acquires one resource, but fails to acquire
98 a second, and takes time to release the first:
99 (Held, any reason) → (Pending_Unhold, Requested) →
100 (Pending_Hold, Resource_Not_Available) →
101 (Held, Resource_Not_Available)
106 raise NotImplementedError
108 @dbus.service.signal('org.freedesktop.Telepathy.Channel.Interface.Hold', signature='uu')
109 def HoldStateChanged(self, HoldState, Reason):
111 Emitted to indicate that the hold state has changed for this channel.
112 This may occur as a consequence of you requesting a change with
113 RequestHold, or the state changing as a
114 result of a request from