Pulling in latest skeleton code
[theonering] / src / tp / _generated / Channel_Request.py
1 # -*- coding: utf-8 -*-
2 # Generated from the Telepathy spec
3 """Copyright © 2008-2009 Collabora Ltd.
4 Copyright © 2008-2009 Nokia Corporation
5
6     This library is free software; you can redistribute it and/or
7       modify it under the terms of the GNU Lesser General Public
8       License as published by the Free Software Foundation; either
9       version 2.1 of the License, or (at your option) any later version.
10
11     This library is distributed in the hope that it will be useful,
12       but WITHOUT ANY WARRANTY; without even the implied warranty of
13       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14       Lesser General Public License for more details.
15
16     You should have received a copy of the GNU Lesser General Public
17       License along with this library; if not, write to the Free Software
18       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19       MA 02110-1301, USA.
20   
21 """
22
23 import dbus.service
24
25
26 class ChannelRequest(dbus.service.Object):
27     """\
28       A channel request is an object in the ChannelDispatcher representing
29         an ongoing request for some channels to be created or found. There
30         can be any number of ChannelRequest objects at the same time.
31
32       Its well-known bus name is the same as that of the ChannelDispatcher,
33         "org.freedesktop.Telepathy.ChannelDispatcher".
34
35       
36         See
37           ChannelDispatcher.CreateChannel
38           for rationale for ChannelRequest being a separate object.
39       
40
41       A channel request can be cancelled by any client (not just the one
42         that requested it). This means that the ChannelDispatcher will
43         Close
44         the resulting channel, or refrain from requesting it at all, rather
45         than dispatching it to a handler.
46     """
47
48     @dbus.service.method('org.freedesktop.Telepathy.ChannelRequest', in_signature='', out_signature='')
49     def Proceed(self):
50         """
51         Proceed with the channel request.
52
53         
54           The client that created this object calls this method
55             when it has connected signal handlers for
56             Succeeded and
57             Failed.
58         
59
60         Clients other than the client which created the ChannelRequest
61           MUST NOT call this method.
62
63         This method SHOULD return immediately; on success, the request
64           might still fail, but this will be indicated asynchronously
65           by the Failed signal.
66
67         Proceed cannot fail, unless clients have got the life-cycle
68           of a ChannelRequest seriously wrong (e.g. a client calls this
69           method twice, or a client that did not create the ChannelRequest
70           calls this method). If it fails, clients SHOULD assume that the
71           whole ChannelRequest has become useless.
72       
73         """
74         raise NotImplementedError
75   
76     @dbus.service.method('org.freedesktop.Telepathy.ChannelRequest', in_signature='', out_signature='')
77     def Cancel(self):
78         """
79         Cancel the channel request. The precise effect depends on the
80           current progress of the request.
81
82         If the connection manager has not already been asked to create
83           a channel, then Failed is emitted
84           immediately, and the channel request is removed.
85
86         If the connection manager has already been asked to create a
87           channel but has not produced one yet (e.g. if Connection.Interface.Requests.CreateChannel
88           has been called, but has not yet returned), then the
89           ChannelDispatcher will remember that the request has been cancelled.
90           When the channel appears, it will be closed (if it was newly
91           created and can be closed), and will not be dispatched to a
92           handler.
93
94         If the connection manager has already returned a channel, but the
95           channel has not yet been dispatched to a handler
96           then the channel dispatcher will not dispatch that
97           channel to a handler. If the channel was newly created for this
98           request, the channel dispatcher will close it with Close;
99           otherwise, the channel dispatcher will ignore it. In either case,
100           Failed will be emitted when processing
101           has been completed.
102
103         If Failed is emitted in response to
104           this method, the error SHOULD be
105           org.freedesktop.Telepathy.Error.Cancelled.
106
107         If the channel has already been dispatched to a handler, then
108           it's too late to call this method, and the channel request will
109           no longer exist.
110       
111         """
112         raise NotImplementedError
113   
114     @dbus.service.signal('org.freedesktop.Telepathy.ChannelRequest', signature='ss')
115     def Failed(self, Error, Message):
116         """
117         The channel request has failed. It is no longer present,
118           and further methods must not be called on it.
119       
120         """
121         pass
122   
123     @dbus.service.signal('org.freedesktop.Telepathy.ChannelRequest', signature='')
124     def Succeeded(self):
125         """
126         The channel request has succeeded. It is no longer present,
127           and further methods must not be called on it.
128       
129         """
130         pass
131