Include _generated now so I get all the latest fancy stuff
[theonering] / src / tp / _generated / Client_Handler.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 ClientHandler(dbus.service.Object):
27     """\
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.
31
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.
35
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
38         Text
39         messages, doing the actual streaming for StreamedMedia
40         channels with the MediaSignalling
41         interface, or transferring the file in FileTransfer
42         channels.
43
44       When a new incoming channel (one with
45         Requested
46         = FALSE) is offered to
47         Approvers
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.
54
55       When a new outgoing channel (one with
56         Requested
57         = TRUE) appears, the channel dispatcher passes it to an appropriate
58         channel handler automatically.
59       
60
61     """
62
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):
65         """
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).
69
70         
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
74             paths.
75         
76
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
81           channels.
82
83         If closing the channels, it is RECOMMENDED that the channel
84           dispatcher attempts to close the channels using
85           Channel.Close,
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.
90
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.
94
95         
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.
100         
101       
102         """
103         raise NotImplementedError
104