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

Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Properties | List of all members
Tp::ConnectionManager Class Reference
Connection manager proxies

The ConnectionManager class represents a Telepathy connection manager. More...

`#include <TelepathyQt/ConnectionManager>`

Inherits Tp::StatelessDBusProxy, and Tp::OptionalInterfaceFactory< ConnectionManager >.

## Public Member Functions

virtual | ~ConnectionManager ()
QString | name () const
ConnectionFactoryConstPtr | connectionFactory () const
ChannelFactoryConstPtr | channelFactory () const
ContactFactoryConstPtr | contactFactory () const
QStringList | supportedProtocols () const
const ProtocolInfoList & | protocols () const
bool | hasProtocol (const QString &protocolName) const
ProtocolInfo | protocol (const QString &protocolName) const
Public Member Functions inherited from Tp::StatelessDBusProxy
| StatelessDBusProxy (const QDBusConnection &dbusConnection, const QString &busName, const QString &objectPath, const Feature &featureCore)
virtual | ~StatelessDBusProxy ()
Public Member Functions inherited from Tp::DBusProxy
| DBusProxy (const QDBusConnection &dbusConnection, const QString &busName, const QString &objectPath, const Feature &featureCore)
virtual | ~DBusProxy ()
QDBusConnection | dbusConnection () const
QString | busName () const
QString | objectPath () const
bool | isValid () const
QString | invalidationReason () const
QString | invalidationMessage () const
Public Member Functions inherited from Tp::Object
virtual | ~Object ()
Public Member Functions inherited from Tp::RefCounted
| RefCounted ()
virtual | ~RefCounted ()
Public Member Functions inherited from Tp::ReadyObject
| ReadyObject (RefCounted *object, const Feature &featureCore)
| ReadyObject (DBusProxy *proxy, const Feature &featureCore)
virtual | ~ReadyObject ()
virtual bool | isReady (const Features &features=Features()) const
virtual PendingReady * | becomeReady (const Features &requestedFeatures=Features())
virtual Features | requestedFeatures () const
virtual Features | actualFeatures () const
virtual Features | missingFeatures () const
Public Member Functions inherited from Tp::OptionalInterfaceFactory< ConnectionManager >
| OptionalInterfaceFactory (ConnectionManager *this_)
| ~OptionalInterfaceFactory ()
QStringList | interfaces () const
bool | hasInterface (const QString &name) const
Interface * | optionalInterface (InterfaceSupportedChecking check=CheckInterfaceSupported) const
Interface * | interface () const

## Static Public Member Functions

static ConnectionManagerPtr | create (const QDBusConnection &bus, const QString &name)
static ConnectionManagerPtr | create (const QString &name, const ConnectionFactoryConstPtr &connectionFactory=ConnectionFactory::create(QDBusConnection::sessionBus()), const ChannelFactoryConstPtr &channelFactory=ChannelFactory::create(QDBusConnection::sessionBus()), const ContactFactoryConstPtr &contactFactory=ContactFactory::create())
static ConnectionManagerPtr | create (const QDBusConnection &bus, const QString &name, const ConnectionFactoryConstPtr &connectionFactory, const ChannelFactoryConstPtr &channelFactory, const ContactFactoryConstPtr &contactFactory=ContactFactory::create())
static PendingStringList * | listNames (const QDBusConnection &bus=QDBusConnection::sessionBus())

## Static Public Attributes

static const Feature | FeatureCore

## Protected Member Functions

| ConnectionManager (const QDBusConnection &bus, const QString &name, const ConnectionFactoryConstPtr &connectionFactory, const ChannelFactoryConstPtr &channelFactory, const ContactFactoryConstPtr &contactFactory)
Client::ConnectionManagerInterface * | baseInterface () const
Protected Member Functions inherited from Tp::DBusProxy
void | setBusName (const QString &busName)
void | invalidate (const QString &reason, const QString &message)
void | invalidate (const QDBusError &error)
Protected Member Functions inherited from Tp::Object
| Object ()
void | notify (const char *propertyName)
Protected Member Functions inherited from Tp::ReadyObject
ReadinessHelper * | readinessHelper () const
Protected Member Functions inherited from Tp::OptionalInterfaceFactory< ConnectionManager >
void | setInterfaces (const QStringList &interfaces)

## Properties

QString | name
QStringList | supportedProtocols
ProtocolInfoList | protocols

## Additional Inherited Members

Public Types inherited from Tp::OptionalInterfaceFactory< ConnectionManager >
enum | InterfaceSupportedChecking
Signals inherited from Tp::DBusProxy
void | invalidated (Tp::DBusProxy *proxy, const QString &errorName, const QString &errorMessage)
Signals inherited from Tp::Object
void | propertyChanged (const QString &propertyName)

## Detailed Description

The ConnectionManager class represents a Telepathy connection manager.

Connection managers allow connections to be made on one or more protocols.

Most client applications should use this functionality via the AccountManager, to allow connections to be shared between client applications.

## Constructor & Destructor Documentation

Tp::ConnectionManager::~ConnectionManager | ( |  | ) |

virtual

Class destructor.

Tp::ConnectionManager::ConnectionManager | ( | const QDBusConnection & | bus,
|  | const QString & | name,
|  | const ConnectionFactoryConstPtr & | connectionFactory,
|  | const ChannelFactoryConstPtr & | channelFactory,
|  | const ContactFactoryConstPtr & | contactFactory
| ) |  |

protected

Construct a new ConnectionManager object using the given bus.

Parameters

  bus | QDBusConnection to use.
  name | Name of the connection manager.
  connectionFactory | The connection factory to use.
  channelFactory | The channel factory to use.
  contactFactory | The contact factory to use.

## Member Function Documentation

ConnectionManagerPtr Tp::ConnectionManager::create | ( | const QDBusConnection & | bus,
|  | const QString & | name
| ) |  |

static

Create a new ConnectionManager object.

The instance will use a connection factory creating Tp::Connection objects with no features ready, and a channel factory creating stock Telepathy-Qt channel subclasses, as appropriate, with no features ready.

Parameters

  bus | QDBusConnection to use.
  name | Name of the connection manager.

Returns
  A ConnectionManagerPtr object pointing to the newly created ConnectionManager object.

ConnectionManagerPtr Tp::ConnectionManager::create | ( | const QString & | name,
|  | const ConnectionFactoryConstPtr & | connectionFactory = `ConnectionFactory::create(QDBusConnection::sessionBus())`,
|  | const ChannelFactoryConstPtr & | channelFactory = `ChannelFactory::create(QDBusConnection::sessionBus())`,
|  | const ContactFactoryConstPtr & | contactFactory = `ContactFactory::create()`
| ) |  |

static

Create a new ConnectionManager using QDBusConnection::sessionBus() and the given factories.

The channel factory is passed to any Connection objects created by this manager object. In fact, they're not used directly by ConnectionManager at all.

A warning is printed if the factories are for a bus different from QDBusConnection::sessionBus().

Parameters

  name | Name of the connection manager.
  connectionFactory | The connection factory to use.
  channelFactory | The channel factory to use.
  contactFactory | The contact factory to use.

Returns
  A ConnectionManagerPtr object pointing to the newly created ConnectionManager object.

ConnectionManagerPtr Tp::ConnectionManager::create | ( | const QDBusConnection & | bus,
|  | const QString & | name,
|  | const ConnectionFactoryConstPtr & | connectionFactory,
|  | const ChannelFactoryConstPtr & | channelFactory,
|  | const ContactFactoryConstPtr & | contactFactory = `ContactFactory::create()`
| ) |  |

static

Create a new ConnectionManager using the given bus and the given factories.

The channel factory is passed to any Connection objects created by this manager object. In fact, they're not used directly by ConnectionManager at all.

A warning is printed if the factories are for a bus different from QDBusConnection::sessionBus().

Parameters

  bus | QDBusConnection to use.
  name | Name of the connection manager.
  connectionFactory | The connection factory to use.
  channelFactory | The channel factory to use.
  contactFactory | The contact factory to use.

Returns
  A ConnectionManagerPtr object pointing to the newly created ConnectionManager object.

QString Tp::ConnectionManager::name | ( |  | ) | const

ConnectionFactoryConstPtr Tp::ConnectionManager::connectionFactory | ( |  | ) | const

Return the connection factory used by this manager.

Only read access is provided. This allows constructing object instances and examining the object construction settings, but not changing settings. Allowing changes would lead to tricky situations where objects constructed at different times by the manager would have unpredictably different construction settings (eg. subclass).

Returns
  A read-only pointer to the ConnectionFactory object.

ChannelFactoryConstPtr Tp::ConnectionManager::channelFactory | ( |  | ) | const

Return the channel factory used by this manager.

Only read access is provided. This allows constructing object instances and examining the object construction settings, but not changing settings. Allowing changes would lead to tricky situations where objects constructed at different times by the manager would have unpredictably different construction settings (eg. subclass).

Returns
  A read-only pointer to the ChannelFactory object.

ContactFactoryConstPtr Tp::ConnectionManager::contactFactory | ( |  | ) | const

Return the contact factory used by this manager.

Only read access is provided. This allows constructing object instances and examining the object construction settings, but not changing settings. Allowing changes would lead to tricky situations where objects constructed at different times by the manager would have unpredictably different construction settings (eg. subclass).

Returns
  A read-only pointer to the ContactFactory object.

QStringList Tp::ConnectionManager::supportedProtocols | ( |  | ) | const

const ProtocolInfoList& Tp::ConnectionManager::protocols | ( |  | ) | const

bool Tp::ConnectionManager::hasProtocol | ( | const QString & | protocolName | ) | const

Return whether this connection manager implements the protocol specified by protocolName.

This method requires ConnectionManager::FeatureCore to be ready.

Returns
  `true` if the protocol is supported, `false` otherwise.

See Also
  protocol(), protocols()

ProtocolInfo Tp::ConnectionManager::protocol | ( | const QString & | protocolName | ) | const

Return the ProtocolInfo object for the protocol specified by protocolName.

This method requires ConnectionManager::FeatureCore to be ready.

Parameters

  protocolName | The name of the protocol.

Returns
  A ProtocolInfo object which will return `for` ProtocolInfo::isValid() if the protocol specified by protocolName is not supported.

See Also
  hasProtocol()

PendingStringList * Tp::ConnectionManager::listNames | ( | const QDBusConnection & | bus = `QDBusConnection::sessionBus()` | ) |

static

Return a pending operation from which a list of all installed connection manager short names (such as "gabble" or "haze") can be retrieved if it succeeds.

Returns
  A PendingStringList which will emit PendingStringList::finished when this object has finished or failed getting the connection manager names.

Client::ConnectionManagerInterface * Tp::ConnectionManager::baseInterface | ( |  | ) | const

protected

Return the Client::ConnectionManagerInterface for this ConnectionManager. This method is protected since the convenience methods provided by this class should generally be used instead of calling D-Bus methods directly.

Returns
  A pointer to the existing Client::ConnectionManagerInterface for this ConnectionManager object.

## Member Data Documentation

const Feature Tp::ConnectionManager::FeatureCore

static

Feature representing the core that needs to become ready to make the ConnectionManager object usable.

Note that this feature must be enabled in order to use most ConnectionManager methods. See specific methods documentation for more details.

When calling isReady(), becomeReady(), this feature is implicitly added to the requested features.

## Property Documentation

QString Tp::ConnectionManager::name

read

Return the short name of the connection manager (e.g. "gabble").

Returns
  The name of the connection manager.

QStringList Tp::ConnectionManager::supportedProtocols

read

Return a list of strings identifying the protocols supported by this connection manager, as described in the Telepathy specification (e.g. "jabber").

These identifiers are not intended to be displayed to users directly; user interfaces are responsible for mapping them to localized strings.

This method requires ConnectionManager::FeatureCore to be ready.

Returns
  A list of supported protocols.

const ProtocolInfoList & Tp::ConnectionManager::protocols

read

Return a list of protocols info for this connection manager.

Note that the returned ProtocolInfoList contents should not be freed.

This method requires ConnectionManager::FeatureCore to be ready.

Returns
  A list of ṔrotocolInfo.