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);
85 void setCreateChannelCallback(
const CreateChannelCallback &cb);
86 BaseChannelPtr createChannel(
const QVariantMap &request,
bool suppressHandler,
DBusError *error);
89 void setConnectCallback(
const ConnectCallback &cb);
92 void setInspectHandlesCallback(
const InspectHandlesCallback &cb);
96 void setRequestHandlesCallback(
const RequestHandlesCallback &cb);
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;
153 friend struct Private;
166 template<
typename BaseConnectionRequestsInterfaceSub
class>
169 new BaseConnectionRequestsInterfaceSubclass(connection));
174 QVariantMap immutableProperties()
const;
177 void ensureChannel(
const QVariantMap &request,
bool &yours,
178 QDBusObjectPath &channel, QVariantMap &details,
DBusError* error);
179 void createChannel(
const QVariantMap &request, QDBusObjectPath &channel,
184 void channelClosed(
const QDBusObjectPath &removed);
190 void createAdaptor();
193 friend class Adaptee;
195 friend struct Private;
205 static BaseConnectionContactsInterfacePtr
create()
209 template<
typename BaseConnectionContactsInterfaceSub
class>
213 new BaseConnectionContactsInterfaceSubclass());
218 QVariantMap immutableProperties()
const;
220 QStringList contactAttributeInterfaces()
const;
221 void setContactAttributeInterfaces(
const QStringList &contactAttributeInterfaces);
224 void setGetContactAttributesCallback(
const GetContactAttributesCallback &cb);
227 void getContactByID(
const QString &identifier,
const QStringList &interfaces, uint &handle, QVariantMap &attributes,
DBusError *error);
234 void createAdaptor();
237 friend class Adaptee;
239 friend struct Private;
249 static BaseConnectionSimplePresenceInterfacePtr
create()
253 template<
typename BaseConnectionSimplePresenceInterfaceSub
class>
257 new BaseConnectionSimplePresenceInterfaceSubclass());
262 QVariantMap immutableProperties()
const;
267 uint maximumStatusMessageLength()
const;
268 void setMaximumStatusMessageLength(uint maximumStatusMessageLength);
271 void setSetPresenceCallback(
const SetPresenceCallback &cb);
281 void createAdaptor();
284 friend class Adaptee;
286 friend struct Private;
296 static BaseConnectionContactListInterfacePtr
create()
300 template<
typename BaseConnectionContactListInterfaceSub
class>
304 new BaseConnectionContactListInterfaceSubclass());
309 QVariantMap immutableProperties()
const;
311 uint contactListState()
const;
312 void setContactListState(uint contactListState);
314 bool contactListPersists()
const;
315 void setContactListPersists(
bool contactListPersists);
317 bool canChangeContactList()
const;
318 void setCanChangeContactList(
bool canChangeContactList);
320 bool requestUsesMessage()
const;
321 void setRequestUsesMessage(
bool requestUsesMessage);
323 bool downloadAtConnection()
const;
324 void setDownloadAtConnection(
bool downloadAtConnection);
327 void setGetContactListAttributesCallback(
const GetContactListAttributesCallback &cb);
331 void setRequestSubscriptionCallback(
const RequestSubscriptionCallback &cb);
335 void setAuthorizePublicationCallback(
const AuthorizePublicationCallback &cb);
339 void setRemoveContactsCallback(
const RemoveContactsCallback &cb);
343 void setUnsubscribeCallback(
const UnsubscribeCallback &cb);
347 void setUnpublishCallback(
const UnpublishCallback &cb);
351 void setDownloadCallback(
const DownloadCallback &cb);
360 void createAdaptor();
363 friend class Adaptee;
365 friend struct Private;
375 static BaseConnectionContactInfoInterfacePtr
create()
379 template<
typename BaseConnectionContactInfoInterfaceSub
class>
383 new BaseConnectionContactInfoInterfaceSubclass());
388 QVariantMap immutableProperties()
const;
397 void setGetContactInfoCallback(
const GetContactInfoCallback &cb);
401 void setRefreshContactInfoCallback(
const RefreshContactInfoCallback &cb);
405 void setRequestContactInfoCallback(
const RequestContactInfoCallback &cb);
409 void setSetContactInfoCallback(
const SetContactInfoCallback &cb);
418 void createAdaptor();
421 friend class Adaptee;
423 friend struct Private;
433 static BaseConnectionAddressingInterfacePtr
create() {
436 template<
typename BaseConnectionAddressingInterfaceSub
class>
439 new BaseConnectionAddressingInterfaceSubclass());
444 QVariantMap immutableProperties()
const;
448 typedef Callback6 < void,
const QString&,
const QStringList&,
const QStringList&,
450 void setGetContactsByVCardFieldCallback(
const GetContactsByVCardFieldCallback &cb);
452 typedef Callback5 < void,
const QStringList&,
const QStringList&,
454 void setGetContactsByURICallback(
const GetContactsByURICallback &cb);
460 void createAdaptor();
463 friend class Adaptee;
465 friend struct Private;
475 static BaseConnectionAliasingInterfacePtr
create()
479 template<
typename BaseConnectionAliasingInterfaceSub
class>
483 new BaseConnectionAliasingInterfaceSubclass());
488 QVariantMap immutableProperties()
const;
491 void setGetAliasFlagsCallback(
const GetAliasFlagsCallback &cb);
495 void setRequestAliasesCallback(
const RequestAliasesCallback &cb);
499 void setGetAliasesCallback(
const GetAliasesCallback &cb);
503 void setSetAliasesCallback(
const SetAliasesCallback &cb);
512 void createAdaptor();
515 friend class Adaptee;
517 friend struct Private;
527 static BaseConnectionAvatarsInterfacePtr
create()
531 template<
typename BaseConnectionAvatarsInterfaceSub
class>
535 new BaseConnectionAvatarsInterfaceSubclass());
540 QVariantMap immutableProperties()
const;
543 void setAvatarDetails(
const AvatarSpec &spec);
546 void setGetKnownAvatarTokensCallback(
const GetKnownAvatarTokensCallback &cb);
550 void setRequestAvatarsCallback(
const RequestAvatarsCallback &cb);
554 void setSetAvatarCallback(
const SetAvatarCallback &cb);
555 QString setAvatar(
const QByteArray &avatar,
const QString &mimeType,
DBusError *error);
558 void setClearAvatarCallback(
const ClearAvatarCallback &cb);
561 void avatarUpdated(uint contact,
const QString &newAvatarToken);
562 void avatarRetrieved(uint contact,
const QString &token,
const QByteArray &avatar,
const QString &type);
568 void createAdaptor();
571 friend class Adaptee;
573 friend struct Private;
583 static BaseConnectionClientTypesInterfacePtr
create()
587 template<
typename BaseConnectionClientTypesInterfaceSub
class>
591 new BaseConnectionClientTypesInterfaceSubclass());
596 QVariantMap immutableProperties()
const;
599 void setGetClientTypesCallback(
const GetClientTypesCallback &cb);
603 void setRequestClientTypesCallback(
const RequestClientTypesCallback &cb);
604 QStringList requestClientTypes(uint contact,
DBusError *error);
606 void clientTypesUpdated(uint contact,
const QStringList &clientTypes);
612 void createAdaptor();
615 friend class Adaptee;
617 friend struct Private;
627 static BaseConnectionContactCapabilitiesInterfacePtr
create()
631 template<
typename BaseConnectionContactCapabilitiesInterfaceSub
class>
635 new BaseConnectionContactCapabilitiesInterfaceSubclass());
640 QVariantMap immutableProperties()
const;
643 void setUpdateCapabilitiesCallback(
const UpdateCapabilitiesCallback &cb);
647 void setGetContactCapabilitiesCallback(
const GetContactCapabilitiesCallback &cb);
656 void createAdaptor();
659 friend class Adaptee;
661 friend struct Private;
static SharedPtr< BaseConnectionContactsInterfaceSubclass > create()
Definition: base-connection.h:210
Callback3< Tp::ContactAttributesMap, const Tp::UIntList &, const QStringList &, DBusError * > GetContactAttributesCallback
Definition: base-connection.h:223
Definition: build/TelepathyQt/_gen/types.h:3514
Base class for implementations of Connection.Interface.ClientTypes.
Definition: base-connection.h:577
Callback3< QString, const QByteArray &, const QString &, DBusError * > SetAvatarCallback
Definition: base-connection.h:553
Definition: build/TelepathyQt/_gen/types.h:3437
static BaseConnectionRequestsInterfacePtr create(BaseConnection *connection)
Definition: base-connection.h:163
Base class for implementations of Connection.Interface.Aliasing.
Definition: base-connection.h:469
Definition: build/TelepathyQt/_gen/types.h:3858
Definition: build/TelepathyQt/_gen/types.h:959
static BaseConnectionPtr create(const QString &cmName, const QString &protocolName, const QVariantMap ¶meters, const QDBusConnection &dbusConnection=QDBusConnection::sessionBus())
Definition: base-connection.h:50
Callback with 6 arguments.
Definition: callbacks.h:327
static SharedPtr< BaseConnectionSubclass > create(const QString &cmName, const QString &protocolName, const QVariantMap ¶meters, const QDBusConnection &dbusConnection=QDBusConnection::sessionBus())
Definition: base-connection.h:58
Callback2< Tp::ContactInfoMap, const Tp::UIntList &, DBusError * > GetContactInfoCallback
Definition: base-connection.h:396
Callback2< void, const Tp::AliasMap &, DBusError * > SetAliasesCallback
Definition: base-connection.h:502
static BaseConnectionContactInfoInterfacePtr create()
Definition: base-connection.h:375
QList< AliasPair > AliasPairList
Definition: build/TelepathyQt/_gen/types.h:233
QList< ChannelInfo > ChannelInfoList
Definition: build/TelepathyQt/_gen/types.h:878
Definition: build/TelepathyQt/_gen/types.h:1655
The AvatarSpec class represents a Telepathy avatar information supported by a protocol.
Definition: avatar.h:51
QList< ChannelDetails > ChannelDetailsList
Definition: build/TelepathyQt/_gen/types.h:829
Callback2< BaseChannelPtr, const QVariantMap &, DBusError * > CreateChannelCallback
Definition: base-connection.h:84
Callback2< void, const Tp::HandlerCapabilitiesList &, DBusError * > UpdateCapabilitiesCallback
Definition: base-connection.h:642
Callback2< void, const Tp::UIntList &, DBusError * > AuthorizePublicationCallback
Definition: base-connection.h:334
static SharedPtr< BaseConnectionAliasingInterfaceSubclass > create()
Definition: base-connection.h:480
static SharedPtr< BaseConnectionContactInfoInterfaceSubclass > create()
Definition: base-connection.h:380
Callback3< uint, const QString &, const QString &, DBusError * > SetPresenceCallback
Definition: base-connection.h:270
Base class for implementations of Connection.Interface.ContactList.
Definition: base-connection.h:290
Callback3< Tp::UIntList, uint, const QStringList &, DBusError * > RequestHandlesCallback
Definition: base-connection.h:95
QList< ContactInfoField > ContactInfoFieldList
Definition: build/TelepathyQt/_gen/types.h:1197
Callback2< void, const Tp::UIntList &, DBusError * > RemoveContactsCallback
Definition: base-connection.h:338
Callback1< void, DBusError * > DownloadCallback
Definition: base-connection.h:350
Base class for D-Bus services.
Definition: dbus-service.h:46
Callback2< QStringList, uint, DBusError * > RequestClientTypesCallback
Definition: base-connection.h:602
Base class for D-Bus service interfaces.
Definition: dbus-service.h:73
QFlags< ContactInfoFlag > ContactInfoFlags
Definition: build/TelepathyQt/_gen/constants.h:324
Base class for implementations of Connection.Interface.Requests.
Definition: base-connection.h:157
static SharedPtr< BaseConnectionContactCapabilitiesInterfaceSubclass > create()
Definition: base-connection.h:632
Definition: build/TelepathyQt/_gen/types.h:3468
static SharedPtr< BaseConnectionContactListInterfaceSubclass > create()
Definition: base-connection.h:301
Definition: build/TelepathyQt/_gen/types.h:3836
Callback2< void, const Tp::UIntList &, DBusError * > RequestAvatarsCallback
Definition: base-connection.h:549
static BaseConnectionAliasingInterfacePtr create()
Definition: base-connection.h:475
Base class for implementations of Connection.Interface.Addressing.
Definition: base-connection.h:427
Callback2< void, const Tp::ContactInfoFieldList &, DBusError * > SetContactInfoCallback
Definition: base-connection.h:408
Small container class, containing a D-Bus error.
Definition: dbus-error.h:35
static BaseConnectionContactsInterfacePtr create()
Definition: base-connection.h:205
Callback with 5 arguments.
Definition: callbacks.h:290
static BaseConnectionClientTypesInterfacePtr create()
Definition: base-connection.h:583
Base class for implementations of Connection.Interface.Contact.Info.
Definition: base-connection.h:369
Definition: build/TelepathyQt/_gen/types.h:1016
static SharedPtr< BaseConnectionAvatarsInterfaceSubclass > create()
Definition: base-connection.h:532
Callback2< Tp::ContactClientTypes, const Tp::UIntList &, DBusError * > GetClientTypesCallback
Definition: base-connection.h:598
Base class for implementations of Connection.Interface.SimplePresence.
Definition: base-connection.h:243
Definition: build/TelepathyQt/_gen/types.h:192
QFlags< ConnectionAliasFlag > ConnectionAliasFlags
Definition: build/TelepathyQt/_gen/constants.h:164
static SharedPtr< BaseConnectionRequestsInterfaceSubclass > create(BaseConnection *connection)
Definition: base-connection.h:167
static BaseConnectionAddressingInterfacePtr create()
Definition: base-connection.h:433
static SharedPtr< BaseConnectionClientTypesInterfaceSubclass > create()
Definition: base-connection.h:588
Callback3< QStringList, uint, const Tp::UIntList &, DBusError * > InspectHandlesCallback
Definition: base-connection.h:91
Definition: build/TelepathyQt/_gen/types.h:107
Callback2< QStringList, const Tp::UIntList &, DBusError * > RequestAliasesCallback
Definition: base-connection.h:494
Tp::RequestableChannelClassList requestableChannelClasses
Definition: base-connection.h:176
QList< RequestableChannelClass > RequestableChannelClassList
Definition: build/TelepathyQt/_gen/types.h:2630
Callback2< Tp::ContactInfoFieldList, uint, DBusError * > RequestContactInfoCallback
Definition: base-connection.h:404
static SharedPtr< BaseConnectionAddressingInterfaceSubclass > create()
Definition: base-connection.h:437
Callback2< Tp::AliasMap, const Tp::UIntList &, DBusError * > GetAliasesCallback
Definition: base-connection.h:498
static BaseConnectionContactCapabilitiesInterfacePtr create()
Definition: base-connection.h:627
Base class for all the Connection object interface implementations.
Definition: base-connection.h:137
Definition: build/TelepathyQt/_gen/types.h:170
Callback5< void, const QStringList &, const QStringList &, Tp::AddressingNormalizationMap &, Tp::ContactAttributesMap &, DBusError * > GetContactsByURICallback
Definition: base-connection.h:453
Callback2< void, const Tp::UIntList &, DBusError * > RefreshContactInfoCallback
Definition: base-connection.h:400
Callback1< void, DBusError * > ClearAvatarCallback
Definition: base-connection.h:557
Definition: abstract-adaptor.cpp:31
Callback6< void, const QString &, const QStringList &, const QStringList &, Tp::AddressingNormalizationMap &, Tp::ContactAttributesMap &, DBusError * > GetContactsByVCardFieldCallback
Definition: base-connection.h:449
QList< HandlerCapabilities > HandlerCapabilitiesList
Definition: build/TelepathyQt/_gen/types.h:3576
Base class for Connection implementations.
Definition: base-connection.h:44
Callback1< void, DBusError * > ConnectCallback
Definition: base-connection.h:88
Base class for implementations of Connection.Interface.ContactCapabilities.
Definition: base-connection.h:621
Definition: build/TelepathyQt/_gen/types.h:274
Base class for implementations of Connection.Interface.Avatars.
Definition: base-connection.h:521
Callback2< void, const Tp::UIntList &, DBusError * > UnsubscribeCallback
Definition: base-connection.h:342
Callback2< Tp::ContactCapabilitiesMap, const Tp::UIntList &, DBusError * > GetContactCapabilitiesCallback
Definition: base-connection.h:646
Callback3< Tp::ContactAttributesMap, const QStringList &, bool, DBusError * > GetContactListAttributesCallback
Definition: base-connection.h:326
Callback2< Tp::AvatarTokenMap, const Tp::UIntList &, DBusError * > GetKnownAvatarTokensCallback
Definition: base-connection.h:545
static BaseConnectionContactListInterfacePtr create()
Definition: base-connection.h:296
static BaseConnectionAvatarsInterfacePtr create()
Definition: base-connection.h:527
static BaseConnectionSimplePresenceInterfacePtr create()
Definition: base-connection.h:249
Base class for implementations of Connection.Interface.Contacts.
Definition: base-connection.h:199
static SharedPtr< BaseConnectionSimplePresenceInterfaceSubclass > create()
Definition: base-connection.h:254
Callback1< Tp::ConnectionAliasFlags, DBusError * > GetAliasFlagsCallback
Definition: base-connection.h:490
The SharedPtr class is a pointer to an explicitly shared object.
Definition: shared-ptr.h:39
Callback3< void, const Tp::UIntList &, const QString &, DBusError * > RequestSubscriptionCallback
Definition: base-connection.h:330
QList< FieldSpec > FieldSpecs
Definition: build/TelepathyQt/_gen/types.h:1571
Callback2< void, const Tp::UIntList &, DBusError * > UnpublishCallback
Definition: base-connection.h:346