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

Signals | Public Member Functions | Static Public Member Functions
Tp::SimpleTextObserver Class Reference
Utililty classes

The SimpleTextObserver class provides an easy way to track sent/received text messages in an account and can be optionally filtered by a contact. More...

`#include <TelepathyQt/SimpleTextObserver>`

Inherits QObject, and Tp::RefCounted.

List of all members.

## 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 ~SimpleTextObserver ()
- AccountPtr account () const
- QString contactIdentifier () const
- QList< TextChannelPtr > textChats () const

## Static Public Member Functions

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

## Detailed Description

The SimpleTextObserver class provides an easy way to track sent/received text messages in an account and can be optionally filtered by a contact.

## Constructor & Destructor Documentation

Tp::SimpleTextObserver::~SimpleTextObserver | ( |  | ) | `[virtual]`

Class destructor.

## Member Function Documentation

SimpleTextObserverPtr Tp::SimpleTextObserver::create | ( | const AccountPtr & | account | ) | `[static]`

Create a new SimpleTextObserver object.

Events will be signalled for all messages sent/received by all contacts in account.

Parameters:

  account | The account used to listen to events.

Returns:
  An SimpleTextObserverPtr object pointing to the newly created SimpleTextObserver object.

SimpleTextObserverPtr Tp::SimpleTextObserver::create | ( | const AccountPtr & | account,
|  | const ContactPtr & | contact
| ) |  | `[static]`

Create a new SimpleTextObserver object.

If contact is not null, events will be signalled for all messages sent/received by contact, otherwise this method works the same as create(const Tp::AccountPtr &).

Parameters:

  account | The account used to listen to events.
  contact | The contact used to filter events.

Returns:
  An SimpleTextObserverPtr object pointing to the newly created SimpleTextObserver object.

SimpleTextObserverPtr Tp::SimpleTextObserver::create | ( | const AccountPtr & | account,
|  | const QString & | contactIdentifier
| ) |  | `[static]`

Create a new SimpleTextObserver object.

If contactIdentifier is non-empty, events will be signalled for all messages sent/received by a contact identified by contactIdentifier, otherwise this method works the same as create(const Tp::AccountPtr &).

Parameters:

  account | The account used to listen to events.
  contactIdentifier | The identifier of the contact used to filter events.

Returns:
  An SimpleTextObserverPtr object pointing to the newly created SimpleTextObserver object.

AccountPtr Tp::SimpleTextObserver::account | ( |  | ) | const

Return the account used to listen to events.

Returns:
  A pointer to the Account object.

QString Tp::SimpleTextObserver::contactIdentifier | ( |  | ) | const

Return the identifier of the contact used to filter events, or an empty string if none was provided at construction.

Returns:
  The identifier of the contact.

QList< TextChannelPtr > Tp::SimpleTextObserver::textChats | ( |  | ) | const

Return the list of text chats currently being observed.

Returns:
  A list of pointers to TextChannel objects.

void Tp::SimpleTextObserver::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. If contactIdentifier() is non-empty, only messages sent to the contact identified by it will be signalled.

Parameters:

  message | The message sent.
  flags | The message flags,
  sentMessageToken | The message token.
  channel | The channel which received the message.

void Tp::SimpleTextObserver::messageReceived | ( | const Tp::ReceivedMessage & | message,
|  | const Tp::TextChannelPtr & | channel
| ) |  | `[signal]`

Emitted whenever a text message on account() is received. If contactIdentifier() is non-empty, only messages received by the contact identified by it will be signalled.

Parameters:

  message | The message received.
  channel | The channel which received the message.