Home · All Classes · All Namespaces · Modules · Functions · Files
Signals | Public Member Functions | Static Public Member Functions | List of all members
Tp::ContactMessenger Class Reference

The ContactMessenger class provides an easy way to send text messages to a contact and also track sent/receive text messages from the same contact. More...

#include <TelepathyQt/ContactMessenger>

Inherits QObject, and Tp::RefCounted.

Signals

void messageSent (const Tp::Message &message, Tp::MessageSendingFlags flags, const QString &sentMessageToken, const Tp::TextChannelPtr &channel)
 
void messageReceived (const Tp::ReceivedMessage &message, const Tp::TextChannelPtr &channel)
 

Public Member Functions

virtual ~ContactMessenger ()
 
AccountPtr account () const
 
QString contactIdentifier () const
 
QList< TextChannelPtr > textChats () const
 
PendingSendMessagesendMessage (const QString &text, ChannelTextMessageType type=ChannelTextMessageTypeNormal, MessageSendingFlags flags=0)
 
PendingSendMessagesendMessage (const MessageContentPartList &parts, MessageSendingFlags flags=0)
 
- Public Member Functions inherited from Tp::RefCounted
 RefCounted ()
 
virtual ~RefCounted ()
 

Static Public Member Functions

static ContactMessengerPtr create (const AccountPtr &account, const ContactPtr &contact)
 
static ContactMessengerPtr create (const AccountPtr &account, const QString &contactIdentifier)
 

Detailed Description

The ContactMessenger class provides an easy way to send text messages to a contact and also track sent/receive text messages from the same contact.

Constructor & Destructor Documentation

Tp::ContactMessenger::~ContactMessenger ( )
virtual

Class destructor.

Member Function Documentation

ContactMessengerPtr Tp::ContactMessenger::create ( const AccountPtr &  account,
const ContactPtr &  contact 
)
static

Create a new ContactMessenger object.

Parameters
accountThe account this messenger is communicating with.
contactThe contact this messenger is communicating with.
Returns
An ContactMessengerPtr object pointing to the newly created ContactMessenger object, or a null ContactMessengerPtr if contact is null.
ContactMessengerPtr Tp::ContactMessenger::create ( const AccountPtr &  account,
const QString &  contactIdentifier 
)
static

Create a new ContactMessenger object.

Parameters
accountThe account this messenger is communicating with.
contactIdentifierThe identifier of the contact this messenger is communicating with.
Returns
An ContactMessengerPtr object pointing to the newly created ContactMessenger object, or a null ContactMessengerPtr if contact is null.
AccountPtr Tp::ContactMessenger::account ( ) const

Return the account this messenger is communicating with.

Returns
A pointer to the Account object.
QString Tp::ContactMessenger::contactIdentifier ( ) const

Return the identifier of the contact this messenger is communicating with.

Returns
The identifier of the contact.
QList< TextChannelPtr > Tp::ContactMessenger::textChats ( ) const

Return the list of text chats currently being observed.

Returns
A list of pointers to TextChannel objects.
PendingSendMessage * Tp::ContactMessenger::sendMessage ( const QString &  text,
ChannelTextMessageType  type = ChannelTextMessageTypeNormal,
MessageSendingFlags  flags = 0 
)

Send a message to the contact identified by contactIdentifier() using account().

Note that the return from this method isn't ordered in any sane way, meaning that messageSent() can be signalled either before or after the returned PendingSendMessage object finishes.

Parameters
textThe message text.
typeThe message type.
flagsThe message flags.
Returns
A PendingSendMessage which will emit PendingSendMessage::finished once the reply is received and that can be used to check whether sending the message succeeded or not.
PendingSendMessage * Tp::ContactMessenger::sendMessage ( const MessageContentPartList parts,
MessageSendingFlags  flags = 0 
)

Send a message to the contact identified by contactIdentifier() using account().

Note that the return from this method isn't ordered in any sane way, meaning that messageSent() can be signalled either before or after the returned PendingSendMessage object finishes.

Parameters
partsThe message parts.
flagsThe message flags.
Returns
A PendingSendMessage which will emit PendingSendMessage::finished once the reply is received and that can be used to check whether sending the message succeeded or not.
void Tp::ContactMessenger::messageSent ( const Tp::Message message,
Tp::MessageSendingFlags  flags,
const QString &  sentMessageToken,
const Tp::TextChannelPtr &  channel 
)
signal

Emitted whenever a text message on account() is sent to the contact identified by contactIdentifier().

Parameters
messageThe message sent.
flagsThe flags of the message that was sent.
sentMessageTokenThe token of the message that was sent.
channelThe channel from which the message was sent.
void Tp::ContactMessenger::messageReceived ( const Tp::ReceivedMessage message,
const Tp::TextChannelPtr &  channel 
)
signal

Emitted whenever a text message on account() is received from the contact identified by contactIdentifier().

Parameters
messageThe message received.
channelThe channel from which the message was received.


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt 0.9.7