23 #ifndef _TelepathyQt_connection_h_HEADER_GUARD_ 24 #define _TelepathyQt_connection_h_HEADER_GUARD_ 26 #ifndef IN_TP_QT_HEADER 27 #error IN_TP_QT_HEADER 30 #include <TelepathyQt/_gen/cli-connection.h> 32 #include <TelepathyQt/ConnectionCapabilities> 33 #include <TelepathyQt/Contact> 34 #include <TelepathyQt/DBus> 35 #include <TelepathyQt/DBusProxy> 36 #include <TelepathyQt/OptionalInterfaceFactory> 37 #include <TelepathyQt/ReadinessHelper> 38 #include <TelepathyQt/Types> 39 #include <TelepathyQt/SharedPtr> 41 #include <TelepathyQt/Constants> 42 #include <TelepathyQt/Types> 46 #include <QStringList> 52 class ConnectionCapabilities;
53 class ConnectionLowlevel;
56 class PendingContactAttributes;
58 class PendingOperation;
76 static ConnectionPtr create(
const QString &busName,
77 const QString &objectPath,
78 const ChannelFactoryConstPtr &channelFactory,
79 const ContactFactoryConstPtr &contactFactory);
80 static ConnectionPtr create(
const QDBusConnection &bus,
81 const QString &busName,
const QString &objectPath,
82 const ChannelFactoryConstPtr &channelFactory,
83 const ContactFactoryConstPtr &contactFactory);
87 ChannelFactoryConstPtr channelFactory()
const;
88 ContactFactoryConstPtr contactFactory()
const;
90 QString cmName()
const;
91 QString protocolName()
const;
106 bool isValid()
const {
return mPriv.constData() != 0; }
110 return allDetails().contains(QLatin1String(
"debug-message"));
115 return qdbus_cast<QString>(allDetails().value(QLatin1String(
"debug-message")));
120 return allDetails().contains(QLatin1String(
"server-message"));
125 return qdbus_cast<QString>(allDetails().value(QLatin1String(
"server-message")));
130 return allDetails().contains(QLatin1String(
"user-requested"));
135 return qdbus_cast<
bool>(allDetails().value(QLatin1String(
"user-requested")));
140 return allDetails().contains(QLatin1String(
"expected-hostname"));
145 return qdbus_cast<QString>(allDetails().value(QLatin1String(
"expected-hostname")));
150 return allDetails().contains(QLatin1String(
"certificate-hostname"));
155 return qdbus_cast<QString>(allDetails().value(QLatin1String(
"certificate-hostname")));
158 QVariantMap allDetails()
const;
164 friend struct Private;
165 QSharedDataPointer<Private> mPriv;
170 uint selfHandle()
const;
171 ContactPtr selfContact()
const;
177 ContactManagerPtr contactManager()
const;
179 #if defined(BUILDING_TP_QT) || defined(TP_QT_ENABLE_LOWLEVEL_API) 180 ConnectionLowlevelPtr lowlevel();
181 ConnectionLowlevelConstPtr lowlevel()
const;
187 void selfHandleChanged(uint newHandle);
189 void selfContactChanged();
194 Connection(
const QDBusConnection &bus,
const QString &busName,
195 const QString &objectPath,
196 const ChannelFactoryConstPtr &channelFactory,
197 const ContactFactoryConstPtr &contactFactory,
203 TP_QT_NO_EXPORT
void onStatusReady(uint status);
204 TP_QT_NO_EXPORT
void onStatusChanged(uint status, uint reason);
205 TP_QT_NO_EXPORT
void onConnectionError(
const QString &error,
const QVariantMap &details);
206 TP_QT_NO_EXPORT
void gotMainProperties(QDBusPendingCallWatcher *watcher);
207 TP_QT_NO_EXPORT
void gotStatus(QDBusPendingCallWatcher *watcher);
208 TP_QT_NO_EXPORT
void gotInterfaces(QDBusPendingCallWatcher *watcher);
209 TP_QT_NO_EXPORT
void gotSelfHandle(QDBusPendingCallWatcher *watcher);
210 TP_QT_NO_EXPORT
void gotCapabilities(QDBusPendingCallWatcher *watcher);
211 TP_QT_NO_EXPORT
void gotContactAttributeInterfaces(QDBusPendingCallWatcher *watcher);
212 TP_QT_NO_EXPORT
void gotSimpleStatuses(QDBusPendingCallWatcher *watcher);
218 TP_QT_NO_EXPORT
void doReleaseSweep(uint handleType);
220 TP_QT_NO_EXPORT
void onSelfHandleChanged(uint);
222 TP_QT_NO_EXPORT
void gotBalance(QDBusPendingCallWatcher *watcher);
226 class PendingConnect;
229 friend class PendingConnect;
235 TP_QT_NO_EXPORT
void refHandle(
HandleType handleType, uint handle);
236 TP_QT_NO_EXPORT
void unrefHandle(
HandleType handleType, uint handle);
237 TP_QT_NO_EXPORT
void handleRequestLanded(
HandleType handleType);
240 friend struct Private;
ConnectionStatusReason
Definition: build/TelepathyQt/_gen/constants.h:1465
The PendingOperation class is a base class for pending asynchronous operations.
Definition: pending-operation.h:45
QString expectedHostname() const
Definition: connection.h:143
The Connection::ErrorDetails class represents the details of a connection error.
Definition: connection.h:96
bool hasDebugMessage() const
Definition: connection.h:108
The PendingContactAttributes class represents the parameters of and the reply to an asynchronous requ...
Definition: pending-contact-attributes.h:40
Definition: cli-connection.h:44
The ConnectionCapabilities class represents the capabilities of a Connection.
Definition: connection-capabilities.h:38
bool hasServerMessage() const
Definition: connection.h:118
static const Feature FeatureSelfContact
Definition: connection.h:69
The PendingHandles class represents the parameters of and the reply to an asynchronous handle request...
Definition: pending-handles.h:46
static const Feature FeatureSimplePresence
Definition: connection.h:70
bool hasCertificateHostname() const
Definition: connection.h:148
bool hasExpectedHostname() const
Definition: connection.h:138
static const Feature FeatureRosterGroups
Definition: connection.h:72
bool userRequested() const
Definition: connection.h:133
Definition: build/TelepathyQt/_gen/types.h:1361
static const Feature FeatureCore
Definition: connection.h:68
The StatefulDBusProxy class is a base class representing a remote object whose API is stateful...
Definition: dbus-proxy.h:96
ConnectionStatus
Definition: build/TelepathyQt/_gen/constants.h:1420
The PendingContacts class is used by ContactManager when creating/updating Contact objects...
Definition: pending-contacts.h:46
static const Feature FeatureAccountBalance
Definition: connection.h:73
QString certificateHostname() const
Definition: connection.h:153
The PendingChannel class represents the parameters of and the reply to an asynchronous channel reques...
Definition: pending-channel.h:44
The Connection class represents a Telepathy connection.
Definition: connection.h:61
bool isValid() const
Definition: connection.h:106
The OptionalInterfaceFactory class is a helper class for high-level D-Bus proxy classes willing to of...
Definition: optional-interface-factory.h:65
Helper container for safe management of handle lifetimes. Every handle in a ReferencedHandles contain...
Definition: referenced-handles.h:47
HandleType
Definition: build/TelepathyQt/_gen/constants.h:1375
Definition: abstract-adaptor.cpp:31
bool hasUserRequested() const
Definition: connection.h:128
QString serverMessage() const
Definition: connection.h:123
The Feature class represents a feature that can be enabled on demand.
Definition: feature.h:41
static const Feature FeatureConnected
Definition: connection.h:74
static const Feature FeatureRoster
Definition: connection.h:71
The ConnectionLowlevel class extends Connection with support to low-level features.
Definition: connection-lowlevel.h:43
QString debugMessage() const
Definition: connection.h:113