1 # -*- coding: utf-8 -*-
2 # Generated from the Telepathy spec
3 """Copyright (C) 2008 Collabora Ltd.
4 Copyright (C) 2008 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,
26 class ChannelInterfaceDestroyable(dbus.service.Interface):
28 This interface exists to support channels where
30 is insufficiently destructive. At the moment this means
32 but the existence of this interface means that unsupported channels
33 can be terminated in a non-channel-type-specific way.
37 self._interfaces.add('org.freedesktop.Telepathy.Channel.Interface.Destroyable')
39 @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Destroyable', in_signature='', out_signature='')
42 Close the channel abruptly, possibly with loss of data. The
43 connection manager MUST NOT re-create the channel unless/until
47 The main motivating situation for this method is that when a Text
48 channel with pending messages is closed with Close, it comes back
49 as an incoming channel (to avoid a race between Close and an
50 incoming message). If Destroy is called on a Text channel, the CM
51 should delete all pending messages and close the channel, and
52 the channel shouldn't be re-created until/unless another message
56 Most clients SHOULD call
58 instead. However, if a client explicitly intends to destroy the
59 channel with possible loss of data, it SHOULD call this method
60 if this interface is supported (according to the
62 property), falling back to Close if not.
64 In particular, channel dispatchers SHOULD use this method if
65 available when terminating channels that cannot be handled
66 correctly (for instance, if no handler has been installed for
67 a channel type, or if the handler crashes repeatedly).
69 Connection managers do not need to implement this interface on
70 channels where Close and Destroy would be equivalent.
73 Callers need to be able to fall back to Close in any case.
77 raise NotImplementedError