[Telepathy-commits] [telepathy-qt4/master] AbstractInterface: Add a base class for 1-1 interfaces that use a DBusProxy

Simon McVittie simon.mcvittie at collabora.co.uk
Thu Jan 22 03:33:31 PST 2009


This subclass of QDBusAbstractInterface will let us add support for being
invalidated.
---
 TelepathyQt4/Client/AbstractInterface      |   13 +++++++
 TelepathyQt4/Client/abstract-interface.cpp |   44 ++++++++++++++++++++++
 TelepathyQt4/Client/abstract-interface.h   |   55 ++++++++++++++++++++++++++++
 TelepathyQt4/Makefile.am                   |    4 ++
 4 files changed, 116 insertions(+), 0 deletions(-)
 create mode 100644 TelepathyQt4/Client/AbstractInterface
 create mode 100644 TelepathyQt4/Client/abstract-interface.cpp
 create mode 100644 TelepathyQt4/Client/abstract-interface.h

diff --git a/TelepathyQt4/Client/AbstractInterface b/TelepathyQt4/Client/AbstractInterface
new file mode 100644
index 0000000..b1213f5
--- /dev/null
+++ b/TelepathyQt4/Client/AbstractInterface
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt4_Client_AbstractInterface_HEADER_GUARD_
+#define _TelepathyQt4_Client_AbstractInterface_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_HEADER
+#define IN_TELEPATHY_QT4_HEADER
+#endif
+
+#include <TelepathyQt4/Client/abstract-interface.h>
+
+#undef IN_TELEPATHY_QT4_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt4/Client/abstract-interface.cpp b/TelepathyQt4/Client/abstract-interface.cpp
new file mode 100644
index 0000000..e541bca
--- /dev/null
+++ b/TelepathyQt4/Client/abstract-interface.cpp
@@ -0,0 +1,44 @@
+/* Abstract base class for Telepathy D-Bus interfaces.
+ *
+ * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2009 Nokia Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <TelepathyQt4/Client/AbstractInterface>
+
+#include "TelepathyQt4/Client/_gen/abstract-interface.moc.hpp"
+#include "TelepathyQt4/debug-internal.h"
+
+namespace Telepathy
+{
+namespace Client
+{
+
+AbstractInterface::AbstractInterface(const QString &busName,
+        const QString &path, const char *interface,
+        const QDBusConnection &dbusConnection, QObject *parent)
+    : QDBusAbstractInterface(busName, path, interface, dbusConnection, parent),
+      mPriv(0)
+{
+}
+
+AbstractInterface::~AbstractInterface()
+{
+}
+
+} // Client
+} // Telepathy
diff --git a/TelepathyQt4/Client/abstract-interface.h b/TelepathyQt4/Client/abstract-interface.h
new file mode 100644
index 0000000..de45eec
--- /dev/null
+++ b/TelepathyQt4/Client/abstract-interface.h
@@ -0,0 +1,55 @@
+/* Abstract base class for Telepathy interfaces
+ *
+ * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2009 Nokia Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef _TelepathyQt4_cli_abstract_interface_h_HEADER_GUARD_
+#define _TelepathyQt4_cli_abstract_interface_h_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_HEADER
+#error IN_TELEPATHY_QT4_HEADER
+#endif
+
+#include <QDBusAbstractInterface>
+
+namespace Telepathy
+{
+namespace Client
+{
+
+class AbstractInterface : public QDBusAbstractInterface
+{
+    Q_OBJECT
+
+public:
+    virtual ~AbstractInterface();
+
+protected:
+    AbstractInterface(const QString &busName, const QString &path,
+            const char *interface, const QDBusConnection &connection,
+            QObject *parent);
+
+private:
+    struct Private;
+    Private *mPriv;
+};
+
+} // Client
+} // Telepathy
+
+#endif
diff --git a/TelepathyQt4/Makefile.am b/TelepathyQt4/Makefile.am
index 8e2c18b..3488b3d 100644
--- a/TelepathyQt4/Makefile.am
+++ b/TelepathyQt4/Makefile.am
@@ -35,6 +35,7 @@ libtelepathy_qt4_la_LIBADD = $(ALL_LIBS)
 libtelepathy_qt4_la_DEPENDENCIES = Makefile.am
 
 libtelepathy_qt4_la_SOURCES = \
+    Client/abstract-interface.cpp \
     Client/account.cpp \
     Client/account-manager.cpp \
     Client/channel.cpp \
@@ -81,6 +82,7 @@ nodist_libtelepathy_qt4_la_SOURCES = \
     _gen/cli-properties-body.hpp \
     _gen/cli-properties.moc.hpp \
     _gen/types-body.hpp \
+    Client/_gen/abstract-interface.moc.hpp \
     Client/_gen/account.moc.hpp \
     Client/_gen/account-manager.moc.hpp \
     Client/_gen/channel.moc.hpp \
@@ -109,6 +111,7 @@ tpqt4include_HEADERS = \
     types.h
 
 tpqt4clientinclude_HEADERS = \
+    Client/AbstractInterface \
     Client/Account \
     Client/AccountManager \
     Client/Channel \
@@ -163,6 +166,7 @@ tpqt4clientinclude_HEADERS = \
     Client/PeerInterface \
     Client/PropertiesInterface \
     Client/PropertiesInterfaceInterface \
+    Client/abstract-interface.h \
     Client/account.h \
     Client/account-manager.h \
     Client/channel.h \
-- 
1.5.6.5




More information about the Telepathy-commits mailing list