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

Signals | Public Member Functions | Static Public Member Functions | List of all members
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>`

Inheritance diagram for Tp::SimpleTextObserver:
[legend]

## 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
Public Member Functions inherited from QObject
| QObject (QObject *parent)
virtual | ~QObject ()
virtual bool | event (QEvent *e)
virtual bool | eventFilter (QObject *watched, QEvent *event)
virtual const QMetaObject * | metaObject () const
QString | objectName () const
void | setObjectName (const QString &name)
bool | isWidgetType () const
bool | signalsBlocked () const
bool | blockSignals (bool block)
QThread * | thread () const
void | moveToThread (QThread *targetThread)
int | startTimer (int interval)
void | killTimer (int id)
T | findChild (const QString &name) const
QList< T > | findChildren (const QString &name) const
QList< T > | findChildren (const QRegExp &regExp) const
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
const QObjectList & | children () const
void | setParent (QObject *parent)
void | installEventFilter (QObject *filterObj)
void | removeEventFilter (QObject *obj)
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
bool | disconnect (const char *signal, const QObject *receiver, const char *method)
bool | disconnect (const QObject *receiver, const char *method)
void | dumpObjectTree ()
void | dumpObjectInfo ()
bool | setProperty (const char *name, const QVariant &value)
QVariant | property (const char *name) const
QList< QByteArray > | dynamicPropertyNames () const
void | destroyed (QObject *obj)
QObject * | parent () const
bool | inherits (const char *className) const
void | deleteLater ()
| QObject (QObject *parent, const char *name)
void | insertChild (QObject *object)
void | removeChild (QObject *object)
bool | isA (const char *className) const
const char * | className () const
const char * | name () const
const char * | name (const char *defaultName) const
void | setName (const char *name)
Public Member Functions inherited from Tp::RefCounted
| RefCounted ()
virtual | ~RefCounted ()

## 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)
Static Public Member Functions inherited from QObject
QString | tr (const char *sourceText, const char *disambiguation, int n)
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n)
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)

## Additional Inherited Members

Protected Member Functions inherited from QObject
QObject * | sender () const
int | senderSignalIndex () const
int | receivers (const char *signal) const
virtual void | timerEvent (QTimerEvent *event)
virtual void | childEvent (QChildEvent *event)
virtual void | customEvent (QEvent *event)
virtual void | connectNotify (const char *signal)
virtual void | disconnectNotify (const char *signal)
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method)
Static Protected Member Functions inherited from QObject
QByteArray | normalizeSignalSlot (const char *signalSlot)
Properties inherited from QObject
| objectName

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