[Telepathy-commits] [telepathy-qt4/master] Added PendingStringList class.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Tue Jan 6 06:23:58 PST 2009


---
 TelepathyQt4/Client/PendingStringList       |   13 +++++
 TelepathyQt4/Client/pending-string-list.cpp |   69 +++++++++++++++++++++++++++
 TelepathyQt4/Client/pending-string-list.h   |   63 ++++++++++++++++++++++++
 TelepathyQt4/Makefile.am                    |    4 ++
 4 files changed, 149 insertions(+), 0 deletions(-)
 create mode 100644 TelepathyQt4/Client/PendingStringList
 create mode 100644 TelepathyQt4/Client/pending-string-list.cpp
 create mode 100644 TelepathyQt4/Client/pending-string-list.h

diff --git a/TelepathyQt4/Client/PendingStringList b/TelepathyQt4/Client/PendingStringList
new file mode 100644
index 0000000..65d95c5
--- /dev/null
+++ b/TelepathyQt4/Client/PendingStringList
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt4_Client_PendingStringList_HEADER_GUARD_
+#define _TelepathyQt4_Client_PendingStringList_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_HEADER
+#define IN_TELEPATHY_QT4_HEADER
+#endif
+
+#include <TelepathyQt4/Client/pending-string-list.h>
+
+#undef IN_TELEPATHY_QT4_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt4/Client/pending-string-list.cpp b/TelepathyQt4/Client/pending-string-list.cpp
new file mode 100644
index 0000000..c0eeaa4
--- /dev/null
+++ b/TelepathyQt4/Client/pending-string-list.cpp
@@ -0,0 +1,69 @@
+/*
+ * 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 <TelepathyQt4/Client/PendingStringList>
+
+#include "pending-string-list.moc.hpp"
+#include "TelepathyQt4/debug-internal.h"
+
+#include <QDBusPendingReply>
+
+namespace Telepathy
+{
+namespace Client
+{
+
+struct PendingStringList::Private
+{
+    QStringList result;
+};
+
+/**
+ * \class PendingStringList
+ * \headerfile <TelepathyQt4/Client/pending-string-list.h> <TelepathyQt4/Client/PendingStringList>
+ */
+
+PendingStringList::PendingStringList(QObject *parent)
+    : PendingOperation(parent),
+      mPriv(new Private)
+{
+}
+
+/**
+ * Class destructor.
+ */
+PendingStringList::~PendingStringList()
+{
+    delete mPriv;
+}
+
+QStringList PendingStringList::result() const
+{
+    return mPriv->result;
+}
+
+void PendingStringList::setResult(const QStringList &result)
+{
+    mPriv->result = result;
+}
+
+} // Telepathy::Client
+} // Telepathy
diff --git a/TelepathyQt4/Client/pending-string-list.h b/TelepathyQt4/Client/pending-string-list.h
new file mode 100644
index 0000000..5c25c3c
--- /dev/null
+++ b/TelepathyQt4/Client/pending-string-list.h
@@ -0,0 +1,63 @@
+/*
+ * 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_pending_string_list_h_HEADER_GUARD_
+#define _TelepathyQt4_cli_pending_string_list_h_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_HEADER
+#error IN_TELEPATHY_QT4_HEADER
+#endif
+
+#include <TelepathyQt4/Client/PendingOperation>
+
+#include <QDBusPendingCall>
+#include <QStringList>
+
+namespace Telepathy
+{
+namespace Client
+{
+
+class PendingStringList : public PendingOperation
+{
+    Q_OBJECT
+
+public:
+    PendingStringList(QObject *parent = 0);
+    ~PendingStringList();
+
+    QStringList result() const;
+
+protected:
+    void setResult(const QStringList &result);
+
+private:
+    Q_DISABLE_COPY(PendingStringList);
+
+    struct Private;
+    friend struct Private;
+    Private *mPriv;
+};
+
+} // Telepathy::Client
+} // Telepathy
+
+#endif
diff --git a/TelepathyQt4/Makefile.am b/TelepathyQt4/Makefile.am
index 9bf100e..bbd20ca 100644
--- a/TelepathyQt4/Makefile.am
+++ b/TelepathyQt4/Makefile.am
@@ -47,6 +47,7 @@ libtelepathy_qt4_la_SOURCES = \
     Client/optional-interface-factory.cpp \
     Client/pending-channel.cpp \
     Client/pending-operation.cpp \
+    Client/pending-string-list.cpp \
     Client/properties.cpp \
     debug.cpp \
     key-file.cpp \
@@ -80,6 +81,7 @@ nodist_libtelepathy_qt4_la_SOURCES = \
     Client/dbus-proxy.moc.hpp \
     Client/pending-channel.moc.hpp \
     Client/pending-operation.moc.hpp \
+    Client/pending-string-list.moc.hpp \
     Client/simple-pending-operations.moc.hpp
 
 tpqt4include_HEADERS = \
@@ -109,6 +111,7 @@ tpqt4clientinclude_HEADERS = \
     Client/PendingFailure \
     Client/PendingOperation \
     Client/PendingSuccess \
+    Client/PendingStringList \
     Client/PendingVoidMethodCall \
     Client/Properties \
     Client/StatelessDBusProxy \
@@ -156,6 +159,7 @@ tpqt4clientinclude_HEADERS = \
     Client/optional-interface-factory.h \
     Client/pending-channel.h \
     Client/pending-operation.h \
+    Client/pending-string-list.h \
     Client/properties.h \
     Client/simple-pending-operations.h
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list