[Telepathy-commits] [telepathy-qt4/master] Roughly implement the DBusProxy base class and add it to the buildsystem.

George Goldberg george.goldberg at collabora.co.uk
Tue Nov 18 13:27:44 PST 2008


Still needs APIDocs and to be used in the classes that should use it (for now, just Channel is ready).

At the moment, it just proxies the dbus connection, path and service.
---
 TelepathyQt4/Makefile.am        |    2 +
 TelepathyQt4/cli-dbus-proxy.cpp |   75 ++++++++++++++++++++++++++++++++++
 TelepathyQt4/cli-dbus-proxy.h   |   85 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 162 insertions(+), 0 deletions(-)
 create mode 100644 TelepathyQt4/cli-dbus-proxy.cpp
 create mode 100644 TelepathyQt4/cli-dbus-proxy.h

diff --git a/TelepathyQt4/Makefile.am b/TelepathyQt4/Makefile.am
index 82e6c6d..9246f7e 100644
--- a/TelepathyQt4/Makefile.am
+++ b/TelepathyQt4/Makefile.am
@@ -33,6 +33,7 @@ libtelepathy_qt4_la_SOURCES = \
     cli-connection.cpp \
     cli-connection-manager.cpp \
     cli-dbus.cpp \
+    cli-dbus-proxy.cpp \
     cli-media-session-handler.cpp \
     cli-media-stream-handler.cpp \
     cli-optional-interface-factory.cpp \
@@ -69,6 +70,7 @@ tpqt4include_HEADERS = \
     cli-connection.h \
     cli-connection-manager.h \
     cli-dbus.h \
+    cli-dbus-proxy.h \
     cli-media-session-handler.h \
     cli-media-stream-handler.h \
     cli-optional-interface-factory.h \
diff --git a/TelepathyQt4/cli-dbus-proxy.cpp b/TelepathyQt4/cli-dbus-proxy.cpp
new file mode 100644
index 0000000..a725510
--- /dev/null
+++ b/TelepathyQt4/cli-dbus-proxy.cpp
@@ -0,0 +1,75 @@
+/*
+ * This file is part of TelepathyQt4
+ *
+ * Copyright (C) 2008 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2008 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 "cli-dbus-proxy.h"
+
+#include "debug-internal.hpp"
+
+namespace Telepathy
+{
+namespace Client
+{
+
+struct DBusProxy::Private
+{
+    // Public object
+    DBusProxy& parent;
+
+    QDBusAbstractInterface* baseInterface;
+
+    Private(QDBusAbstractInterface* interface, DBusProxy& p)
+        : parent(p), 
+          baseInterface(interface)
+    {
+        debug() << "Creating new DBusProxy";
+    }
+};
+
+DBusProxy::DBusProxy(QDBusAbstractInterface* baseInterface, QObject* parent)
+ : QObject(parent),
+   mPriv(new Private(baseInterface, *this))
+{
+
+}
+
+DBusProxy::~DBusProxy()
+{
+    delete mPriv;
+}
+
+QDBusConnection DBusProxy::connection() const
+{
+    return mPriv->baseInterface->connection();
+}
+
+QString DBusProxy::path() const
+{
+    return mPriv->baseInterface->path();
+}
+
+QString DBusProxy::service() const
+{
+    return mPriv->baseInterface->service();
+}
+
+}
+}
+
diff --git a/TelepathyQt4/cli-dbus-proxy.h b/TelepathyQt4/cli-dbus-proxy.h
new file mode 100644
index 0000000..2fadcb5
--- /dev/null
+++ b/TelepathyQt4/cli-dbus-proxy.h
@@ -0,0 +1,85 @@
+/*
+ * This file is part of TelepathyQt4
+ *
+ * Copyright (C) 2008 Collabora Ltd. <http://www.collabora.co.uk/>
+ * Copyright (C) 2008 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_dbus_proxy_h_HEADER_GUARD_
+#define _TelepathyQt4_cli_dbus_proxy_h_HEADER_GUARD_
+
+// FIXME: What groups should this be in/define?
+
+#include <QtDBus/QDBusAbstractInterface>
+#include <QtDBus/QDBusConnection>
+
+namespace Telepathy
+{
+namespace Client
+{
+
+/**
+ * \class DBusProxy
+ * \ingroup FIXME: what group is it in?
+ * \headerfile TelepathyQt4/cli-dbus-proxy.h <TelepathyQt4/Client/DBusProxy>
+ *
+ * Base class which all TelepathyQt4 client convenience classes that wrap
+ * Telepathy interfaces inherit from in order to provide basic DBus interface
+ * information.
+ *
+ */
+class DBusProxy : public QObject
+{
+    Q_OBJECT
+
+public:
+    /**
+     *
+     */
+    DBusProxy(QDBusAbstractInterface* baseInterface, QObject* parent = 0);
+
+    /**
+     *
+     */
+    ~DBusProxy();
+
+    /**
+     *
+     */
+    QDBusConnection connection() const;
+
+    /**
+     *
+     */
+    QString path() const;
+
+    /**
+     *
+     */
+    QString service() const;
+
+private:
+    struct Private;
+    friend struct Private;
+    Private *mPriv;
+};
+
+}
+}
+
+#endif
+
-- 
1.5.6.5




More information about the Telepathy-commits mailing list