Home · Modules · All Classes · All Namespaces
Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members

Base class for connection manager implementations. More...

#include <TelepathyQt/BaseConnectionManager>

Inherits Tp::DBusService.

Signals

void newConnection (const BaseConnectionPtr &connection)
 
- Signals inherited from Tp::Object
void propertyChanged (const QString &propertyName)
 

Public Member Functions

virtual ~BaseConnectionManager ()
 
QString name () const
 
QVariantMap immutableProperties () const
 
QList< BaseProtocolPtr > protocols () const
 
BaseProtocolPtr protocol (const QString &protocolName) const
 
bool hasProtocol (const QString &protocolName) const
 
bool addProtocol (const BaseProtocolPtr &protocol)
 
bool registerObject (DBusError *error=NULL)
 
QList< BaseConnectionPtr > connections () const
 
- Public Member Functions inherited from Tp::DBusService
 DBusService (const QDBusConnection &dbusConnection)
 
virtual ~DBusService ()
 
QDBusConnection dbusConnection () const
 
QString busName () const
 
QString objectPath () const
 
DBusObjectdbusObject () const
 
bool isRegistered () const
 
- Public Member Functions inherited from Tp::Object
virtual ~Object ()
 
- Public Member Functions inherited from Tp::RefCounted
 RefCounted ()
 
virtual ~RefCounted ()
 

Static Public Member Functions

static BaseConnectionManagerPtr create (const QString &name)
 
template<typename BaseConnectionManagerSubclass >
static SharedPtr< BaseConnectionManagerSubclass > create (const QString &name)
 
static BaseConnectionManagerPtr create (const QDBusConnection &dbusConnection, const QString &name)
 
template<typename BaseConnectionManagerSubclass >
static SharedPtr< BaseConnectionManagerSubclass > create (const QDBusConnection &dbusConnection, const QString &name)
 

Protected Member Functions

 BaseConnectionManager (const QDBusConnection &dbusConnection, const QString &name)
 
virtual bool registerObject (const QString &busName, const QString &objectPath, DBusError *error)
 
- Protected Member Functions inherited from Tp::Object
 Object ()
 
void notify (const char *propertyName)
 

Detailed Description

Base class for connection manager implementations.

Constructor & Destructor Documentation

◆ ~BaseConnectionManager()

Tp::BaseConnectionManager::~BaseConnectionManager ( )
virtual

Class destructor.

◆ BaseConnectionManager()

Tp::BaseConnectionManager::BaseConnectionManager ( const QDBusConnection &  dbusConnection,
const QString &  name 
)
protected

Constructs a new BaseConnectionManager object that implements a connection manager on the given dbusConnection and has the given name.

Parameters
dbusConnectionThe QDBusConnection to use.
nameThe name of the connection manager.

Member Function Documentation

◆ create() [1/4]

static BaseConnectionManagerPtr Tp::BaseConnectionManager::create ( const QString &  name)
inlinestatic

◆ create() [2/4]

template<typename BaseConnectionManagerSubclass >
static SharedPtr<BaseConnectionManagerSubclass> Tp::BaseConnectionManager::create ( const QString &  name)
inlinestatic

◆ create() [3/4]

static BaseConnectionManagerPtr Tp::BaseConnectionManager::create ( const QDBusConnection &  dbusConnection,
const QString &  name 
)
inlinestatic

◆ create() [4/4]

template<typename BaseConnectionManagerSubclass >
static SharedPtr<BaseConnectionManagerSubclass> Tp::BaseConnectionManager::create ( const QDBusConnection &  dbusConnection,
const QString &  name 
)
inlinestatic

◆ name()

QString Tp::BaseConnectionManager::name ( ) const

Return the connection manager's name, as given on the constructor.

Returns
The connection manager's name.

◆ immutableProperties()

QVariantMap Tp::BaseConnectionManager::immutableProperties ( ) const
virtual

Return the immutable properties of this connection manager object.

Immutable properties cannot change after the object has been registered on the bus with registerObject().

Returns
The immutable properties of this connection manager object.

Implements Tp::DBusService.

◆ protocols()

QList< BaseProtocolPtr > Tp::BaseConnectionManager::protocols ( ) const

Return a list of all protocols that this connection manager implements.

This property is immutable and cannot change after the connection manager has been registered on the bus with registerObject().

Returns
A list of all protocols that this connection manager implements.
See also
addProtocol(), hasProtocol(), protocol()

◆ protocol()

BaseProtocolPtr Tp::BaseConnectionManager::protocol ( const QString &  protocolName) const

Return a pointer to the BaseProtocol instance that implements the protocol with the given protocolName, or a null BaseProtocolPtr if no such protocol has been added to the connection manager.

Parameters
protocolNameThe name of the protocol in interest.
Returns
The BaseProtocol instance that implements the protocol with the given protocolName.
See also
hasProtocol(), protocols(), addProtocol()

◆ hasProtocol()

bool Tp::BaseConnectionManager::hasProtocol ( const QString &  protocolName) const

Return whether a protocol with the given protocolName has been added to the connection manager.

Parameters
protocolNameThe name of the protocol in interest.
Returns
true if a protocol with the given protocolName has been added to the connection manager, or false otherwise.
See also
addProtocol(), protocol(), protocols()

◆ addProtocol()

bool Tp::BaseConnectionManager::addProtocol ( const BaseProtocolPtr &  protocol)

Add a new protocol to the list of protocols that this connection manager implements.

Note that you cannot add new protocols after the connection manager has been registered on the bus with registerObject(). In addition, you cannot add two protocols with the same name. If any of these conditions is not met, this function will return false and print a suitable warning.

Parameters
protocolThe protocol to add.
Returns
true on success or false otherwise.

◆ registerObject() [1/2]

bool Tp::BaseConnectionManager::registerObject ( DBusError error = NULL)

Register this connection manager on the bus.

A connection manager can only be registered once, and it should be registered only after all the protocols it implements have been added with addProtocol().

If error is passed, any D-Bus error that may occur will be stored there.

Parameters
errorA pointer to an empty DBusError where any possible D-Bus error will be stored.
Returns
true on success and false if there was an error or this connection manager is already registered.
See also
isRegistered()

◆ connections()

QList< BaseConnectionPtr > Tp::BaseConnectionManager::connections ( ) const

Return a list of all connections that have currently been made.

Returns
A list of all connections that have currently been made.

◆ newConnection

void Tp::BaseConnectionManager::newConnection ( const BaseConnectionPtr &  connection)
signal

◆ registerObject() [2/2]

bool Tp::BaseConnectionManager::registerObject ( const QString &  busName,
const QString &  objectPath,
DBusError error 
)
protectedvirtual

Reimplemented from DBusService.

Reimplemented from Tp::DBusService.