MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9
   Home · All Classes · All Namespaces · Modules · Functions · Files

client-registrar.h

00001 
00023 #ifndef _TelepathyQt4_client_registrar_h_HEADER_GUARD_
00024 #define _TelepathyQt4_client_registrar_h_HEADER_GUARD_
00025 
00026 #ifndef IN_TELEPATHY_QT4_HEADER
00027 #error IN_TELEPATHY_QT4_HEADER
00028 #endif
00029 
00030 #include <TelepathyQt4/AccountFactory>
00031 #include <TelepathyQt4/ChannelFactory>
00032 #include <TelepathyQt4/ConnectionFactory>
00033 #include <TelepathyQt4/ContactFactory>
00034 #include <TelepathyQt4/Object>
00035 #include <TelepathyQt4/Types>
00036 
00037 #include <QDBusConnection>
00038 #include <QString>
00039 
00040 namespace Tp
00041 {
00042 
00043 class TELEPATHY_QT4_EXPORT ClientRegistrar : public Object
00044 {
00045     Q_OBJECT
00046     Q_DISABLE_COPY(ClientRegistrar)
00047 
00048 public:
00049     static ClientRegistrarPtr create(const QDBusConnection &bus);
00050     static ClientRegistrarPtr create(
00051             const AccountFactoryConstPtr &accountFactory =
00052                 AccountFactory::create(QDBusConnection::sessionBus()),
00053             const ConnectionFactoryConstPtr &connectionFactory =
00054                 ConnectionFactory::create(QDBusConnection::sessionBus()),
00055             const ChannelFactoryConstPtr &channelFactory =
00056                 ChannelFactory::create(QDBusConnection::sessionBus()),
00057             const ContactFactoryConstPtr &contactFactory =
00058                 ContactFactory::create());
00059     static ClientRegistrarPtr create(const QDBusConnection &bus,
00060             const AccountFactoryConstPtr &accountFactory,
00061             const ConnectionFactoryConstPtr &connectionFactory,
00062             const ChannelFactoryConstPtr &channelFactory,
00063             const ContactFactoryConstPtr &contactFactory);
00064     static ClientRegistrarPtr create(const AccountManagerPtr &accountManager);
00065 
00066     ~ClientRegistrar();
00067 
00068     QDBusConnection dbusConnection() const;
00069 
00070     AccountFactoryConstPtr accountFactory() const;
00071     ConnectionFactoryConstPtr connectionFactory() const;
00072     ChannelFactoryConstPtr channelFactory() const;
00073     ContactFactoryConstPtr contactFactory() const;
00074 
00075     QList<AbstractClientPtr> registeredClients() const;
00076     bool registerClient(const AbstractClientPtr &client,
00077             const QString &clientName, bool unique = false);
00078     bool unregisterClient(const AbstractClientPtr &client);
00079     void unregisterClients();
00080 
00081 private:
00082     ClientRegistrar(const QDBusConnection &bus,
00083             const AccountFactoryConstPtr &accountFactory,
00084             const ConnectionFactoryConstPtr &connectionFactory,
00085             const ChannelFactoryConstPtr &channelFactory,
00086             const ContactFactoryConstPtr &contactFactory);
00087 
00088     struct Private;
00089     friend struct Private;
00090     Private *mPriv;
00091 
00092     static QHash<QPair<QString, QString>, ClientRegistrar *> registrarForConnection;
00093 };
00094 
00095 } // Tp
00096 
00097 #endif

Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt4 0.6.5