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

Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Tp::BaseConnection Class Reference
Service-side implementation » Connection service implementation

Base class for Connection implementations. More...

`#include <TelepathyQt/BaseConnection>`

Inheritance diagram for Tp::BaseConnection:
[legend]

## Public Types

typedef Callback2< BaseChannelPtr, const QVariantMap &, DBusError * > | CreateChannelCallback
typedef Callback1< void, DBusError * > | ConnectCallback
typedef Callback3< QStringList, uint, const Tp::UIntList &, DBusError * > | InspectHandlesCallback
typedef Callback3< Tp::UIntList, uint, const QStringList &, DBusError * > | RequestHandlesCallback

## Signals

void | disconnected ()
Signals inherited from Tp::Object
void | propertyChanged (const QString &propertyName)

## Public Member Functions

virtual | ~BaseConnection ()
QString | cmName () const
QString | protocolName () const
QVariantMap | parameters () const
QVariantMap | immutableProperties () const
uint | selfHandle () const
void | setSelfHandle (uint selfHandle)
QString | selfID () const
void | setSelfID (const QString &selfID)
void | setSelfContact (uint selfHandle, const QString &selfID)
uint | status () const
void | setStatus (uint newStatus, uint reason)
void | setCreateChannelCallback (const CreateChannelCallback &cb)
BaseChannelPtr | createChannel (const QVariantMap &request, bool suppressHandler, DBusError *error)
void | setConnectCallback (const ConnectCallback &cb)
void | setInspectHandlesCallback (const InspectHandlesCallback &cb)
QStringList | inspectHandles (uint handleType, const Tp::UIntList &handles, DBusError *error)
void | setRequestHandlesCallback (const RequestHandlesCallback &cb)
Tp::UIntList | requestHandles (uint handleType, const QStringList &identifiers, DBusError *error)
Tp::ChannelInfoList | channelsInfo ()
Tp::ChannelDetailsList | channelsDetails ()
BaseChannelPtr | ensureChannel (const QVariantMap &request, bool &yours, bool suppressHandler, DBusError *error)
void | addChannel (BaseChannelPtr channel, bool suppressHandler=false)
QList< AbstractConnectionInterfacePtr > | interfaces () const
AbstractConnectionInterfacePtr | interface (const QString &interfaceName) const
bool | plugInterface (const AbstractConnectionInterfacePtr &interface)
bool | registerObject (DBusError *error=NULL)
virtual QString | uniqueName () const
Public Member Functions inherited from Tp::DBusService
| DBusService (const QDBusConnection &dbusConnection)
virtual | ~DBusService ()
QDBusConnection | dbusConnection () const
QString | busName () const
QString | objectPath () const
DBusObject * | dbusObject () const
bool | isRegistered () const
Public Member Functions inherited from Tp::Object
virtual | ~Object ()
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 BaseConnectionPtr | create (const QString &cmName, const QString &protocolName, const QVariantMap &parameters, const QDBusConnection &dbusConnection=QDBusConnection::sessionBus())
template<typename BaseConnectionSubclass >
static SharedPtr< BaseConnectionSubclass > | create (const QString &cmName, const QString &protocolName, const QVariantMap &parameters, const QDBusConnection &dbusConnection=QDBusConnection::sessionBus())
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)

## Protected Member Functions

| BaseConnection (const QDBusConnection &dbusConnection, const QString &cmName, const QString &protocolName, const QVariantMap &parameters)
virtual bool | registerObject (const QString &busName, const QString &objectPath, DBusError *error)
virtual bool | matchChannel (const Tp::BaseChannelPtr &channel, const QVariantMap &request, Tp::DBusError *error)
Protected Member Functions inherited from Tp::Object
| Object ()
void | notify (const char *propertyName)
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)

## Additional Inherited Members

Static Protected Member Functions inherited from QObject
QByteArray | normalizeSignalSlot (const char *signalSlot)
Properties inherited from QObject
| objectName

## Detailed Description

Base class for Connection implementations.

## Member Typedef Documentation

## § CreateChannelCallback

typedef Callback2<BaseChannelPtr, const QVariantMap &, DBusError*> Tp::BaseConnection::CreateChannelCallback

## § ConnectCallback

typedef Callback1<void, DBusError*> Tp::BaseConnection::ConnectCallback

## § InspectHandlesCallback

typedef Callback3<QStringList, uint, const Tp::UIntList &, DBusError*> Tp::BaseConnection::InspectHandlesCallback

## § RequestHandlesCallback

typedef Callback3<Tp::UIntList, uint, const QStringList &, DBusError*> Tp::BaseConnection::RequestHandlesCallback

## Constructor & Destructor Documentation

## § ~BaseConnection()

Tp::BaseConnection::~BaseConnection | ( |  | ) |

virtual

Class destructor.

## § BaseConnection()

Tp::BaseConnection::BaseConnection | ( | const QDBusConnection & | dbusConnection,
|  | const QString & | cmName,
|  | const QString & | protocolName,
|  | const QVariantMap & | parameters
| ) |  |

protected

Construct a BaseConnection.

Parameters

  dbusConnection | The D-Bus connection that will be used by this object.
  cmName | The name of the connection manager associated with this connection.
  protocolName | The name of the protocol associated with this connection.
  parameters | The parameters of this connection.

## Member Function Documentation

## § create() [1/2]

static BaseConnectionPtr Tp::BaseConnection::create | ( | const QString & | cmName,
|  | const QString & | protocolName,
|  | const QVariantMap & | parameters,
|  | const QDBusConnection & | dbusConnection = `QDBusConnection::sessionBus()`
| ) |  |

inline static

## § create() [2/2]

template<typename BaseConnectionSubclass >

static SharedPtr<BaseConnectionSubclass> Tp::BaseConnection::create | ( | const QString & | cmName,
|  | const QString & | protocolName,
|  | const QVariantMap & | parameters,
|  | const QDBusConnection & | dbusConnection = `QDBusConnection::sessionBus()`
| ) |  |

inline static

## § cmName()

QString Tp::BaseConnection::cmName | ( |  | ) | const

Return the name of the connection manager associated with this connection.

Returns
  The name of the connection manager associated with this connection.

## § protocolName()

QString Tp::BaseConnection::protocolName | ( |  | ) | const

Return the name of the protocol associated with this connection.

Returns
  The name of the protocol associated with this connection.

## § parameters()

QVariantMap Tp::BaseConnection::parameters | ( |  | ) | const

Return the parameters of this connection.

Returns
  The parameters of this connection.

## § immutableProperties()

QVariantMap Tp::BaseConnection::immutableProperties | ( |  | ) | const

virtual

Return the immutable properties of this connection object.

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

Returns
  The immutable properties of this connection object.

Implements Tp::DBusService.

## § selfHandle()

uint Tp::BaseConnection::selfHandle | ( |  | ) | const

## § setSelfHandle()

void Tp::BaseConnection::setSelfHandle | ( | uint | selfHandle | ) |

## § selfID()

QString Tp::BaseConnection::selfID | ( |  | ) | const

## § setSelfID()

void Tp::BaseConnection::setSelfID | ( | const QString & | selfID | ) |

## § setSelfContact()

void Tp::BaseConnection::setSelfContact | ( | uint | selfHandle,
|  | const QString & | selfID
| ) |  |

## § status()

uint Tp::BaseConnection::status | ( |  | ) | const

## § setStatus()

void Tp::BaseConnection::setStatus | ( | uint | newStatus,
|  | uint | reason
| ) |  |

## § setCreateChannelCallback()

void Tp::BaseConnection::setCreateChannelCallback | ( | const CreateChannelCallback & | cb | ) |

## § createChannel()

Tp::BaseChannelPtr Tp::BaseConnection::createChannel | ( | const QVariantMap & | request,
|  | bool | suppressHandler,
|  | DBusError * | error
| ) |  |

## § setConnectCallback()

void Tp::BaseConnection::setConnectCallback | ( | const ConnectCallback & | cb | ) |

## § setInspectHandlesCallback()

void Tp::BaseConnection::setInspectHandlesCallback | ( | const InspectHandlesCallback & | cb | ) |

## § inspectHandles()

QStringList Tp::BaseConnection::inspectHandles | ( | uint | handleType,
|  | const Tp::UIntList & | handles,
|  | DBusError * | error
| ) |  |

## § setRequestHandlesCallback()

void Tp::BaseConnection::setRequestHandlesCallback | ( | const RequestHandlesCallback & | cb | ) |

## § requestHandles()

Tp::UIntList Tp::BaseConnection::requestHandles | ( | uint | handleType,
|  | const QStringList & | identifiers,
|  | DBusError * | error
| ) |  |

## § channelsInfo()

Tp::ChannelInfoList Tp::BaseConnection::channelsInfo | ( |  | ) |

## § channelsDetails()

Tp::ChannelDetailsList Tp::BaseConnection::channelsDetails | ( |  | ) |

## § ensureChannel()

Tp::BaseChannelPtr Tp::BaseConnection::ensureChannel | ( | const QVariantMap & | request,
|  | bool & | yours,
|  | bool | suppressHandler,
|  | DBusError * | error
| ) |  |

Return a new or exists channel, satisfying the given request.

This method iterate over exist channels to find the one satisfying the request. If there is no suitable channel, then new channel with given request details will be created. This method uses the matchChannel() method to check whether there exists a channel which confirms with the request.

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

Parameters

  request | A dictionary containing the desirable properties.
  yours | A returning argument. `true` if returned channel is a new one and `false` otherwise.
  suppressHandler | An option to suppress handler in case of a new channel creation.
  error | A pointer to an empty DBusError where any possible error will be stored.

Returns
  A pointer to a channel, satisfying the given request.

See also
  matchChannel()

## § addChannel()

void Tp::BaseConnection::addChannel | ( | BaseChannelPtr | channel,
|  | bool | suppressHandler = `false`
| ) |  |

## § interfaces()

QList< AbstractConnectionInterfacePtr > Tp::BaseConnection::interfaces | ( |  | ) | const

Return a list of interfaces that have been plugged into this Protocol D-Bus object with plugInterface().

This property is immutable and cannot change after this Protocol object has been registered on the bus with registerObject().

Returns
  A list containing all the Protocol interface implementation objects.

See also
  plugInterface(), interface()

## § interface()

AbstractConnectionInterfacePtr Tp::BaseConnection::interface | ( | const QString & | interfaceName | ) | const

Return a pointer to the interface with the given name.

Parameters

  interfaceName | The D-Bus name of the interface, ex. TP_QT_IFACE_CONNECTION_INTERFACE_ADDRESSING.

Returns
  A pointer to the AbstractConnectionInterface object that implements the D-Bus interface with the given name, or a null pointer if such an interface has not been plugged into this object.

See also
  plugInterface(), interfaces()

## § plugInterface()

bool Tp::BaseConnection::plugInterface | ( | const AbstractConnectionInterfacePtr & | interface | ) |

Plug a new interface into this Connection D-Bus object.

This property is immutable and cannot change after this Protocol object has been registered on the bus with registerObject().

Parameters

  interface | An AbstractConnectionInterface instance that implements the interface that is to be plugged.

Returns
  `true` on success or `false` otherwise

See also
  interfaces(), interface()

## § registerObject() [1/2]

bool Tp::BaseConnection::registerObject | ( | DBusError * | error = `NULL` | ) |

Register this connection object on the bus.

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

Parameters

  error | A 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 object is already registered.

See also
  isRegistered()

## § uniqueName()

QString Tp::BaseConnection::uniqueName | ( |  | ) | const

virtual

Return a unique name for this connection.

Returns
  A unique name for this connection.

## § disconnected

void Tp::BaseConnection::disconnected | ( |  | ) |

signal

Emitted when this connection has been disconnected.

## § registerObject() [2/2]

bool Tp::BaseConnection::registerObject | ( | const QString & | busName,
|  | const QString & | objectPath,
|  | DBusError * | error
| ) |  |

protected virtual

Reimplemented from DBusService.

Reimplemented from Tp::DBusService.

## § matchChannel()

bool Tp::BaseConnection::matchChannel | ( | const Tp::BaseChannelPtr & | channel,
|  | const QVariantMap & | request,
|  | Tp::DBusError * | error
| ) |  |

protected virtual

Check channel on conformity with request.

This virtual method is used to check if a channel satisfying the given request. It is warranted, that the type of the channel meets the requested type.

The default implementation compares TargetHandleType and TargetHandle/TargetID. If error is passed, any error that may occur will be stored there.

Parameters

  channel | A pointer to a channel to be checked.
  request | A dictionary containing the desirable properties.
  error | A pointer to an empty DBusError where any possible error will be stored.

Returns
  `true` if channel match the request and `false` otherwise.

See also
  ensureChannel()