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);
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 private:
94  class Private;
95  friend class Private;
96  Private *mPriv;
97 };
98 
99 }
100 
101 #endif
Base class for D-Bus services.
Definition: dbus-service.h:46
A QObject on which low-level D-Bus adaptors are plugged to provide a D-Bus object.
Definition: dbus-object.h:39
The Object class provides an object with property notification.
Definition: object.h:39
Small container class, containing a D-Bus error.
Definition: dbus-error.h:35
Base class for D-Bus service interfaces.
Definition: dbus-service.h:73


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt 0.9.5