[telepathy-qt4/master] ClientRegistrar: Added skeleton class.

Andre Moreira Magalhaes (andrunko) andre.magalhaes at collabora.co.uk
Tue May 19 06:49:17 PDT 2009


---
 TelepathyQt4/ClientRegistrar      |   13 ++++++
 TelepathyQt4/Makefile.am          |    3 +
 TelepathyQt4/client-registrar.cpp |   82 +++++++++++++++++++++++++++++++++++++
 TelepathyQt4/client-registrar.h   |   67 ++++++++++++++++++++++++++++++
 TelepathyQt4/types.h              |    4 ++
 5 files changed, 169 insertions(+), 0 deletions(-)
 create mode 100644 TelepathyQt4/ClientRegistrar
 create mode 100644 TelepathyQt4/client-registrar.cpp
 create mode 100644 TelepathyQt4/client-registrar.h

diff --git a/TelepathyQt4/ClientRegistrar b/TelepathyQt4/ClientRegistrar
new file mode 100644
index 0000000..cfd9a2c
--- /dev/null
+++ b/TelepathyQt4/ClientRegistrar
@@ -0,0 +1,13 @@
+#ifndef _TelepathyQt4_Client_ClientRegistrar_HEADER_GUARD_
+#define _TelepathyQt4_Client_ClientRegistrar_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_HEADER
+#define IN_TELEPATHY_QT4_HEADER
+#endif
+
+#include <TelepathyQt4/client-registrar.h>
+
+#undef IN_TELEPATHY_QT4_HEADER
+
+#endif
+// vim:set ft=cpp:
diff --git a/TelepathyQt4/Makefile.am b/TelepathyQt4/Makefile.am
index 1972660..711997b 100644
--- a/TelepathyQt4/Makefile.am
+++ b/TelepathyQt4/Makefile.am
@@ -48,6 +48,7 @@ libtelepathy_qt4_la_SOURCES = \
     account.cpp \
     account-manager.cpp \
     channel.cpp \
+    client-registrar.cpp \
     connection.cpp \
     connection-manager.cpp \
     connection-internal.h \
@@ -136,6 +137,7 @@ tpqt4include_HEADERS = \
     Account \
     AccountManager \
     Channel \
+    ClientRegistrar \
     Connection \
     ConnectionManager \
     Constants \
@@ -214,6 +216,7 @@ tpqt4include_HEADERS = \
     account.h \
     account-manager.h \
     channel.h \
+    client-registrar.h \
     connection.h \
     connection-manager.h \
     constants.h \
diff --git a/TelepathyQt4/client-registrar.cpp b/TelepathyQt4/client-registrar.cpp
new file mode 100644
index 0000000..d49fae2
--- /dev/null
+++ b/TelepathyQt4/client-registrar.cpp
@@ -0,0 +1,82 @@
+/*
+ * 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/ClientRegistrar>
+#include "TelepathyQt4/client-registrar-internal.h"
+
+#include "TelepathyQt4/_gen/client-registrar.moc.hpp"
+
+#include "TelepathyQt4/debug-internal.h"
+
+namespace Tp
+{
+
+struct ClientRegistrar::Private
+{
+};
+
+ClientRegistrarPtr ClientRegistrar::create(const QString &clientName,
+        bool unique)
+{
+    return ClientRegistrarPtr(new ClientRegistrar(clientName, unique));
+}
+
+ClientRegistrar::ClientRegistrar(const QString &clientName,
+        bool unique)
+    : mPriv(new Private)
+{
+}
+
+ClientRegistrar::~ClientRegistrar()
+{
+    delete mPriv;
+}
+
+bool ClientRegistrar::addClient(const AbstractClientPtr &client)
+{
+    return false;
+}
+
+bool ClientRegistrar::removeClient(const AbstractClientPtr &client)
+{
+    return false;
+}
+
+bool ClientRegistrar::registerClients()
+{
+    return false;
+}
+
+bool ClientRegistrar::registerClient(const AbstractClientPtr &client)
+{
+    return false;
+}
+
+void ClientRegistrar::unregisterClients()
+{
+}
+
+bool ClientRegistrar::unregisterClient(const AbstractClientPtr &client)
+{
+    return false;
+}
+
+} // Tp
diff --git a/TelepathyQt4/client-registrar.h b/TelepathyQt4/client-registrar.h
new file mode 100644
index 0000000..03c00ba
--- /dev/null
+++ b/TelepathyQt4/client-registrar.h
@@ -0,0 +1,67 @@
+/*
+ * 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_client_registrar_h_HEADER_GUARD_
+#define _TelepathyQt4_cli_client_registrar_h_HEADER_GUARD_
+
+#ifndef IN_TELEPATHY_QT4_HEADER
+#error IN_TELEPATHY_QT4_HEADER
+#endif
+
+#include <TelepathyQt4/RefCounted>
+#include <TelepathyQt4/Types>
+
+#include <QObject>
+#include <QString>
+
+namespace Tp
+{
+
+class ClientRegistrar : public QObject, public RefCounted
+{
+    Q_OBJECT
+    Q_DISABLE_COPY(ClientRegistrar)
+
+public:
+    static ClientRegistrarPtr create(const QString &clientName,
+            bool unique = false);
+    virtual ~ClientRegistrar();
+
+    bool addClient(const AbstractClientPtr &client);
+    bool removeClient(const AbstractClientPtr &client);
+
+    bool registerClients();
+    bool registerClient(const AbstractClientPtr &client);
+
+    void unregisterClients();
+    bool unregisterClient(const AbstractClientPtr &client);
+
+private:
+    ClientRegistrar(const QString &clientName, bool unique = false);
+
+    struct Private;
+    friend struct Private;
+    Private *mPriv;
+};
+
+} // Tp
+
+#endif
diff --git a/TelepathyQt4/types.h b/TelepathyQt4/types.h
index 826a470..d78b1bd 100644
--- a/TelepathyQt4/types.h
+++ b/TelepathyQt4/types.h
@@ -33,9 +33,11 @@
 namespace Tp
 {
 
+class AbstractClient;
 class Account;
 class AccountManager;
 class Channel;
+class ClientRegistrar;
 class Connection;
 class ConnectionManager;
 class FileTransfer;
@@ -44,9 +46,11 @@ class MediaStream;
 class StreamedMediaChannel;
 class TextChannel;
 
+typedef SharedPtr<AbstractClient> AbstractClientPtr;
 typedef SharedPtr<Account> AccountPtr;
 typedef SharedPtr<AccountManager> AccountManagerPtr;
 typedef SharedPtr<Channel> ChannelPtr;
+typedef SharedPtr<ClientRegistrar> ClientRegistrarPtr;
 typedef SharedPtr<Connection> ConnectionPtr;
 typedef SharedPtr<ConnectionManager> ConnectionManagerPtr;
 typedef SharedPtr<FileTransfer> FileTransferPtr;
-- 
1.5.6.5




More information about the telepathy-commits mailing list