Home · All Classes · All Namespaces · Modules · Functions · Files |
The TextChannel class represents a Telepathy channel of type Text. More...
#include <TelepathyQt4/TextChannel>
Inherits Tp::Channel.
The TextChannel class represents a Telepathy channel of type Text.
Tp::TextChannel::~TextChannel | ( | ) | [virtual] |
Class destructor.
Tp::TextChannel::TextChannel | ( | const ConnectionPtr & | connection, | |
const QString & | objectPath, | |||
const QVariantMap & | immutableProperties, | |||
const Feature & | coreFeature = TextChannel::FeatureCore | |||
) | [protected] |
Construct a new TextChannel object.
connection | Connection owning this channel, and specifying the service. | |
objectPath | The object path of this channel. | |
immutableProperties | The immutable properties of this channel. | |
coreFeature | The core feature of the channel type, if any. The corresponding introspectable should depend on TextChannel::FeatureCore. |
TextChannelPtr Tp::TextChannel::create | ( | const ConnectionPtr & | connection, | |
const QString & | objectPath, | |||
const QVariantMap & | immutableProperties | |||
) | [static] |
Create a new IncomingFileTransfer channel.
connection | Connection owning this channel, and specifying the service. | |
objectPath | The object path of this channel. | |
immutableProperties | The immutable properties of this channel. |
Reimplemented from Tp::Channel.
bool Tp::TextChannel::hasMessagesInterface | ( | ) | const |
Return whether this channel supports the Telepathy Messages interface. if it does not, requestChatState() will fail and all contacts' chat states will appear to be TpChannelChatStateInactive.
The result of calling this method is undefined until basic Channel functionality has been enabled by calling becomeReady and waiting for the pending operation to complete.
bool Tp::TextChannel::hasChatStateInterface | ( | ) | const |
Return whether this channel supports the Telepathy ChatState interface. If it does not, some advanced functionality will be unavailable.
The result of calling this method is undefined until basic Channel functionality has been enabled by calling becomeReady and waiting for the pending operation to complete.
bool Tp::TextChannel::canInviteContacts | ( | ) | const |
Return whether contacts can be invited into this channel using inviteContacts (which is equivalent to groupAddContacts). Whether this is the case depends on the underlying protocol, the type of channel, and the user's privileges (in some chatrooms, only a privileged user can invite other contacts).
This is an alias for groupCanAddContacts, to indicate its meaning more clearly for Text channels.
The result of calling this method is undefined until basic Group functionality has been enabled by calling becomeReady and waiting for the pending operation to complete.
QStringList Tp::TextChannel::supportedContentTypes | ( | ) | const |
Return a list of supported MIME content types for messages on this channel. For a simple text channel this will be a list containing one item, "text/plain".
This list may contain the special value "*<!--x-->/<!--x-->*", which indicates that any content type is supported.
The result of calling this method is undefined until the FeatureMessageCapabilities Feature has been enabled, by calling becomeReady and waiting for the pending operation to complete
MessagePartSupportFlags Tp::TextChannel::messagePartSupport | ( | ) | const |
Return a set of flags indicating support for multi-part messages on this channel. This is zero on simple text channels, or greater than zero if there is partial or full support for multi-part messages.
The result of calling this method is undefined until the FeatureMessageCapabilities Feature has been enabled, by calling becomeReady and waiting for the pending operation to complete.
DeliveryReportingSupportFlags Tp::TextChannel::deliveryReportingSupport | ( | ) | const |
Return a set of flags indicating support for delivery reporting on this channel. This is zero if there are no particular guarantees, or greater than zero if delivery reports can be expected under certain circumstances.
The result of calling this method is undefined until the FeatureMessageCapabilities Feature has been enabled, by calling becomeReady and waiting for the pending operation to complete.
QList< ReceivedMessage > Tp::TextChannel::messageQueue | ( | ) | const |
Return a list of messages received in this channel. This list is empty unless the FeatureMessageQueue Feature has been enabled.
Messages are added to this list when they are received from the instant messaging service; the messageReceived signal is emitted.
There is a small delay between the message being received over D-Bus and becoming available to users of this C++ API, since a small amount of additional information needs to be fetched. However, the relative ordering of all the messages in a channel is preserved.
Messages are removed from this list when they are acknowledged with the acknowledge() or forget() methods. On channels where hasMessagesInterface() returns true, they will also be removed when acknowledged by a different client. In either case, the pendingMessageRemoved signal is emitted.
ChannelChatState Tp::TextChannel::chatState | ( | const ContactPtr & | contact | ) | const |
Return the current chat state for contact.
If hasChatStateInterface() returns false, this method will always return ChannelChatStateInactive.
This method requires TextChannel::FeatureChatState to be enabled.
void Tp::TextChannel::acknowledge | ( | const QList< ReceivedMessage > & | messages | ) | [slot] |
Acknowledge that received messages have been displayed to the user.
This method should only be called by the main handler of a Channel, usually meaning the user interface process that displays the Channel to the user (when a ChannelDispatcher is used, the Handler must acknowledge messages, and other Approvers or Observers must not acknowledge messages).
Processes other than the main handler of a Channel can free memory used in Telepathy-Qt4 by calling forget() instead.
The messages must have come from this channel, therefore this method does not make sense if FeatureMessageQueue has not been enabled.
messages | A list of received messages that have now been displayed. |
void Tp::TextChannel::forget | ( | const QList< ReceivedMessage > & | messages | ) | [slot] |
Remove messages from messageQueue without acknowledging them.
This method frees memory inside the Telepathy-Qt4 TextChannel proxy, but does not free the corresponding memory in the Connection Manager process. It should be used by clients that are not the main handler for a Channel; the main handler for a Channel should use acknowledge instead.
The messages must have come from this channel, therefore this method does not make sense if FeatureMessageQueue has not been enabled.
messages | A list of received messages that have now been processed. |
PendingSendMessage * Tp::TextChannel::send | ( | const QString & | text, | |
ChannelTextMessageType | type = ChannelTextMessageTypeNormal , |
|||
MessageSendingFlags | flags = 0 | |||
) | [slot] |
PendingSendMessage * Tp::TextChannel::send | ( | const MessagePartList & | parts, | |
MessageSendingFlags | flags = 0 | |||
) | [slot] |
PendingOperation* Tp::TextChannel::inviteContacts | ( | const QList< ContactPtr > & | contacts, | |
const QString & | message = QString() | |||
) | [inline, slot] |
PendingOperation * Tp::TextChannel::requestChatState | ( | ChannelChatState | state | ) | [slot] |
Set the local chat state and notify other members of the channel that it has changed.
Note that only the primary handler of the channel should set its chat state.
state | The new state. |
void Tp::TextChannel::messageSent | ( | const Tp::Message & | message, | |
Tp::MessageSendingFlags | flags, | |||
const QString & | sentMessageToken | |||
) | [signal] |
Emitted when a message is sent, if the FeatureMessageSentSignal Feature has been enabled.
This signal is emitted regardless of whether the message is sent by this client, or another client using the same Channel via D-Bus.
message | A message. This may differ slightly from what the client requested to send, for instance if it has been altered due to limitations of the instant messaging protocol used. | |
flags | MessageSendingFlags that were in effect when the message was sent. Clients can use these in conjunction with deliveryReportingSupport to determine whether delivery reporting can be expected. | |
sentMessageToken | Either an empty QString, or an opaque token used to match the message to any delivery reports. |
void Tp::TextChannel::messageReceived | ( | const Tp::ReceivedMessage & | message | ) | [signal] |
Emitted when a message is added to messageQueue(), if the FeatureMessageQueue Feature has been enabled.
This occurs slightly later than the message being received over D-Bus; see messageQueue() for details.
void Tp::TextChannel::pendingMessageRemoved | ( | const Tp::ReceivedMessage & | message | ) | [signal] |
Emitted when a message is removed from messageQueue(), if the FeatureMessageQueue Feature has been enabled. See messageQueue() for the circumstances in which this happens.
void Tp::TextChannel::chatStateChanged | ( | const Tp::ContactPtr & | contact, | |
Tp::ChannelChatState | state | |||
) | [signal] |
Emitted when the state of a member of the channel has changed, if the FeatureChatState feature has been enabled. This includes local state.
const Feature Tp::TextChannel::FeatureCore [static] |
A placeholder for "core functionality" which is currently just the same as Channel::FeatureCore.
Reimplemented from Tp::Channel.
const Feature Tp::TextChannel::FeatureMessageQueue [static] |
Feature used in order to access the message queue info.
See message queue methods' documentation for more details.
const Feature Tp::TextChannel::FeatureMessageCapabilities [static] |
Feature used in order to access message capabilities info.
See message capabilities methods' documentation for more details.
const Feature Tp::TextChannel::FeatureMessageSentSignal [static] |
Feature used in order to receive notification when a message is sent.
const Feature Tp::TextChannel::FeatureChatState [static] |
Feature used in order to keep track of chat state changes.
The chatStateChanged() signal will be emitted when a remote contact chat state changes.
Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation | Telepathy-Qt4 0.6.1 |