Home · All Classes · All Namespaces · Modules · Functions · Files
connection-manager.h
1 
23 #ifndef _TelepathyQt_connection_manager_h_HEADER_GUARD_
24 #define _TelepathyQt_connection_manager_h_HEADER_GUARD_
25 
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29 
30 #include <TelepathyQt/_gen/cli-connection-manager.h>
31 
32 #include <TelepathyQt/ChannelFactory>
33 #include <TelepathyQt/ConnectionFactory>
34 #include <TelepathyQt/Constants>
35 #include <TelepathyQt/ContactFactory>
36 #include <TelepathyQt/DBus>
37 #include <TelepathyQt/DBusProxy>
38 #include <TelepathyQt/OptionalInterfaceFactory>
39 #include <TelepathyQt/ProtocolInfo>
40 #include <TelepathyQt/ProtocolParameter>
41 #include <TelepathyQt/ReadinessHelper>
42 #include <TelepathyQt/SharedPtr>
43 #include <TelepathyQt/Types>
44 
45 namespace Tp
46 {
47 
48 class ConnectionManagerLowlevel;
49 class PendingConnection;
50 class PendingStringList;
51 
52 class TP_QT_EXPORT ConnectionManager : public StatelessDBusProxy,
53  public OptionalInterfaceFactory<ConnectionManager>
54 {
55  Q_OBJECT
56  Q_DISABLE_COPY(ConnectionManager)
57  Q_PROPERTY(QString name READ name)
58  Q_PROPERTY(QStringList supportedProtocols READ supportedProtocols)
59  Q_PROPERTY(ProtocolInfoList protocols READ protocols)
60 
61 public:
62  static const Feature FeatureCore;
63 
64  static ConnectionManagerPtr create(const QDBusConnection &bus,
65  const QString &name);
66  static ConnectionManagerPtr create(const QString &name,
67  const ConnectionFactoryConstPtr &connectionFactory =
68  ConnectionFactory::create(QDBusConnection::sessionBus()),
69  const ChannelFactoryConstPtr &channelFactory =
70  ChannelFactory::create(QDBusConnection::sessionBus()),
71  const ContactFactoryConstPtr &contactFactory =
72  ContactFactory::create());
73  static ConnectionManagerPtr create(const QDBusConnection &bus,
74  const QString &name,
75  const ConnectionFactoryConstPtr &connectionFactory,
76  const ChannelFactoryConstPtr &channelFactory,
77  const ContactFactoryConstPtr &contactFactory =
78  ContactFactory::create());
79 
80  virtual ~ConnectionManager();
81 
82  QString name() const;
83 
84  ConnectionFactoryConstPtr connectionFactory() const;
85  ChannelFactoryConstPtr channelFactory() const;
86  ContactFactoryConstPtr contactFactory() const;
87 
88  QStringList supportedProtocols() const;
89  const ProtocolInfoList &protocols() const;
90  bool hasProtocol(const QString &protocolName) const;
91  ProtocolInfo protocol(const QString &protocolName) const;
92 
93  static PendingStringList *listNames(
94  const QDBusConnection &bus = QDBusConnection::sessionBus());
95 
96 #if defined(BUILDING_TP_QT) || defined(TP_QT_ENABLE_LOWLEVEL_API)
97  ConnectionManagerLowlevelPtr lowlevel();
98  ConnectionManagerLowlevelConstPtr lowlevel() const;
99 #endif
100 
101 protected:
102  ConnectionManager(const QDBusConnection &bus, const QString &name,
103  const ConnectionFactoryConstPtr &connectionFactory,
104  const ChannelFactoryConstPtr &channelFactory,
105  const ContactFactoryConstPtr &contactFactory);
106 
107  Client::ConnectionManagerInterface *baseInterface() const;
108 
109 private Q_SLOTS:
110  TP_QT_NO_EXPORT void gotMainProperties(Tp::PendingOperation *op);
111  TP_QT_NO_EXPORT void gotProtocolsLegacy(QDBusPendingCallWatcher *watcher);
112  TP_QT_NO_EXPORT void gotParametersLegacy(QDBusPendingCallWatcher *watcher);
113  TP_QT_NO_EXPORT void onProtocolReady(Tp::PendingOperation *watcher);
114 
115 private:
116  friend class PendingConnection;
117 
118  struct Private;
119  friend struct Private;
120  Private *mPriv;
121 };
122 
123 } // Tp
124 
125 #endif
The PendingOperation class is a base class for pending asynchronous operations.
Definition: pending-operation.h:45
The StatelessDBusProxy class is a base class representing a remote object whose API is basically stat...
Definition: dbus-proxy.h:80
Definition: cli-connection-manager.h:44
The ChannelFactory class is responsible for constructing Channel objects according to application-def...
Definition: channel-factory.h:46
The ConnectionFactory class is responsible for constructing Connection objects according to applicati...
Definition: connection-factory.h:49
The PendingConnection class represents the parameters of and the reply to an asynchronous connection ...
Definition: pending-connection.h:43
The ProtocolInfo class represents a Telepathy Protocol.
Definition: protocol-info.h:46
The OptionalInterfaceFactory class is a helper class for high-level D-Bus proxy classes willing to of...
Definition: optional-interface-factory.h:65
The ConnectionManager class represents a Telepathy connection manager.
Definition: connection-manager.h:52
Definition: abstract-adaptor.cpp:31
QList< ProtocolInfo > ProtocolInfoList
Definition: protocol-info.h:104
The PendingStringList class is a generic subclass of PendingOperation representing a pending D-Bus me...
Definition: pending-string-list.h:37
The Feature class represents a feature that can be enabled on demand.
Definition: feature.h:41
The ContactFactory class is responsible for constructing Contact objects according to application-def...
Definition: contact-factory.h:44


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt 0.9.7