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

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

The SimpleObserver class provides an easy way to track channels in an account and can be optionally filtered by a contact. More...

`#include <TelepathyQt/SimpleObserver>`

Inherits QObject, and Tp::RefCounted.

List of all members.

## Signals

- void newChannels (const QList< Tp::ChannelPtr > &channels)
- void channelInvalidated (const Tp::ChannelPtr &channel, const QString &errorName, const QString &errorMessage)

## Public Member Functions

- virtual ~SimpleObserver ()
- AccountPtr account () const
- ChannelClassSpecList channelFilter () const
- QString contactIdentifier () const
- QList< ChannelClassFeatures > extraChannelFeatures () const
- QList< ChannelPtr > channels () const

## Static Public Member Functions

- static SimpleObserverPtr create (const AccountPtr &account, const ChannelClassSpecList &channelFilter, const QList< ChannelClassFeatures > &extraChannelFeatures=QList< ChannelClassFeatures >())
- static SimpleObserverPtr create (const AccountPtr &account, const ChannelClassSpecList &channelFilter, const ContactPtr &contact, const QList< ChannelClassFeatures > &extraChannelFeatures=QList< ChannelClassFeatures >())
- static SimpleObserverPtr create (const AccountPtr &account, const ChannelClassSpecList &channelFilter, const QString &contactIdentifier, const QList< ChannelClassFeatures > &extraChannelFeatures=QList< ChannelClassFeatures >())

## Detailed Description

The SimpleObserver class provides an easy way to track channels in an account and can be optionally filtered by a contact.

## Constructor & Destructor Documentation

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

Class destructor.

## Member Function Documentation

SimpleObserverPtr Tp::SimpleObserver::create | ( | const AccountPtr & | account,
|  | const ChannelClassSpecList & | channelFilter,
|  | const QList< ChannelClassFeatures > & | extraChannelFeatures = `QList<ChannelClassFeatures>()`
| ) |  | `[static]`

Create a new SimpleObserver object.

Events will be signalled for all channels in account that match channelFilter for all contacts.

Parameters:

  channelFilter | A specification of the channels in which this observer is interested.
  account | The account used to listen to events.
  extraChannelFeatures | Extra channel features to be enabled. All channels emitted in newChannels() will have the extra features that match their immutable properties enabled.

Returns:
  An SimpleObserverPtr object pointing to the newly created SimpleObserver object.

SimpleObserverPtr Tp::SimpleObserver::create | ( | const AccountPtr & | account,
|  | const ChannelClassSpecList & | channelFilter,
|  | const ContactPtr & | contact,
|  | const QList< ChannelClassFeatures > & | extraChannelFeatures = `QList<ChannelClassFeatures>()`
| ) |  | `[static]`

Create a new SimpleObserver object.

Events will be signalled for all channels in account established with contact, if not null, and that match channelFilter.

Parameters:

  channelFilter | A specification of the channels in which this observer is interested.
  account | The account used to listen to events.
  contact | The contact used to filter events.
  extraChannelFeatures | Extra channel features to be enabled. All channels emitted in newChannels() will have the extra features that match their immutable properties enabled.

Returns:
  An SimpleObserverPtr object pointing to the newly created SimpleObserver object.

SimpleObserverPtr Tp::SimpleObserver::create | ( | const AccountPtr & | account,
|  | const ChannelClassSpecList & | channelFilter,
|  | const QString & | contactIdentifier,
|  | const QList< ChannelClassFeatures > & | extraChannelFeatures = `QList<ChannelClassFeatures>()`
| ) |  | `[static]`

Create a new SimpleObserver object.

Events will be signalled for all channels in account established with a contact identified by contactIdentifier, if non-empty, and that match channelFilter.

Parameters:

  channelFilter | A specification of the channels in which this observer is interested.
  account | The account used to listen to events.
  contactIdentifier | The identifier of the contact used to filter events.
  extraChannelFeatures | Extra channel features to be enabled. All channels emitted in newChannels() will have the extra features that match their immutable properties enabled.

Returns:
  An SimpleObserverPtr object pointing to the newly created SimpleObserver object.

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

Return the account used to listen to events.

Returns:
  A pointer to the Account object.

ChannelClassSpecList Tp::SimpleObserver::channelFilter | ( |  | ) | const

Return a specification of the channels that this observer is interested.

Returns:
  The specification of the channels as a list of ChannelClassSpec objects.

QString Tp::SimpleObserver::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< ChannelClassFeatures > Tp::SimpleObserver::extraChannelFeatures | ( |  | ) | const

Return the extra channel features to be enabled based on the channels immutable properties.

Returns:
  The features as a list of ChannelClassFeatures objects.

QList< ChannelPtr > Tp::SimpleObserver::channels | ( |  | ) | const

Return the channels being observed.

Returns:
  A list of pointers to Channel objects.

void Tp::SimpleObserver::newChannels | ( | const QList< Tp::ChannelPtr > & | channels | ) | `[signal]`

Emitted whenever new channels that match this observer's criteria are created.

Parameters:

  channels | The new channels.

void Tp::SimpleObserver::channelInvalidated | ( | const Tp::ChannelPtr & | channel,
|  | const QString & | errorName,
|  | const QString & | errorMessage
| ) |  | `[signal]`

Emitted whenever a channel that is being observed is invalidated.

Parameters:

  channel | The channel that was invalidated.
  errorName | A D-Bus error name (a string in a subset of ASCII, prefixed with a reversed domain name).
  errorMessage | A debugging message associated with the error.