23 #ifndef _TelepathyQt_base_connection_h_HEADER_GUARD_
24 #define _TelepathyQt_base_connection_h_HEADER_GUARD_
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
30 #include <TelepathyQt/AvatarSpec>
31 #include <TelepathyQt/DBusService>
32 #include <TelepathyQt/Global>
33 #include <TelepathyQt/Types>
34 #include <TelepathyQt/Callbacks>
35 #include <TelepathyQt/Constants>
37 #include <QDBusConnection>
50 static BaseConnectionPtr
create(
const QString &cmName,
const QString &protocolName,
51 const QVariantMap ¶meters,
52 const QDBusConnection &dbusConnection = QDBusConnection::sessionBus())
55 dbusConnection, cmName, protocolName, parameters));
57 template<
typename BaseConnectionSub
class>
59 const QString &protocolName,
const QVariantMap ¶meters,
60 const QDBusConnection &dbusConnection = QDBusConnection::sessionBus())
63 dbusConnection, cmName, protocolName, parameters));
68 QString cmName()
const;
69 QString protocolName()
const;
70 QVariantMap parameters()
const;
71 QVariantMap immutableProperties()
const;
73 uint selfHandle()
const;
74 void setSelfHandle(uint selfHandle);
76 QString selfID()
const;
77 void setSelfID(
const QString &selfID);
79 void setSelfContact(uint selfHandle,
const QString &selfID);
82 void setStatus(uint newStatus, uint reason);
86 BaseChannelPtr createChannel(
const QVariantMap &request,
bool suppressHandler,
DBusError *error);
102 BaseChannelPtr ensureChannel(
const QVariantMap &request,
bool &yours,
bool suppressHandler,
DBusError *error);
104 void addChannel(BaseChannelPtr channel,
bool suppressHandler =
false);
106 QList<AbstractConnectionInterfacePtr> interfaces()
const;
107 AbstractConnectionInterfacePtr interface(
const QString &interfaceName)
const;
108 bool plugInterface(
const AbstractConnectionInterfacePtr &interface);
109 bool registerObject(
DBusError *error = NULL);
111 virtual QString uniqueName()
const;
117 TP_QT_NO_EXPORT
void removeChannel();
121 const QString &cmName,
const QString &protocolName,
122 const QVariantMap ¶meters);
124 virtual bool registerObject(
const QString &busName,
const QString &objectPath,
127 virtual bool matchChannel(
const Tp::BaseChannelPtr &channel,
const QVariantMap &request,
Tp::DBusError *error);
131 friend class Adaptee;
133 friend struct Private;
150 friend struct Private;
163 template<
typename BaseConnectionRequestsInterfaceSub
class>
166 new BaseConnectionRequestsInterfaceSubclass(connection));
171 QVariantMap immutableProperties()
const;
174 void ensureChannel(
const QVariantMap &request,
bool &yours,
175 QDBusObjectPath &channel, QVariantMap &details,
DBusError* error);
176 void createChannel(
const QVariantMap &request, QDBusObjectPath &channel,
181 void channelClosed(
const QDBusObjectPath &removed);
187 void createAdaptor();
190 friend class Adaptee;
192 friend struct Private;
204 static BaseConnectionContactsInterfacePtr
create() {
207 template<
typename BaseConnectionContactsInterfaceSub
class>
210 new BaseConnectionContactsInterfaceSubclass());
215 QVariantMap immutableProperties()
const;
220 const QStringList &interfaces,
222 void setContactAttributeInterfaces(
const QStringList &contactAttributeInterfaces);
227 void createAdaptor();
230 friend class Adaptee;
232 friend struct Private;
242 static BaseConnectionSimplePresenceInterfacePtr
create()
246 template<
typename BaseConnectionSimplePresenceInterfaceSub
class>
250 new BaseConnectionSimplePresenceInterfaceSubclass());
255 QVariantMap immutableProperties()
const;
260 uint maximumStatusMessageLength()
const;
261 void setMaximumStatusMessageLength(uint maximumStatusMessageLength);
274 void createAdaptor();
277 friend class Adaptee;
279 friend struct Private;
289 static BaseConnectionContactListInterfacePtr
create()
293 template<
typename BaseConnectionContactListInterfaceSub
class>
297 new BaseConnectionContactListInterfaceSubclass());
302 QVariantMap immutableProperties()
const;
304 uint contactListState()
const;
305 void setContactListState(uint contactListState);
307 bool contactListPersists()
const;
308 void setContactListPersists(
bool contactListPersists);
310 bool canChangeContactList()
const;
311 void setCanChangeContactList(
bool canChangeContactList);
313 bool requestUsesMessage()
const;
314 void setRequestUsesMessage(
bool requestUsesMessage);
316 bool downloadAtConnection()
const;
317 void setDownloadAtConnection(
bool downloadAtConnection);
353 void createAdaptor();
356 friend class Adaptee;
358 friend struct Private;
368 static BaseConnectionContactInfoInterfacePtr
create()
372 template<
typename BaseConnectionContactInfoInterfaceSub
class>
376 new BaseConnectionContactInfoInterfaceSubclass());
381 QVariantMap immutableProperties()
const;
411 void createAdaptor();
414 friend class Adaptee;
416 friend struct Private;
426 static BaseConnectionAddressingInterfacePtr
create() {
429 template<
typename BaseConnectionAddressingInterfaceSub
class>
432 new BaseConnectionAddressingInterfaceSubclass());
437 QVariantMap immutableProperties()
const;
441 typedef Callback6 < void,
const QString&,
const QStringList&,
const QStringList&,
445 typedef Callback5 < void,
const QStringList&,
const QStringList&,
453 void createAdaptor();
456 friend class Adaptee;
458 friend struct Private;
468 static BaseConnectionAliasingInterfacePtr
create()
472 template<
typename BaseConnectionAliasingInterfaceSub
class>
476 new BaseConnectionAliasingInterfaceSubclass());
481 QVariantMap immutableProperties()
const;
505 void createAdaptor();
508 friend class Adaptee;
510 friend struct Private;
520 static BaseConnectionAvatarsInterfacePtr
create()
524 template<
typename BaseConnectionAvatarsInterfaceSub
class>
528 new BaseConnectionAvatarsInterfaceSubclass());
533 QVariantMap immutableProperties()
const;
536 void setAvatarDetails(
const AvatarSpec &spec);
548 QString setAvatar(
const QByteArray &avatar,
const QString &mimeType,
DBusError *error);
554 void avatarUpdated(uint contact,
const QString &newAvatarToken);
555 void avatarRetrieved(uint contact,
const QString &token,
const QByteArray &avatar,
const QString &type);
561 void createAdaptor();
564 friend class Adaptee;
566 friend struct Private;
QList< ChannelDetails > ChannelDetailsList
Definition: build/TelepathyQt/_gen/types.h:820
Callback3< ContactAttributesMap, const Tp::UIntList &, const QStringList &, DBusError * > GetContactAttributesCallback
Definition: base-connection.h:217
Base class for implementations of Connection.Interface.SimplePresence.
Definition: base-connection.h:236
QList< ContactInfoField > ContactInfoFieldList
Definition: build/TelepathyQt/_gen/types.h:1188
Definition: build/TelepathyQt/_gen/types.h:3459
Callback3< QStringList, uint, const Tp::UIntList &, DBusError * > InspectHandlesCallback
Definition: base-connection.h:91
Base class for D-Bus service interfaces.
Definition: dbus-service.h:73
Callback2< QStringList, const Tp::UIntList &, DBusError * > RequestAliasesCallback
Definition: base-connection.h:487
The AvatarSpec class represents a Telepathy avatar information supported by a protocol.
Definition: avatar.h:51
Base class for Connection implementations.
Definition: base-connection.h:44
static BaseConnectionContactInfoInterfacePtr create()
Definition: base-connection.h:368
Callback2< Tp::ContactInfoFieldList, uint, DBusError * > RequestContactInfoCallback
Definition: base-connection.h:397
static BaseConnectionAddressingInterfacePtr create()
Definition: base-connection.h:426
Callback1< Tp::ConnectionAliasFlags, DBusError * > GetAliasFlagsCallback
Definition: base-connection.h:483
static SharedPtr< BaseConnectionAvatarsInterfaceSubclass > create()
Definition: base-connection.h:525
Callback2< void, const Tp::AliasMap &, DBusError * > SetAliasesCallback
Definition: base-connection.h:495
QList< AliasPair > AliasPairList
Definition: build/TelepathyQt/_gen/types.h:224
Callback5< void, const QStringList &, const QStringList &, Tp::AddressingNormalizationMap &, Tp::ContactAttributesMap &, DBusError * > GetContactsByURICallback
Definition: base-connection.h:446
static BaseConnectionAvatarsInterfacePtr create()
Definition: base-connection.h:520
Callback2< void, const Tp::UIntList &, DBusError * > RemoveContactsCallback
Definition: base-connection.h:331
Callback2< void, const Tp::UIntList &, DBusError * > RefreshContactInfoCallback
Definition: base-connection.h:393
Callback1< void, DBusError * > ConnectCallback
Definition: base-connection.h:88
Base class for implementations of Connection.Interface.Requests.
Definition: base-connection.h:154
Callback3< void, const Tp::UIntList &, const QString &, DBusError * > RequestSubscriptionCallback
Definition: base-connection.h:323
Base class for implementations of Connection.Interface.Contacts.
Definition: base-connection.h:197
Callback3< Tp::ContactAttributesMap, const QStringList &, bool, DBusError * > GetContactListAttributesCallback
Definition: base-connection.h:319
Base class for all the Connection object interface implementations.
Definition: base-connection.h:137
static SharedPtr< BaseConnectionContactsInterfaceSubclass > create()
Definition: base-connection.h:208
Definition: build/TelepathyQt/_gen/types.h:161
static SharedPtr< BaseConnectionSimplePresenceInterfaceSubclass > create()
Definition: base-connection.h:247
Callback1< void, DBusError * > DownloadCallback
Definition: base-connection.h:343
Base class for implementations of Connection.Interface.Avatars.
Definition: base-connection.h:514
Base class for D-Bus services.
Definition: dbus-service.h:46
Definition: build/TelepathyQt/_gen/types.h:101
QFlags< ConnectionAliasFlag > ConnectionAliasFlags
Definition: build/TelepathyQt/_gen/constants.h:164
The SharedPtr class is a pointer to an explicitly shared object.
Definition: shared-ptr.h:39
static SharedPtr< BaseConnectionContactListInterfaceSubclass > create()
Definition: base-connection.h:294
Callback2< BaseChannelPtr, const QVariantMap &, DBusError * > CreateChannelCallback
Definition: base-connection.h:84
QList< RequestableChannelClass > RequestableChannelClassList
Definition: build/TelepathyQt/_gen/types.h:2621
Callback3< Tp::UIntList, uint, const QStringList &, DBusError * > RequestHandlesCallback
Definition: base-connection.h:95
QList< FieldSpec > FieldSpecs
Definition: build/TelepathyQt/_gen/types.h:1562
QFlags< ContactInfoFlag > ContactInfoFlags
Definition: build/TelepathyQt/_gen/constants.h:324
Callback with 6 arguments.
Definition: callbacks.h:327
Tp::RequestableChannelClassList requestableChannelClasses
Definition: base-connection.h:173
Definition: build/TelepathyQt/_gen/types.h:950
static SharedPtr< BaseConnectionContactInfoInterfaceSubclass > create()
Definition: base-connection.h:373
Definition: build/TelepathyQt/_gen/types.h:3849
static BaseConnectionSimplePresenceInterfacePtr create()
Definition: base-connection.h:242
Callback2< void, const Tp::UIntList &, DBusError * > UnsubscribeCallback
Definition: base-connection.h:335
Base class for implementations of Connection.Interface.Aliasing.
Definition: base-connection.h:462
static BaseConnectionAliasingInterfacePtr create()
Definition: base-connection.h:468
static BaseConnectionContactsInterfacePtr create()
Definition: base-connection.h:204
Callback1< void, DBusError * > ClearAvatarCallback
Definition: base-connection.h:550
static SharedPtr< BaseConnectionAliasingInterfaceSubclass > create()
Definition: base-connection.h:473
static SharedPtr< BaseConnectionRequestsInterfaceSubclass > create(BaseConnection *connection)
Definition: base-connection.h:164
QList< ChannelInfo > ChannelInfoList
Definition: build/TelepathyQt/_gen/types.h:869
Base class for implementations of Connection.Interface.ContactList.
Definition: base-connection.h:283
Small container class, containing a D-Bus error.
Definition: dbus-error.h:35
Callback with 5 arguments.
Definition: callbacks.h:290
Callback2< void, const Tp::UIntList &, DBusError * > UnpublishCallback
Definition: base-connection.h:339
static BaseConnectionRequestsInterfacePtr create(BaseConnection *connection)
Definition: base-connection.h:160
static BaseConnectionContactListInterfacePtr create()
Definition: base-connection.h:289
static SharedPtr< BaseConnectionAddressingInterfaceSubclass > create()
Definition: base-connection.h:430
Callback3< QString, const QByteArray &, const QString &, DBusError * > SetAvatarCallback
Definition: base-connection.h:546
Definition: build/TelepathyQt/_gen/types.h:1646
Callback2< void, const Tp::ContactInfoFieldList &, DBusError * > SetContactInfoCallback
Definition: base-connection.h:401
Definition: build/TelepathyQt/_gen/types.h:3505
Callback2< void, const Tp::UIntList &, DBusError * > AuthorizePublicationCallback
Definition: base-connection.h:327
Definition: build/TelepathyQt/_gen/types.h:3827
Callback6< void, const QString &, const QStringList &, const QStringList &, Tp::AddressingNormalizationMap &, Tp::ContactAttributesMap &, DBusError * > GetContactsByVCardFieldCallback
Definition: base-connection.h:442
Callback2< Tp::AvatarTokenMap, const Tp::UIntList &, DBusError * > GetKnownAvatarTokensCallback
Definition: base-connection.h:538
Callback2< Tp::ContactInfoMap, const Tp::UIntList &, DBusError * > GetContactInfoCallback
Definition: base-connection.h:389
Callback2< void, const Tp::UIntList &, DBusError * > RequestAvatarsCallback
Definition: base-connection.h:542
Callback3< uint, const QString &, const QString &, DBusError * > SetPresenceCallback
Definition: base-connection.h:263
Definition: build/TelepathyQt/_gen/types.h:265
Base class for implementations of Connection.Interface.Addressing.
Definition: base-connection.h:420
Callback2< Tp::AliasMap, const Tp::UIntList &, DBusError * > GetAliasesCallback
Definition: base-connection.h:491
static BaseConnectionPtr create(const QString &cmName, const QString &protocolName, const QVariantMap ¶meters, const QDBusConnection &dbusConnection=QDBusConnection::sessionBus())
Definition: base-connection.h:50
Definition: build/TelepathyQt/_gen/types.h:183
static SharedPtr< BaseConnectionSubclass > create(const QString &cmName, const QString &protocolName, const QVariantMap ¶meters, const QDBusConnection &dbusConnection=QDBusConnection::sessionBus())
Definition: base-connection.h:58
Base class for implementations of Connection.Interface.Contact.Info.
Definition: base-connection.h:362