1 # -*- coding: utf-8 -*-
2 # Generated from the Telepathy spec
3 """Copyright © 2008-2009 Collabora Limited
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 02110-1301, USA.
25 class ChannelTypeDBusTube(dbus.service.Interface):
27 A D-Bus tube is an ordered reliable transport, for transporting D-Bus
30 For each D-Bus tube, the connection manager listens on a D-Bus
31 server address, as detailed in the D-Bus specification. On this
32 address, it emulates a bus upon which each tube participant appears
35 The objects and interfaces which are expected to exist on the
36 emulated bus depend on the well-known name; typically, either the
37 participant who initiated the tube is expected to export the same
38 objects/interfaces that would be exported by a service of that name
39 on a bus, or all participants are expected to export those
42 In a multi-user context (Handle_Type_Room) the tube behaves
43 like the D-Bus bus daemon, so participants can send each other
44 private messages, or can send broadcast messages which are
45 received by everyone in the tube (including themselves).
46 Each participant has a D-Bus unique name; connection managers
47 MUST prevent participants from sending messages with the wrong
48 sender unique name, and SHOULD attempt to avoid participants
49 receiving messages not intended for them.
51 In a 1-1 context (Handle_Type_Contact) the tube behaves like
52 a peer-to-peer D-Bus connection - arbitrary D-Bus messages with
53 any sender and/or destination can be sent by each participant,
54 and each participant receives all messages sent by the other
59 @dbus.service.method('org.freedesktop.Telepathy.Channel.Type.DBusTube', in_signature='a{sv}u', out_signature='s')
60 def Offer(self, parameters, access_control):
62 Offers a D-Bus tube providing the service specified.
65 raise NotImplementedError
67 @dbus.service.method('org.freedesktop.Telepathy.Channel.Type.DBusTube', in_signature='u', out_signature='s')
68 def Accept(self, access_control):
70 Accept a D-Bus tube that's in the "local pending" state. The
71 connection manager will attempt to open the tube. The tube remains in
72 the "local pending" state until the TubeChannelStateChanged
76 raise NotImplementedError
78 @dbus.service.signal('org.freedesktop.Telepathy.Channel.Type.DBusTube', signature='a{us}au')
79 def DBusNamesChanged(self, Added, Removed):
81 Emitted on a multi-user (i.e. Handle_Type_Room) D-Bus tube when a
82 participant opens or closes the tube. This provides change
83 notification for the DBusNames property.