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

dbus-service.h
1
23 #ifndef _TelepathyQt_dbus_service_h_HEADER_GUARD_
24 #define _TelepathyQt_dbus_service_h_HEADER_GUARD_
25
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29
30 #include <TelepathyQt/DBusError>
31 #include <TelepathyQt/Global>
32 #include <TelepathyQt/Object>
33 #include <TelepathyQt/ServiceTypes>
34
35 #include <QObject>
36 #include <QVariantMap>
37
38 class QDBusConnection;
39 class QString;
40
41 namespace Tp
42 {
43
44 class DBusObject;
45
46 class TP_QT_EXPORT DBusService : public Object
47 {
48 Q_OBJECT
49 Q_DISABLE_COPY(DBusService)
50
51 public:
52 DBusService(const QDBusConnection &dbusConnection);
53 virtual ~DBusService();
54
55 virtual QVariantMap immutableProperties() const = 0;
56
57 QDBusConnection dbusConnection() const;
58 QString busName() const;
59 QString objectPath() const;
60 DBusObject *dbusObject() const;
61 bool isRegistered() const;
62
63 protected:
64 virtual bool registerObject(const QString &busName, const QString &objectPath,
65 DBusError *error);
66
67 private:
68 class Private;
69 friend class Private;
70 Private *mPriv;
71 };
72
73 class TP_QT_EXPORT AbstractDBusServiceInterface : public Object
74 {
75 Q_OBJECT
76 Q_DISABLE_COPY(AbstractDBusServiceInterface)
77
78 public:
79 AbstractDBusServiceInterface(const QString &interfaceName);
80 virtual ~AbstractDBusServiceInterface();
81
82 QString interfaceName() const;
83
84 virtual QVariantMap immutableProperties() const = 0;
85
86 DBusObject *dbusObject() const;
87 bool isRegistered() const;
88
89 protected:
90 virtual bool registerInterface(DBusObject *dbusObject);
91 virtual void createAdaptor() = 0;
92
93 public:
94 bool notifyPropertyChanged(const QString &propertyName, const QVariant &propertyValue);
95
96 private:
97 class Private;
98 friend class Private;
99 Private *mPriv;
100 };
101
102 }
103
104 #endif
Tp
Definition: abstract-adaptor.cpp:31
QDBusConnection
Tp::AbstractDBusServiceInterface
Base class for D-Bus service interfaces.
Definition: dbus-service.h:73
QString
Tp::DBusObject
A QObject on which low-level D-Bus adaptors are plugged to provide a D-Bus object.
Definition: dbus-object.h:39
Tp::DBusService
Base class for D-Bus services.
Definition: dbus-service.h:46
Tp::Object
The Object class provides an object with property notification.
Definition: object.h:39
Tp::DBusError
Small container class, containing a D-Bus error.
Definition: dbus-error.h:35
QVariant