1 # -*- coding: utf-8 -*-
2 # Generated from the Telepathy spec
4 Copyright © 2007-2009 Collabora Limited
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 class ChannelTypeTubes(dbus.service.Interface):
28 A "tube" is a mechanism for arbitrary data transfer. Two types of
29 data transfer are currently specified: D-Bus messages, and streams of
30 bytes. Each tube has a service name, which is a string specifying the
31 kind of communication that takes place over it, and a dictionary of
32 arbitrary parameters. Tube parameters are commonly used for bootstrap
33 information such as usernames and passwords. Each tube is identified
34 by a locally unique identifier.
36 The Tubes channel type may be requested for handles of type
37 HANDLE_TYPE_CONTACT and HANDLE_TYPE_ROOM.
39 Stream tubes specify listening addresses using pairs of parameters
40 with signature 'u', 'v', where the integer 'u' is a member of
41 Socket_Address_Type and the v is dependent on the type of address.
44 @dbus.service.method('org.freedesktop.Telepathy.Channel.Type.Tubes', in_signature='', out_signature='a{uau}')
45 def GetAvailableStreamTubeTypes(self):
46 """List the available address types and access-control types
49 raise NotImplementedError
51 @dbus.service.method('org.freedesktop.Telepathy.Channel.Type.Tubes', in_signature='', out_signature='au')
52 def GetAvailableTubeTypes(self):
55 raise NotImplementedError
57 @dbus.service.method('org.freedesktop.Telepathy.Channel.Type.Tubes', in_signature='', out_signature='a(uuusa{sv}u)')
61 raise NotImplementedError
63 @dbus.service.method('org.freedesktop.Telepathy.Channel.Type.Tubes', in_signature='sa{sv}', out_signature='u')
64 def OfferDBusTube(self, Service, Parameters):
66 Offers a D-Bus tube providing the service specified.
69 raise NotImplementedError
71 @dbus.service.method('org.freedesktop.Telepathy.Channel.Type.Tubes', in_signature='sa{sv}uvuv', out_signature='u')
72 def OfferStreamTube(self, Service, Parameters, Address_Type, Address, Access_Control, Access_Control_Param):
74 Offer a stream tube exporting the local socket specified.
77 raise NotImplementedError
79 @dbus.service.method('org.freedesktop.Telepathy.Channel.Type.Tubes', in_signature='u', out_signature='s')
80 def AcceptDBusTube(self, ID):
82 Accept a D-Bus tube that's in the "local pending" state. The
83 connection manager will attempt to open the tube. The tube remains in
84 the "local pending" state until the TubeStateChanged signal is
88 raise NotImplementedError
90 @dbus.service.method('org.freedesktop.Telepathy.Channel.Type.Tubes', in_signature='uuuv', out_signature='v')
91 def AcceptStreamTube(self, ID, Address_Type, Access_Control, Access_Control_Param):
93 Accept a stream tube that's in the "local pending" state. The
94 connection manager will attempt to open the tube. The tube remains in
95 the "local pending" state until the TubeStateChanged signal is
99 raise NotImplementedError
101 @dbus.service.method('org.freedesktop.Telepathy.Channel.Type.Tubes', in_signature='u', out_signature='')
102 def CloseTube(self, ID):
107 raise NotImplementedError
109 @dbus.service.method('org.freedesktop.Telepathy.Channel.Type.Tubes', in_signature='u', out_signature='s')
110 def GetDBusTubeAddress(self, ID):
112 For a D-Bus tube, return a string describing the address of the
116 raise NotImplementedError
118 @dbus.service.method('org.freedesktop.Telepathy.Channel.Type.Tubes', in_signature='u', out_signature='a(us)')
119 def GetDBusNames(self, ID):
121 For a multi-user (i.e. Handle_Type_Room) D-Bus tube, obtain a mapping
122 between contact handles and their unique bus names on this tube.
125 raise NotImplementedError
127 @dbus.service.method('org.freedesktop.Telepathy.Channel.Type.Tubes', in_signature='u', out_signature='uv')
128 def GetStreamTubeSocketAddress(self, ID):
130 For a stream tube, obtain the address of the socket used to
131 communicate over this tube.
134 raise NotImplementedError
136 @dbus.service.signal('org.freedesktop.Telepathy.Channel.Type.Tubes', signature='uuusa{sv}u')
137 def NewTube(self, ID, Initiator, Type, Service, Parameters, State):
139 Emitted when a tube is created.
144 @dbus.service.signal('org.freedesktop.Telepathy.Channel.Type.Tubes', signature='uu')
145 def TubeStateChanged(self, ID, State):
147 Emitted when the state of a tube changes.
152 @dbus.service.signal('org.freedesktop.Telepathy.Channel.Type.Tubes', signature='u')
153 def TubeClosed(self, ID):
155 Emitted when a tube has been closed. The ID of a closed tube is no
156 longer valid. The ID may later be reused for a new tube.
161 @dbus.service.signal('org.freedesktop.Telepathy.Channel.Type.Tubes', signature='ua(us)au')
162 def DBusNamesChanged(self, ID, Added, Removed):
164 Emitted on a multi-user (i.e. Handle_Type_Room) D-Bus tube when a
165 participant opens or closes the tube.
170 @dbus.service.signal('org.freedesktop.Telepathy.Channel.Type.Tubes', signature='uu')
171 def StreamTubeNewConnection(self, ID, Handle):
173 Emitted on a stream tube when a participant opens a new connection