1 # -*- coding: utf-8 -*-
2 # Generated from the Telepathy spec
3 """Copyright © 2008-2009 Collabora Ltd.
4 Copyright © 2008-2009 Nokia Corporation
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.
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.
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
26 class ClientInterfaceRequests(dbus.service.Interface):
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.
33 self._interfaces.add('org.freedesktop.Telepathy.Client.Interface.Requests')
35 @dbus.service.method('org.freedesktop.Telepathy.Client.Interface.Requests', in_signature='oa{sv}', out_signature='')
36 def AddRequest(self, Request, Properties):
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.
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.
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
52 and respect the preferred handler (if any).
55 If the request succeeds and is given to the expected Handler,
56 the Requests_Satisfied parameter to
58 can be used to match the channel to a previous AddRequest call.
61 This lets the UI direct the channels to the window that it
65 If the request fails, the expected handler is notified by the
66 channel dispatcher calling its
70 This lets the UI close the window or display the error.
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.
83 Expected handling is for the UI to close the window it
87 Handlers SHOULD NOT return an error from this method; errors
88 returned from this method SHOULD NOT alter the channel dispatcher's
92 Calls to this method are merely a notification.
96 raise NotImplementedError
98 @dbus.service.method('org.freedesktop.Telepathy.Client.Interface.Requests', in_signature='oss', out_signature='')
99 def RemoveRequest(self, Request, Error, Message):
101 Called by the ChannelDispatcher to indicate that a request
102 previously passed to AddRequest
103 has failed and should be disregarded.
105 Handlers SHOULD NOT return an error from this method; errors
106 returned from this method SHOULD NOT alter the channel dispatcher's
110 Calls to this method are merely a notification.
114 raise NotImplementedError