summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2012-04-02 09:26:41 -0300
committerAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2012-04-02 10:33:11 -0300
commita4c73115e63bb4df160e17d4b48db8f05cd728e9 (patch)
treeccf01f92ccc510ef40bff6c282d8c03c7ed17774
parent2169b5b50ac788719930930e627b323adf14c1db (diff)
AbstractDBusServiceInterface: Add base class (abstract) for DBusService optional interfaces.
-rw-r--r--TelepathyQt/AbstractDBusServiceInterface13
-rw-r--r--TelepathyQt/CMakeLists.txt1
-rw-r--r--TelepathyQt/dbus-service.cpp25
-rw-r--r--TelepathyQt/dbus-service.h19
4 files changed, 58 insertions, 0 deletions
diff --git a/TelepathyQt/AbstractDBusServiceInterface b/TelepathyQt/AbstractDBusServiceInterface
new file mode 100644
index 00000000..05806e6e
--- /dev/null
+++ b/TelepathyQt/AbstractDBusServiceInterface
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt_AbstractDBusServiceInterface_HEADER_GUARD_
+#define _TelepathyQt_AbstractDBusServiceInterface_HEADER_GUARD_
+
+#ifndef IN_TP_QT_HEADER
+#define IN_TP_QT_HEADER
+#endif
+
+#include <TelepathyQt/dbus-service.h>
+
+#undef IN_TP_QT_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt/CMakeLists.txt b/TelepathyQt/CMakeLists.txt
index 701a5726..685c59d4 100644
--- a/TelepathyQt/CMakeLists.txt
+++ b/TelepathyQt/CMakeLists.txt
@@ -833,6 +833,7 @@ if(ENABLE_EXPERIMENTAL_SERVICE_SUPPORT)
set(telepathy_qt_service_HEADERS
AbstractAdaptor
abstract-adaptor.h
+ AbstractDBusServiceInterface
BaseConnectionManager
base-connection-manager.h
BaseConnection
diff --git a/TelepathyQt/dbus-service.cpp b/TelepathyQt/dbus-service.cpp
index 6b444185..b6826ed5 100644
--- a/TelepathyQt/dbus-service.cpp
+++ b/TelepathyQt/dbus-service.cpp
@@ -120,4 +120,29 @@ bool DBusService::registerObject(const QString &busName, const QString &objectPa
return true;
}
+struct AbstractDBusServiceInterface::Private
+{
+ Private(const QLatin1String &interfaceName)
+ : interfaceName(interfaceName)
+ {
+ }
+
+ QLatin1String interfaceName;
+};
+
+AbstractDBusServiceInterface::AbstractDBusServiceInterface(const QLatin1String &interfaceName)
+ : mPriv(new Private(interfaceName))
+{
+}
+
+AbstractDBusServiceInterface::~AbstractDBusServiceInterface()
+{
+ delete mPriv;
+}
+
+QLatin1String AbstractDBusServiceInterface::interfaceName() const
+{
+ return mPriv->interfaceName;
+}
+
}
diff --git a/TelepathyQt/dbus-service.h b/TelepathyQt/dbus-service.h
index b9dcd5d4..413fbc36 100644
--- a/TelepathyQt/dbus-service.h
+++ b/TelepathyQt/dbus-service.h
@@ -64,6 +64,25 @@ private:
Private *mPriv;
};
+class AbstractDBusServiceInterface : public Object
+{
+ Q_DISABLE_COPY(AbstractDBusServiceInterface)
+
+public:
+ AbstractDBusServiceInterface(const QLatin1String &interfaceName);
+ virtual ~AbstractDBusServiceInterface();
+
+ QLatin1String interfaceName() const;
+
+protected:
+ virtual void createAdaptor(const QDBusConnection &dbusConnection, QObject *dbusObject) = 0;
+
+private:
+ class Private;
+ friend class Private;
+ Private *mPriv;
+};
+
}
#endif