telepathy-qt: debug-receiver: Add basic skeleton for the new Tp:: DebugReceiver class.

Dario Freddi drf at kemper.freedesktop.org
Mon Jul 2 07:53:54 PDT 2012


Module: telepathy-qt
Branch: master
Commit: 913c5bb23f694e9d523a2dfb892c1bfd437618a5
URL:    http://cgit.freedesktop.org/telepathy/telepathy-qt/commit/?id=913c5bb23f694e9d523a2dfb892c1bfd437618a5

Author: George Kiagiadakis <george.kiagiadakis at collabora.com>
Date:   Sat Dec 10 23:32:17 2011 +0200

debug-receiver: Add basic skeleton for the new Tp::DebugReceiver class.

---

 TelepathyQt/CMakeLists.txt     |    4 ++
 TelepathyQt/DebugReceiver      |   13 +++++++
 TelepathyQt/debug-receiver.cpp |   68 ++++++++++++++++++++++++++++++++++++++++
 TelepathyQt/debug-receiver.h   |   63 +++++++++++++++++++++++++++++++++++++
 TelepathyQt/types.h            |    2 +
 5 files changed, 150 insertions(+), 0 deletions(-)

diff --git a/TelepathyQt/CMakeLists.txt b/TelepathyQt/CMakeLists.txt
index 77e26a4..b2b63cf 100644
--- a/TelepathyQt/CMakeLists.txt
+++ b/TelepathyQt/CMakeLists.txt
@@ -56,6 +56,7 @@ set(telepathy_qt_SRCS
     dbus-proxy-factory.cpp
     dbus-proxy-factory-internal.h
     debug.cpp
+    debug-receiver.cpp
     debug-internal.h
     fake-handler-manager-internal.cpp
     fake-handler-manager-internal.h
@@ -315,6 +316,8 @@ set(telepathy_qt_HEADERS
     dbus-proxy-factory.h
     Debug
     debug.h
+    DebugReceiver
+    debug-receiver.h
     Feature
     Features
     feature.h
@@ -538,6 +541,7 @@ set(telepathy_qt_MOC_SRCS
     dbus-proxy.h
     dbus-proxy-factory.h
     dbus-proxy-factory-internal.h
+    debug-receiver.h
     fake-handler-manager-internal.h
     file-transfer-channel.h
     fixed-feature-factory.h
diff --git a/TelepathyQt/DebugReceiver b/TelepathyQt/DebugReceiver
new file mode 100644
index 0000000..bdf1c5d
--- /dev/null
+++ b/TelepathyQt/DebugReceiver
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt_DebugReceiver_HEADER_GUARD_
+#define _TelepathyQt_DebugReceiver_HEADER_GUARD_
+
+#ifndef IN_TP_QT_HEADER
+#define IN_TP_QT_HEADER
+#endif
+
+#include <TelepathyQt/debug-receiver.h>
+
+#undef IN_TP_QT_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt/debug-receiver.cpp b/TelepathyQt/debug-receiver.cpp
new file mode 100644
index 0000000..62237ab
--- /dev/null
+++ b/TelepathyQt/debug-receiver.cpp
@@ -0,0 +1,68 @@
+/**
+ * This file is part of TelepathyQt
+ *
+ * @copyright Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
+ * @license LGPL 2.1
+ *
+ * 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 <TelepathyQt/DebugReceiver>
+
+#include "TelepathyQt/_gen/debug-receiver.moc.hpp"
+#include "TelepathyQt/_gen/cli-debug-receiver-body.hpp"
+#include "TelepathyQt/_gen/cli-debug-receiver.moc.hpp"
+
+namespace Tp
+{
+
+struct TP_QT_NO_EXPORT DebugReceiver::Private
+{
+};
+
+/**
+ * Feature representing the core that needs to become ready to make the DebugReceiver
+ * object usable.
+ *
+ * Note that this feature must be enabled in order to use most DebugReceiver methods.
+ * See specific methods documentation for more details.
+ *
+ * When calling isReady(), becomeReady(), this feature is implicitly added
+ * to the requested features.
+ */
+const Feature DebugReceiver::FeatureCore = Feature(QLatin1String(DebugReceiver::staticMetaObject.className()), 0, true);
+
+DebugReceiverPtr DebugReceiver::create(const QString &busName, const QDBusConnection &bus)
+{
+    return DebugReceiverPtr(new DebugReceiver(bus, busName,
+                QLatin1String("/org/freedesktop/Telepathy/debug"),
+                DebugReceiver::FeatureCore));
+}
+
+DebugReceiver::DebugReceiver(const QDBusConnection &bus,
+        const QString &busName,
+        const QString &objectPath,
+        const Feature &featureCore)
+    : StatefulDBusProxy(bus, busName, objectPath, featureCore),
+      mPriv(new Private)
+{
+}
+
+DebugReceiver::~DebugReceiver()
+{
+    delete mPriv;
+}
+
+
+}
diff --git a/TelepathyQt/debug-receiver.h b/TelepathyQt/debug-receiver.h
new file mode 100644
index 0000000..eef771a
--- /dev/null
+++ b/TelepathyQt/debug-receiver.h
@@ -0,0 +1,63 @@
+/**
+ * This file is part of TelepathyQt
+ *
+ * @copyright Copyright (C) 2011 Collabora Ltd. <http://www.collabora.co.uk/>
+ * @license LGPL 2.1
+ *
+ * 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 _TelepathyQt_debug_receiver_h_HEADER_GUARD_
+#define _TelepathyQt_debug_receiver_h_HEADER_GUARD_
+
+#ifndef IN_TP_QT_HEADER
+#error IN_TP_QT_HEADER
+#endif
+
+#include <TelepathyQt/_gen/cli-debug-receiver.h>
+
+#include <TelepathyQt/Global>
+#include <TelepathyQt/Types>
+#include <TelepathyQt/DBusProxy>
+
+namespace Tp
+{
+
+class TP_QT_EXPORT DebugReceiver : public StatefulDBusProxy
+{
+    Q_OBJECT
+    Q_DISABLE_COPY(DebugReceiver)
+public:
+    static const Feature FeatureCore;
+
+    static DebugReceiverPtr create(const QString &busName,
+            const QDBusConnection &bus = QDBusConnection::sessionBus());
+    virtual ~DebugReceiver();
+
+protected:
+    DebugReceiver(const QDBusConnection &bus,
+                  const QString &busName,
+                  const QString &objectPath,
+                  const Feature &featureCore);
+
+private:
+    struct Private;
+    friend struct Private;
+
+    Private *mPriv;
+};
+
+}
+
+#endif
diff --git a/TelepathyQt/types.h b/TelepathyQt/types.h
index 1edb09b..4d9b345 100644
--- a/TelepathyQt/types.h
+++ b/TelepathyQt/types.h
@@ -76,6 +76,7 @@ class ContactManager;
 class ContactMessenger;
 class ContactSearchChannel;
 class DBusProxy;
+class DebugReceiver;
 class FileTransferChannel;
 class IncomingFileTransferChannel;
 class IncomingStreamTubeChannel;
@@ -140,6 +141,7 @@ typedef SharedPtr<ContactManager> ContactManagerPtr;
 typedef SharedPtr<ContactMessenger> ContactMessengerPtr;
 typedef SharedPtr<ContactSearchChannel> ContactSearchChannelPtr;
 typedef SharedPtr<DBusProxy> DBusProxyPtr;
+typedef SharedPtr<DebugReceiver> DebugReceiverPtr;
 typedef SharedPtr<FileTransferChannel> FileTransferChannelPtr;
 typedef SharedPtr<IncomingFileTransferChannel> IncomingFileTransferChannelPtr;
 typedef SharedPtr<IncomingStreamTubeChannel> IncomingStreamTubeChannelPtr;



More information about the telepathy-commits mailing list