Include _generated now so I get all the latest fancy stuff
[theonering] / src / tp / _generated / Channel_Interface_Hold.py
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 
6
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.
11
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.
16
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.
20   
21 """
22
23 import dbus.service
24
25
26 class ChannelInterfaceHold(dbus.service.Interface):
27     """\
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.)
32
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
39         another call).
40     """
41
42     def __init__(self):
43         self._interfaces.add('org.freedesktop.Telepathy.Channel.Interface.Hold')
44
45     @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Hold', in_signature='', out_signature='uu')
46     def GetHoldState(self):
47         """
48         Return whether the local user has placed the channel on hold.
49       
50         """
51         raise NotImplementedError
52   
53     @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Hold', in_signature='b', out_signature='')
54     def RequestHold(self, Hold):
55         """
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.
58
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.
64
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.
70
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.
74
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.
79
80         The following state transitions SHOULD be used, where
81           appropriate:
82
83         
84           Successful hold:
85             (Unheld, any reason) → (Pending_Hold, Requested) →
86             (Held, Requested)
87           
88           Successful unhold:
89             (Held, any reason) → (Pending_Unhold, Requested) →
90             (Unheld, Requested)
91           
92           Attempting to unhold fails at the first attempt to acquire a
93             resource:
94             (Held, any reason) → (Pending_Unhold, Requested) →
95             (Held, Resource_Not_Available)
96           
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)
102           
103         
104       
105         """
106         raise NotImplementedError
107   
108     @dbus.service.signal('org.freedesktop.Telepathy.Channel.Interface.Hold', signature='uu')
109     def HoldStateChanged(self, HoldState, Reason):
110         """
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
115         another process.
116       
117         """
118         pass
119