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;
 
   57 class PendingContactAttributes;
 
   59 class PendingOperation;
 
   77     static ConnectionPtr create(
const QString &busName,
 
   78             const QString &objectPath,
 
   79             const ChannelFactoryConstPtr &channelFactory,
 
   80             const ContactFactoryConstPtr &contactFactory);
 
   81     static ConnectionPtr create(
const QDBusConnection &bus,
 
   82             const QString &busName, 
const QString &objectPath,
 
   83             const ChannelFactoryConstPtr &channelFactory,
 
   84             const ContactFactoryConstPtr &contactFactory);
 
   88     ChannelFactoryConstPtr channelFactory() 
const;
 
   89     ContactFactoryConstPtr contactFactory() 
const;
 
   91     QString cmName() 
const;
 
   92     QString protocolName() 
const;
 
  107             bool isValid()
 const { 
return mPriv.constData() != 0; }
 
  111                 return allDetails().contains(QLatin1String(
"debug-message"));
 
  116                 return qdbus_cast<QString>(allDetails().value(QLatin1String(
"debug-message")));
 
  121                 return allDetails().contains(QLatin1String(
"server-message"));
 
  126                 return qdbus_cast<QString>(allDetails().value(QLatin1String(
"server-message")));
 
  131                 return allDetails().contains(QLatin1String(
"user-requested"));
 
  136                 return qdbus_cast<
bool>(allDetails().value(QLatin1String(
"user-requested")));
 
  141                 return allDetails().contains(QLatin1String(
"expected-hostname"));
 
  146                 return qdbus_cast<QString>(allDetails().value(QLatin1String(
"expected-hostname")));
 
  151                 return allDetails().contains(QLatin1String(
"certificate-hostname"));
 
  156                 return qdbus_cast<QString>(allDetails().value(QLatin1String(
"certificate-hostname")));
 
  159             QVariantMap allDetails() 
const;
 
  165             friend struct Private;
 
  166             QSharedDataPointer<Private> mPriv;
 
  171     uint selfHandle() 
const;
 
  172     ContactPtr selfContact() 
const;
 
  178     ContactManagerPtr contactManager() 
const;
 
  180 #if defined(BUILDING_TP_QT) || defined(TP_QT_ENABLE_LOWLEVEL_API) 
  181     ConnectionLowlevelPtr lowlevel();
 
  182     ConnectionLowlevelConstPtr lowlevel() 
const;
 
  188     void selfHandleChanged(uint newHandle);
 
  190     void selfContactChanged();
 
  195     Connection(
const QDBusConnection &bus, 
const QString &busName,
 
  196             const QString &objectPath,
 
  197             const ChannelFactoryConstPtr &channelFactory,
 
  198             const ContactFactoryConstPtr &contactFactory,
 
  204     TP_QT_NO_EXPORT 
void onStatusReady(uint status);
 
  205     TP_QT_NO_EXPORT 
void onStatusChanged(uint status, uint reason);
 
  206     TP_QT_NO_EXPORT 
void onConnectionError(
const QString &error, 
const QVariantMap &details);
 
  207     TP_QT_NO_EXPORT 
void gotMainProperties(QDBusPendingCallWatcher *watcher);
 
  208     TP_QT_NO_EXPORT 
void gotStatus(QDBusPendingCallWatcher *watcher);
 
  209     TP_QT_NO_EXPORT 
void gotInterfaces(QDBusPendingCallWatcher *watcher);
 
  210     TP_QT_NO_EXPORT 
void gotSelfHandle(QDBusPendingCallWatcher *watcher);
 
  211     TP_QT_NO_EXPORT 
void gotCapabilities(QDBusPendingCallWatcher *watcher);
 
  212     TP_QT_NO_EXPORT 
void gotContactAttributeInterfaces(QDBusPendingCallWatcher *watcher);
 
  213     TP_QT_NO_EXPORT 
void gotSimpleStatuses(QDBusPendingCallWatcher *watcher);
 
  219     TP_QT_NO_EXPORT 
void doReleaseSweep(uint handleType);
 
  221     TP_QT_NO_EXPORT 
void onSelfHandleChanged(uint);
 
  223     TP_QT_NO_EXPORT 
void gotBalance(QDBusPendingCallWatcher *watcher);
 
  227     class PendingConnect;
 
  230     friend class PendingConnect;
 
  236     TP_QT_NO_EXPORT 
void refHandle(
HandleType handleType, uint handle);
 
  237     TP_QT_NO_EXPORT 
void unrefHandle(
HandleType handleType, uint handle);
 
  238     TP_QT_NO_EXPORT 
void handleRequestLanded(
HandleType handleType);
 
  241     friend struct Private;
 
HandleType
Definition: build/TelepathyQt/_gen/constants.h:1375
bool hasCertificateHostname() const 
Definition: connection.h:149
static const Feature FeatureRoster
Definition: connection.h:72
The PendingHandles class represents the parameters of and the reply to an asynchronous handle request...
Definition: pending-handles.h:46
Definition: build/TelepathyQt/_gen/types.h:1352
The Feature class represents a feature that can be enabled on demand. 
Definition: feature.h:41
The StatefulDBusProxy class is a base class representing a remote object whose API is stateful...
Definition: dbus-proxy.h:96
bool hasServerMessage() const 
Definition: connection.h:119
ConnectionStatusReason
Definition: build/TelepathyQt/_gen/constants.h:1465
Definition: cli-connection.h:44
The PendingOperation class is a base class for pending asynchronous operations. 
Definition: pending-operation.h:45
bool hasDebugMessage() const 
Definition: connection.h:109
static const Feature FeatureAccountBalance
Definition: connection.h:74
bool hasExpectedHostname() const 
Definition: connection.h:139
QString certificateHostname() const 
Definition: connection.h:154
bool isValid() const 
Definition: connection.h:107
The PendingContacts class is used by ContactManager when creating/updating Contact objects...
Definition: pending-contacts.h:46
The Connection class represents a Telepathy connection. 
Definition: connection.h:62
Helper container for safe management of handle lifetimes. Every handle in a ReferencedHandles contain...
Definition: referenced-handles.h:47
static const Feature FeatureSelfContact
Definition: connection.h:70
ConnectionStatus
Definition: build/TelepathyQt/_gen/constants.h:1420
bool hasUserRequested() const 
Definition: connection.h:129
The PendingChannel class represents the parameters of and the reply to an asynchronous channel reques...
Definition: pending-channel.h:44
QString serverMessage() const 
Definition: connection.h:124
The Connection::ErrorDetails class represents the details of a connection error. 
Definition: connection.h:97
static const Feature FeatureRosterGroups
Definition: connection.h:73
static const Feature FeatureSimplePresence
Definition: connection.h:71
bool userRequested() const 
Definition: connection.h:134
The ConnectionLowlevel class extends Connection with support to low-level features. 
Definition: connection-lowlevel.h:43
QString expectedHostname() const 
Definition: connection.h:144
The ConnectionCapabilities class represents the capabilities of a Connection. 
Definition: connection-capabilities.h:38
static const Feature FeatureConnected
Definition: connection.h:75
QString debugMessage() const 
Definition: connection.h:114
static const Feature FeatureCore
Definition: connection.h:69
The OptionalInterfaceFactory class is a helper class for high-level D-Bus proxy classes willing to of...
Definition: optional-interface-factory.h:65
The PendingContactAttributes class represents the parameters of and the reply to an asynchronous requ...
Definition: pending-contact-attributes.h:40