[Telepathy-commits] [telepathy-qt4/master] Added PendingReadyChannel.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Fri Feb 13 11:19:09 PST 2009


---
 TelepathyQt4/Client/PendingReadyChannel       |   13 +++
 TelepathyQt4/Client/pending-ready-channel.cpp |  110 +++++++++++++++++++++++++
 TelepathyQt4/Client/pending-ready-channel.h   |   62 ++++++++++++++
 TelepathyQt4/Makefile.am                      |    4 +
 4 files changed, 189 insertions(+), 0 deletions(-)
 create mode 100644 TelepathyQt4/Client/PendingReadyChannel
 create mode 100644 TelepathyQt4/Client/pending-ready-channel.cpp
 create mode 100644 TelepathyQt4/Client/pending-ready-channel.h

diff --git a/TelepathyQt4/Client/PendingReadyChannel b/TelepathyQt4/Client/PendingReadyChannel
new file mode 100644
index 0000000..3a5529e
--- /dev/null
+++ b/TelepathyQt4/Client/PendingReadyChannel
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt4_Client_PendingReadyChannel_HEADER_GUARD_
+#define _TelepathyQt4_Client_PendingReadyChannel_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_HEADER
+#define IN_TELEPATHY_QT4_HEADER
+#endif
+
+#include <TelepathyQt4/Client/pending-ready-channel.h>
+
+#undef IN_TELEPATHY_QT4_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt4/Client/pending-ready-channel.cpp b/TelepathyQt4/Client/pending-ready-channel.cpp
new file mode 100644
index 0000000..c4ec9d8
--- /dev/null
+++ b/TelepathyQt4/Client/pending-ready-channel.cpp
@@ -0,0 +1,110 @@
+/*
+ * This file is part of TelepathyQt4
+ *
+ * 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/PendingReadyChannel>
+
+#include "TelepathyQt4/Client/_gen/pending-ready-channel.moc.hpp"
+
+#include "TelepathyQt4/debug-internal.h"
+
+#include <QDBusPendingCallWatcher>
+#include <QDBusPendingReply>
+
+/**
+ * \addtogroup clientsideproxies Client-side proxies
+ *
+ * Proxy objects representing remote service objects accessed via D-Bus.
+ *
+ * In addition to providing direct access to methods, signals and properties
+ * exported by the remote objects, some of these proxies offer features like
+ * automatic inspection of remote object capabilities, property tracking,
+ * backwards compatibility helpers for older services and other utilities.
+ */
+
+namespace Telepathy
+{
+namespace Client
+{
+
+struct PendingReadyChannel::Private
+{
+    Private(Channel::Features requestedFeatures, Channel *channel) :
+        requestedFeatures(requestedFeatures),
+        channel(channel)
+    {
+    }
+
+    Channel::Features requestedFeatures;
+    Channel *channel;
+};
+
+/**
+ * \class PendingReadyChannel
+ * \ingroup clientchannel
+ * \headerfile <TelepathyQt4/Client/pending-ready-channel.h> <TelepathyQt4/Client/PendingReadyChannel>
+ *
+ * Class containing the features requested and the reply to a request
+ * for a channel to become ready. Instances of this class cannot be
+ * constructed directly; the only way to get one is via Channel::becomeReady().
+ */
+
+/**
+ * Construct a PendingReadyChannel object.
+ *
+ * \param channel The Channel that will become ready.
+ */
+PendingReadyChannel::PendingReadyChannel(Channel::Features requestedFeatures, Channel *channel)
+    : PendingOperation(channel),
+      mPriv(new Private(requestedFeatures, channel))
+{
+}
+
+/**
+ * Class destructor.
+ */
+PendingReadyChannel::~PendingReadyChannel()
+{
+    delete mPriv;
+}
+
+/**
+ * Return the Channel object through which the request was made.
+ *
+ * \return Channel object.
+ */
+Channel *PendingReadyChannel::channel() const
+{
+    return mPriv->channel;
+}
+
+/**
+ * Return the Features that were requested to become ready on the
+ * channel.
+ *
+ * \return Features.
+ */
+Channel::Features PendingReadyChannel::requestedFeatures() const
+{
+    return mPriv->requestedFeatures;
+}
+
+} // Telepathy::Client
+} // Telepathy
diff --git a/TelepathyQt4/Client/pending-ready-channel.h b/TelepathyQt4/Client/pending-ready-channel.h
new file mode 100644
index 0000000..1a1e343
--- /dev/null
+++ b/TelepathyQt4/Client/pending-ready-channel.h
@@ -0,0 +1,62 @@
+/*
+ * This file is part of TelepathyQt4
+ *
+ * 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_pending_ready_channel_h_HEADER_GUARD_
+#define _TelepathyQt4_cli_pending_ready_channel_h_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_HEADER
+#error IN_TELEPATHY_QT4_HEADER
+#endif
+
+#include <TelepathyQt4/Client/Channel>
+#include <TelepathyQt4/Client/PendingOperation>
+
+class QDBusPendingCallWatcher;
+
+namespace Telepathy
+{
+namespace Client
+{
+
+class PendingReadyChannel : public PendingOperation
+{
+    Q_OBJECT
+
+public:
+    ~PendingReadyChannel();
+
+    Channel *channel() const;
+    Channel::Features requestedFeatures() const;
+
+private:
+    Q_DISABLE_COPY(PendingReadyChannel);
+    PendingReadyChannel(Channel::Features requestedFeatures, Channel *channel);
+
+    struct Private;
+    friend struct Private;
+    friend class Channel;
+    Private *mPriv;
+};
+
+} // Telepathy::Client
+} // Telepathy
+
+#endif
diff --git a/TelepathyQt4/Makefile.am b/TelepathyQt4/Makefile.am
index ada6bcc..2d509f1 100644
--- a/TelepathyQt4/Makefile.am
+++ b/TelepathyQt4/Makefile.am
@@ -60,6 +60,7 @@ libtelepathy_qt4_la_SOURCES = \
     Client/pending-operation.cpp \
     Client/pending-ready-account.cpp \
     Client/pending-ready-account-manager.cpp \
+    Client/pending-ready-channel.cpp \
     Client/pending-string-list.cpp \
     Client/properties.cpp \
     Client/referenced-handles.cpp \
@@ -114,6 +115,7 @@ nodist_libtelepathy_qt4_la_SOURCES = \
     Client/_gen/pending-operation.moc.hpp \
     Client/_gen/pending-ready-account.moc.hpp \
     Client/_gen/pending-ready-account-manager.moc.hpp \
+    Client/_gen/pending-ready-channel.moc.hpp \
     Client/_gen/pending-string-list.moc.hpp \
     Client/_gen/room-list.moc.hpp \
     Client/_gen/simple-pending-operations.moc.hpp \
@@ -156,6 +158,7 @@ tpqt4clientinclude_HEADERS = \
     Client/PendingOperation \
     Client/PendingReadyAccount \
     Client/PendingReadyAccountManager \
+    Client/PendingReadyChannel \
     Client/PendingSuccess \
     Client/PendingStringList \
     Client/PendingVoidMethodCall \
@@ -221,6 +224,7 @@ tpqt4clientinclude_HEADERS = \
     Client/pending-operation.h \
     Client/pending-ready-account.h \
     Client/pending-ready-account-manager.h \
+    Client/pending-ready-channel.h \
     Client/pending-string-list.h \
     Client/properties.h \
     Client/referenced-handles.h \
-- 
1.5.6.5




More information about the telepathy-commits mailing list