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 ClientHandler(dbus.service.Object):
28 Handlers are the user interface for a channel. They turn an abstract
29 Telepathy channel into something the user wants to see, like a text
30 message stream or an audio and/or video call.
32 For its entire lifetime, each channel on a connection known to the
33 channel dispatcher is either being processed by the channel dispatcher,
34 or being handled by precisely one Handler.
36 Because each channel is only handled by one Handler, handlers may
37 perform actions that only make sense to do once, such as acknowledging
39 messages, doing the actual streaming for StreamedMedia
40 channels with the MediaSignalling
41 interface, or transferring the file in FileTransfer
44 When a new incoming channel (one with
46 = FALSE) is offered to
48 by the channel dispatcher, it also offers the Approvers a list of all
49 the running or activatable handlers whose
50 HandlerChannelFilter property
51 (possibly as cached in the .client file) indicates that they
52 are able to handle the channel. The Approvers can choose one of
53 those channel handlers to handle the channel.
55 When a new outgoing channel (one with
57 = TRUE) appears, the channel dispatcher passes it to an appropriate
58 channel handler automatically.
63 @dbus.service.method('org.freedesktop.Telepathy.Client.Handler', in_signature='ooa(oa{sv})aota{sv}', out_signature='')
64 def HandleChannels(self, Account, Connection, Channels, Requests_Satisfied, User_Action_Time, Handler_Info):
66 Called by the channel dispatcher when this client should handle these
67 channels, or when this client should present channels that it is already
68 handling to the user (e.g. bring them into the foreground).
71 Clients are expected to know what channels they're already handling,
72 and which channel object path corresponds to which window or tab.
73 This can easily be done using a hash table keyed by channels' object
77 This method can raise any D-Bus error. If it does, the
78 handler is assumed to have failed or crashed, and the channel
79 dispatcher MUST recover in an implementation-specific way; it MAY
80 attempt to dispatch the channels to another handler, or close the
83 If closing the channels, it is RECOMMENDED that the channel
84 dispatcher attempts to close the channels using
86 but resorts to calling
87 Channel.Interface.Destroyable.Destroy
88 (if available) or ignoring the channel (if not) if the same handler
89 repeatedly fails to handle channels.
91 After HandleChannels returns successfully, the client process is
92 considered to be responsible for the channel until it its unique
93 name disappears from the bus.
96 If a process has multiple Client bus names - some temporary and
97 some long-lived - and drops one of the temporary bus names in order
98 to reduce the set of channels that it will handle, any channels
99 that it is already handling should remain unaffected.
103 raise NotImplementedError