Include _generated now so I get all the latest fancy stuff
[theonering] / src / tp / _generated / Channel_Interface_Destroyable.py
1 # -*- coding: utf-8 -*-
2 # Generated from the Telepathy spec
3 """Copyright (C) 2008 Collabora Ltd.
4 Copyright (C) 2008 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 02110-1301,
19       USA.
20   
21 """
22
23 import dbus.service
24
25
26 class ChannelInterfaceDestroyable(dbus.service.Interface):
27     """\
28       This interface exists to support channels where
29         Channel.Close
30         is insufficiently destructive. At the moment this means
31         Channel.Type.Text,
32         but the existence of this interface means that unsupported channels
33         can be terminated in a non-channel-type-specific way.
34     """
35
36     def __init__(self):
37         self._interfaces.add('org.freedesktop.Telepathy.Channel.Interface.Destroyable')
38
39     @dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Destroyable', in_signature='', out_signature='')
40     def Destroy(self):
41         """
42         Close the channel abruptly, possibly with loss of data. The
43           connection manager MUST NOT re-create the channel unless/until
44           more events occur.
45
46         
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
53             arrives.
54         
55
56         Most clients SHOULD call
57           Channel.Close
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
61           Channel.Interfaces
62           property), falling back to Close if not.
63
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).
68
69         Connection managers do not need to implement this interface on
70           channels where Close and Destroy would be equivalent.
71
72         
73           Callers need to be able to fall back to Close in any case.
74         
75       
76         """
77         raise NotImplementedError
78