Home · All Classes · All Namespaces · Modules · Functions · Files

TextChannel Class Reference
[Channel proxies]

#include <TelepathyQt4/TextChannel>

Inherits Tp::Channel.

List of all members.

Public Slots

Signals

Public Member Functions

Static Public Member Functions

Static Public Attributes

Protected Member Functions


Detailed Description

High-level proxy object for accessing remote Channel objects of the Text channel type.

This subclass of Channel will eventually provide a high-level API for the Text and Messages interface. Until then, it's just a Channel.


Constructor & Destructor Documentation

~TextChannel (  )  [virtual]

Class destructor.

TextChannel ( const ConnectionPtr connection,
const QString &  objectPath,
const QVariantMap &  immutableProperties 
) [protected]

Creates a TextChannel associated with the given object on the same service as the given connection.

Parameters:
connection Connection owning this TextChannel, and specifying the service.
objectPath Path to the object on the service.
immutableProperties The immutable D-Bus properties of the channel (as announced in the NewChannels D-Bus signal), used to reduce D-Bus round trips


Member Function Documentation

TextChannelPtr create ( const ConnectionPtr connection,
const QString &  objectPath,
const QVariantMap &  immutableProperties 
) [static]

Reimplemented from Channel.

bool hasMessagesInterface (  )  const

Return whether this channel supports the Telepathy Messages 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.

Returns:
true if the Messages interface is supported

bool 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.

Returns:
The same thing as groupCanAddContacts

QStringList 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

Returns:
A list of MIME content types

MessagePartSupportFlags 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.

Returns:
A set of MessagePartSupportFlags

DeliveryReportingSupportFlags 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.

Returns:
A set of DeliveryReportingSupportFlags

QList< ReceivedMessage > 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.

Returns:
The unacknowledged messages in this channel, excluding any that have been forgotten with forget().

void 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.

Parameters:
messages A list of received messages that have now been displayed.

void 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.

Parameters:
messages A list of received messages that have now been processed.

PendingSendMessage * send ( const QString &  text,
ChannelTextMessageType  type = ChannelTextMessageTypeNormal 
) [slot]

PendingSendMessage * send ( const MessagePartList parts  )  [slot]

PendingOperation* inviteContacts ( const QList< ContactPtr > &  contacts,
const QString &  message = QString() 
) [inline, slot]

void 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.

Parameters:
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 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 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.


Member Data Documentation

const Feature FeatureMessageQueue [static]

The messageQueue method can be called, and the messageReceived and pendingMessageRemoved methods can be called

The supportedContentTypes, messagePartSupport and deliveryReportingSupport methods can be called

The messageSent signal will be emitted when a message is sent


Copyright © 2009 Collabora Ltd. and Nokia Corporation
Telepathy-Qt4 0.1.10