Home · Modules · All Classes · All Namespaces
Public Member Functions | Protected Member Functions | List of all members
Tp::DBusService Class Referenceabstract

Base class for D-Bus services. More...

#include <TelepathyQt/DBusService>

Inherits Tp::Object.

Inherited by Tp::BaseCallContent, Tp::BaseChannel, Tp::BaseConnection, Tp::BaseConnectionManager, Tp::BaseDebug, and Tp::BaseProtocol.

Public Member Functions

 DBusService (const QDBusConnection &dbusConnection)
 
virtual ~DBusService ()
 
virtual QVariantMap immutableProperties () const =0
 
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 ()
 

Protected Member Functions

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

Additional Inherited Members

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

Detailed Description

Base class for D-Bus services.

This class serves as a base for all the classes that are used to implement D-Bus services.

Constructor & Destructor Documentation

◆ DBusService()

Tp::DBusService::DBusService ( const QDBusConnection &  dbusConnection)

Construct a DBusService that uses the given dbusConnection.

Parameters
dbusConnectionThe D-Bus connection that will be used by this service.

◆ ~DBusService()

Tp::DBusService::~DBusService ( )
virtual

Class destructor.

Member Function Documentation

◆ immutableProperties()

QVariantMap Tp::DBusService::immutableProperties ( ) const
pure virtual

Return the immutable properties of this D-Bus service object.

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

Returns
The immutable properties of this D-Bus service object.

Implemented in Tp::BaseProtocol, Tp::BaseCallContent, Tp::BaseConnectionManager, Tp::BaseConnection, and Tp::BaseChannel.

◆ dbusConnection()

QDBusConnection Tp::DBusService::dbusConnection ( ) const

Return the D-Bus connection associated with this service.

Returns
the D-Bus connection associated with this service.

◆ busName()

QString Tp::DBusService::busName ( ) const

Return the D-Bus service name of this service.

This is only valid after this service has been registered on the bus using registerObject().

Returns
the D-Bus service name of this service.

◆ objectPath()

QString Tp::DBusService::objectPath ( ) const

Return the D-Bus object path of this service.

This is only valid after this service has been registered on the bus using registerObject().

Returns
the D-Bus object path of this service.

◆ dbusObject()

DBusObject * Tp::DBusService::dbusObject ( ) const

Return the DBusObject that is used for registering this service on the bus.

The DBusObject is the object on which all the interface adaptors for this service are plugged.

Returns
a pointer to the DBusObject that is used for registering this service on the bus.

◆ isRegistered()

bool Tp::DBusService::isRegistered ( ) const

Return whether this D-Bus service has been registered on the bus or not.

Returns
true if the service has been registered, or false otherwise.

◆ registerObject()

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

Register this service object on the bus with the given busName and objectPath.

error needs to be a valid pointer to a DBusError instance, where any possible D-Bus error will be stored.

A service may only be registered once in its lifetime. Use isRegistered() to find out if it has already been registered or not.

You normally don't need to use this method directly. Subclasses should provide a simplified version of it.

Parameters
busNameThe D-Bus service name of this object.
objectPathThe D-Bus object path of this object.
errorA pointer to a valid DBusError instance, where any possible D-Bus error will be stored.
Returns
true on success or false otherwise.

Reimplemented in Tp::BaseConnection, Tp::BaseProtocol, Tp::BaseCallContent, Tp::BaseConnectionManager, and Tp::BaseChannel.