summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2012-04-02 09:35:23 -0300
committerAndre Moreira Magalhaes (andrunko) <andre.magalhaes@collabora.co.uk>2012-04-02 10:33:11 -0300
commit60c94fe0d40612b14f2f796319449e94624cbbc4 (patch)
treeb5b4efab673d014050e3e8ba12c391a9904b0a24
parenta4c73115e63bb4df160e17d4b48db8f05cd728e9 (diff)
AbstractProtocolInterface: Add base class (abstract) for BaseProtocol optional interfaces.
-rw-r--r--TelepathyQt/AbstractProtocolInterface13
-rw-r--r--TelepathyQt/CMakeLists.txt1
-rw-r--r--TelepathyQt/base-protocol.cpp9
-rw-r--r--TelepathyQt/base-protocol.h18
-rw-r--r--TelepathyQt/types.h2
5 files changed, 43 insertions, 0 deletions
diff --git a/TelepathyQt/AbstractProtocolInterface b/TelepathyQt/AbstractProtocolInterface
new file mode 100644
index 00000000..45f16489
--- /dev/null
+++ b/TelepathyQt/AbstractProtocolInterface
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt_AbstractProtocolInterface_HEADER_GUARD_
+#define _TelepathyQt_AbstractProtocolInterface_HEADER_GUARD_
+
+#ifndef IN_TP_QT_HEADER
+#define IN_TP_QT_HEADER
+#endif
+
+#include <TelepathyQt/base-protocol.h>
+
+#undef IN_TP_QT_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt/CMakeLists.txt b/TelepathyQt/CMakeLists.txt
index 685c59d4..36ef8ee1 100644
--- a/TelepathyQt/CMakeLists.txt
+++ b/TelepathyQt/CMakeLists.txt
@@ -834,6 +834,7 @@ if(ENABLE_EXPERIMENTAL_SERVICE_SUPPORT)
AbstractAdaptor
abstract-adaptor.h
AbstractDBusServiceInterface
+ AbstractProtocolInterface
BaseConnectionManager
base-connection-manager.h
BaseConnection
diff --git a/TelepathyQt/base-protocol.cpp b/TelepathyQt/base-protocol.cpp
index 8782bc57..8d95c438 100644
--- a/TelepathyQt/base-protocol.cpp
+++ b/TelepathyQt/base-protocol.cpp
@@ -297,4 +297,13 @@ bool BaseProtocol::registerObject(const QString &busName, const QString &objectP
return DBusService::registerObject(busName, objectPath, error);
}
+AbstractProtocolInterface::AbstractProtocolInterface(const QLatin1String &interfaceName)
+ : AbstractDBusServiceInterface(interfaceName)
+{
+}
+
+AbstractProtocolInterface::~AbstractProtocolInterface()
+{
+}
+
}
diff --git a/TelepathyQt/base-protocol.h b/TelepathyQt/base-protocol.h
index 8b73c1ec..09959c9e 100644
--- a/TelepathyQt/base-protocol.h
+++ b/TelepathyQt/base-protocol.h
@@ -124,6 +124,24 @@ private:
Private *mPriv;
};
+class TP_QT_EXPORT AbstractProtocolInterface : public AbstractDBusServiceInterface
+{
+ Q_DISABLE_COPY(AbstractProtocolInterface)
+
+public:
+ AbstractProtocolInterface(const QLatin1String &interfaceName);
+ virtual ~AbstractProtocolInterface();
+
+protected:
+ friend class BaseProtocol;
+
+ void createAdaptor(const QDBusConnection &dbusConnection, QObject *dbusObject) = 0;
+
+ class Private;
+ friend class Private;
+ Private *mPriv;
+};
+
/*
class TP_QT_EXPORT BaseProtocolAddressingInterface : public QObject
{
diff --git a/TelepathyQt/types.h b/TelepathyQt/types.h
index 5ddea263..b9bbc7f9 100644
--- a/TelepathyQt/types.h
+++ b/TelepathyQt/types.h
@@ -48,6 +48,7 @@ class AbstractClient;
class AbstractClientApprover;
class AbstractClientHandler;
class AbstractClientObserver;
+class AbstractProtocolInterface;
class Account;
typedef GenericCapabilityFilter<Account> AccountCapabilityFilter;
class AccountFactory;
@@ -106,6 +107,7 @@ typedef SharedPtr<AbstractClient> AbstractClientPtr;
typedef SharedPtr<AbstractClientApprover> AbstractClientApproverPtr;
typedef SharedPtr<AbstractClientHandler> AbstractClientHandlerPtr;
typedef SharedPtr<AbstractClientObserver> AbstractClientObserverPtr;
+typedef SharedPtr<AbstractProtocolInterface> AbstractProtocolInterfacePtr;
typedef SharedPtr<Account> AccountPtr;
typedef SharedPtr<AccountCapabilityFilter> AccountCapabilityFilterPtr;
typedef SharedPtr<const AccountCapabilityFilter> AccountCapabilityFilterConstPtr;