Include _generated now so I get all the latest fancy stuff
[theonering] / src / tp / _generated / Client_Interface_Requests.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, MA
19       02110-1301, USA.
20   
21 """
22
23 import dbus.service
24
25
26 class ClientInterfaceRequests(dbus.service.Interface):
27     """\
28       This interface can be implemented by a Handler to be notified about
29         requests for channels that it is likely to be asked to handle.
30     """
31
32     def __init__(self):
33         self._interfaces.add('org.freedesktop.Telepathy.Client.Interface.Requests')
34
35     @dbus.service.method('org.freedesktop.Telepathy.Client.Interface.Requests', in_signature='oa{sv}', out_signature='')
36     def AddRequest(self, Request, Properties):
37         """
38         Called by the ChannelDispatcher to indicate that channels have been
39           requested, and that if the request is successful, they will probably
40           be handled by this Handler. The ChannelDispatcher SHOULD only
41           call this method on one handler per request.
42
43         
44           This allows the UI to start preparing to handle the channels
45             in advance (e.g. render a window with an "in progress" message),
46             improving perceived responsiveness.
47
48           The use of "probably" is because you can't necessarily tell from
49             a channel request which handler will handle particular channels.
50             A reasonable heuristic would be to match the request against the
51             HandlerChannelFilter,
52             and respect the preferred handler (if any).
53         
54
55         If the request succeeds and is given to the expected Handler,
56           the Requests_Satisfied parameter to
57           HandleChannels
58           can be used to match the channel to a previous AddRequest call.
59
60         
61           This lets the UI direct the channels to the window that it
62             already opened.
63         
64
65         If the request fails, the expected handler is notified by the
66           channel dispatcher calling its
67           RemoveRequest method.
68
69         
70           This lets the UI close the window or display the error.
71         
72
73         The channel dispatcher SHOULD remember which handler was notified,
74           and if the channel request succeeds, it SHOULD dispatch the channels
75           to the expected handler, unless the channels do not match that
76           handler's HandlerChannelFilter.
77           If the channels are not dispatched to the expected handler, the
78           handler that was expected is notified by the channel dispatcher
79           calling its RemoveRequest method
80           with the NotYours error.
81
82         
83           Expected handling is for the UI to close the window it
84             previously opened.
85         
86
87         Handlers SHOULD NOT return an error from this method; errors
88           returned from this method SHOULD NOT alter the channel dispatcher's
89           behaviour.
90
91         
92           Calls to this method are merely a notification.
93         
94       
95         """
96         raise NotImplementedError
97   
98     @dbus.service.method('org.freedesktop.Telepathy.Client.Interface.Requests', in_signature='oss', out_signature='')
99     def RemoveRequest(self, Request, Error, Message):
100         """
101         Called by the ChannelDispatcher to indicate that a request
102           previously passed to AddRequest
103           has failed and should be disregarded.
104
105         Handlers SHOULD NOT return an error from this method; errors
106           returned from this method SHOULD NOT alter the channel dispatcher's
107           behaviour.
108
109         
110           Calls to this method are merely a notification.
111         
112       
113         """
114         raise NotImplementedError
115