/usr/share/pyshared/telepathy/_generated/Channel_Interface_Messages.py is in python-telepathy 0.15.19-2.1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | # -*- coding: utf-8 -*-
# Generated from the Telepathy spec
"""Copyright © 2008–2010 Collabora Ltd.
Copyright © 2008–2010 Nokia Corporation
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA.
"""
import dbus.service
class ChannelInterfaceMessages(dbus.service.Interface):
"""\
This interface extends the Text
interface to support more general messages, including:
messages with attachments (like MIME multipart/mixed)
groups of alternatives (like MIME multipart/alternative)
delivery reports (which replace Text.SendError),
addding support for protocols where the message content is not echoed
back to the sender on failure and for receiving positive
acknowledgements, as well as ensuring that incoming delivery reports
are not lost if no client is handling the channel yet;
any extra types of message we need in future
Incoming messages, outgoing messages, and delivery reports are all
represented as lists of Message_Part structures,
with a format reminiscent of e-mail. Messages are sent by calling
SendMessage; outgoing messages are
announced to other clients which may be interested in the channel by
the MessageSent signal. Incoming
messages and delivery reports are signalled by
MessageReceived, and are stored in the
the PendingMessages property until
acknowledged by calling Text.AcknowledgePendingMessages.
Only the Handler
for a channel should acknowledge messages; Observers
(such as loggers) and Approvers
for the channel may listen for incoming messages, and send messages of their own, but SHOULD NOT acknowledge messages.
If observers were allowed to acknowledge messages, then messages
might have been acknowledged before the handler even got to see the
channel, and hence could not be shown to the user.
If this interface is present, clients that support it SHOULD
listen for the MessageSent and
MessageReceived signals, and
ignore the Sent,
SendError
and Received
signals on the Text interface (which are guaranteed to duplicate
signals from this interface).
Although this specification supports formatted (rich-text)
messages with unformatted alternatives, implementations SHOULD NOT
attempt to send formatted messages until the Telepathy specification
has also been extended to cover capability discovery for message
formatting.
We intend to expose all rich-text messages as XHTML-IM, but on some
protocols, formatting is an extremely limited subset of that format
(e.g. there are protocols where foreground/background colours, font
and size can be set, but only for entire messages).
Until we can tell UIs what controls to offer to the user, it's
unfriendly to offer the user controls that may have no effect.
"""
def __init__(self):
self._interfaces.add('org.freedesktop.Telepathy.Channel.Interface.Messages')
@dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Messages', in_signature='aa{sv}u', out_signature='s')
def SendMessage(self, Message, Flags):
"""
Submit a message to the server for sending.
If this method returns successfully, the message has been submitted
to the server and the MessageSent
signal is emitted. A corresponding
Sent
signal on the Text interface MUST also be emitted.
This method MUST return before the MessageSent signal is
emitted.
This means that the process sending the message is the first
to see the Protocol_Message_Token, and can
relate the message to the corresponding
MessageSent signal by comparing
message tokens (if supported by the protocol).
If this method fails, message submission to the server has failed
and no signal on this interface (or the Text interface) is
emitted.
"""
raise NotImplementedError
@dbus.service.method('org.freedesktop.Telepathy.Channel.Interface.Messages', in_signature='uau', out_signature='a{uv}')
def GetPendingMessageContent(self, Message_ID, Parts):
"""
Retrieve the content of one or more parts of a pending message.
Note that this function may take a considerable amount of time
to return if the part's 'needs-retrieval' flag is true; consider
extending the default D-Bus method call timeout. Additional API is
likely to be added in future, to stream large message parts.
"""
raise NotImplementedError
@dbus.service.signal('org.freedesktop.Telepathy.Channel.Interface.Messages', signature='aa{sv}us')
def MessageSent(self, Content, Flags, Message_Token):
"""
Signals that a message has been submitted for sending. This
MUST be emitted exactly once per emission of the Sent
signal on the Text interface, for backwards-compatibility; clients
SHOULD ignore the latter if this interface is present, as mentioned
in the introduction.
This SHOULD be emitted as soon as the CM determines it's
theoretically possible to send the message (e.g. the parameters are
supported and correct).
This signal allows a process that is not the caller of
SendMessage to log sent messages.
"""
pass
@dbus.service.signal('org.freedesktop.Telepathy.Channel.Interface.Messages', signature='au')
def PendingMessagesRemoved(self, Message_IDs):
"""
The messages with the given IDs have been removed from the
PendingMessages list. Clients SHOULD NOT
attempt to acknowledge those messages.
This completes change notification for the PendingMessages property
(previously, there was change notification when pending messages
were added, but not when they were removed).
"""
pass
@dbus.service.signal('org.freedesktop.Telepathy.Channel.Interface.Messages', signature='aa{sv}')
def MessageReceived(self, Message):
"""
Signals that a message has been received and added to the pending
messages queue. This MUST be emitted exactly once per emission of the
Received
signal on the Text interface, for backwards-compatibility; clients
SHOULD ignore the latter in favour of this signal if this interface is
present, as mentioned in the introduction.
"""
pass
|