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 getExistingChannel(
const QVariantMap &request,
DBusError *error);
103 BaseChannelPtr ensureChannel(
const QVariantMap &request,
bool &yours,
bool suppressHandler,
DBusError *error);
105 void addChannel(BaseChannelPtr channel,
bool suppressHandler =
false);
107 QList<AbstractConnectionInterfacePtr> interfaces()
const;
108 AbstractConnectionInterfacePtr interface(
const QString &interfaceName)
const;
109 bool plugInterface(
const AbstractConnectionInterfacePtr &interface);
110 bool registerObject(
DBusError *error = NULL);
112 virtual QString uniqueName()
const;
118 TP_QT_NO_EXPORT
void removeChannel();
122 const QString &cmName,
const QString &protocolName,
123 const QVariantMap ¶meters);
125 virtual bool registerObject(
const QString &busName,
const QString &objectPath,
128 virtual bool matchChannel(
const Tp::BaseChannelPtr &channel,
const QVariantMap &request,
Tp::DBusError *error);
132 friend class Adaptee;
134 friend struct Private;
154 friend struct Private;
167 template<
typename BaseConnectionRequestsInterfaceSub
class>
170 new BaseConnectionRequestsInterfaceSubclass(connection));
175 QVariantMap immutableProperties()
const;
178 void ensureChannel(
const QVariantMap &request,
bool &yours,
179 QDBusObjectPath &channel, QVariantMap &details,
DBusError* error);
180 void createChannel(
const QVariantMap &request, QDBusObjectPath &channel,
185 void channelClosed(
const QDBusObjectPath &removed);
191 void createAdaptor();
194 friend class Adaptee;
196 friend struct Private;
206 static BaseConnectionContactsInterfacePtr
create()
210 template<
typename BaseConnectionContactsInterfaceSub
class>
214 new BaseConnectionContactsInterfaceSubclass());
219 QVariantMap immutableProperties()
const;
221 QStringList contactAttributeInterfaces()
const;
222 void setContactAttributeInterfaces(
const QStringList &contactAttributeInterfaces);
228 void getContactByID(
const QString &identifier,
const QStringList &interfaces, uint &handle, QVariantMap &attributes,
DBusError *error);
235 void createAdaptor();
238 friend class Adaptee;
240 friend struct Private;
250 static BaseConnectionSimplePresenceInterfacePtr
create()
254 template<
typename BaseConnectionSimplePresenceInterfaceSub
class>
258 new BaseConnectionSimplePresenceInterfaceSubclass());
266 uint maximumStatusMessageLength()
const;
267 void setMaximumStatusMessageLength(uint maximumStatusMessageLength);
280 void createAdaptor();
283 friend class Adaptee;
285 friend struct Private;
295 static BaseConnectionContactListInterfacePtr
create()
299 template<
typename BaseConnectionContactListInterfaceSub
class>
303 new BaseConnectionContactListInterfaceSubclass());
308 uint contactListState()
const;
309 void setContactListState(uint contactListState);
311 bool contactListPersists()
const;
312 void setContactListPersists(
bool contactListPersists);
314 bool canChangeContactList()
const;
315 void setCanChangeContactList(
bool canChangeContactList);
317 bool requestUsesMessage()
const;
318 void setRequestUsesMessage(
bool requestUsesMessage);
320 bool downloadAtConnection()
const;
321 void setDownloadAtConnection(
bool downloadAtConnection);
357 void createAdaptor();
360 friend class Adaptee;
362 friend struct Private;
372 static BaseConnectionContactGroupsInterfacePtr
create()
376 template<
typename BaseConnectionContactGroupsInterfaceSub
class>
380 new BaseConnectionContactGroupsInterfaceSubclass());
385 bool disjointGroups()
const;
386 void setDisjointGroups(
bool disjointGroups);
391 QStringList groups()
const;
392 void setGroups(
const QStringList &groups);
396 void setContactGroups(uint contact,
const QStringList &groups,
DBusError *error);
412 void removeGroup(
const QString &group,
DBusError *error);
416 void renameGroup(
const QString &oldName,
const QString &newName,
DBusError *error);
418 void groupsCreated(
const QStringList &names);
419 void groupRenamed(
const QString &oldName,
const QString &newName);
420 void groupsRemoved(
const QStringList &names);
421 void groupsChanged(
const Tp::UIntList &contact,
const QStringList &added,
const QStringList &removed);
427 void createAdaptor();
430 friend class Adaptee;
432 friend struct Private;
442 static BaseConnectionContactInfoInterfacePtr
create()
446 template<
typename BaseConnectionContactInfoInterfaceSub
class>
450 new BaseConnectionContactInfoInterfaceSubclass());
483 void createAdaptor();
486 friend class Adaptee;
488 friend struct Private;
498 static BaseConnectionAddressingInterfacePtr
create() {
501 template<
typename BaseConnectionAddressingInterfaceSub
class>
504 new BaseConnectionAddressingInterfaceSubclass());
509 typedef Callback6 < void,
const QString&,
const QStringList&,
const QStringList&,
513 typedef Callback5 < void,
const QStringList&,
const QStringList&,
521 void createAdaptor();
524 friend class Adaptee;
526 friend struct Private;
536 static BaseConnectionAliasingInterfacePtr
create()
540 template<
typename BaseConnectionAliasingInterfaceSub
class>
544 new BaseConnectionAliasingInterfaceSubclass());
571 void createAdaptor();
574 friend class Adaptee;
576 friend struct Private;
586 static BaseConnectionAvatarsInterfacePtr
create()
590 template<
typename BaseConnectionAvatarsInterfaceSub
class>
594 new BaseConnectionAvatarsInterfaceSubclass());
600 void setAvatarDetails(
const AvatarSpec &spec);
612 QString setAvatar(
const QByteArray &avatar,
const QString &mimeType,
DBusError *error);
618 void avatarUpdated(uint contact,
const QString &newAvatarToken);
619 void avatarRetrieved(uint contact,
const QString &token,
const QByteArray &avatar,
const QString &type);
625 void createAdaptor();
628 friend class Adaptee;
630 friend struct Private;
640 static BaseConnectionClientTypesInterfacePtr
create()
644 template<
typename BaseConnectionClientTypesInterfaceSub
class>
648 new BaseConnectionClientTypesInterfaceSubclass());
659 QStringList requestClientTypes(uint contact,
DBusError *error);
661 void clientTypesUpdated(uint contact,
const QStringList &clientTypes);
667 void createAdaptor();
670 friend class Adaptee;
672 friend struct Private;
682 static BaseConnectionContactCapabilitiesInterfacePtr
create()
686 template<
typename BaseConnectionContactCapabilitiesInterfaceSub
class>
690 new BaseConnectionContactCapabilitiesInterfaceSubclass());
709 void createAdaptor();
712 friend class Adaptee;
714 friend struct Private;
Callback2< Tp::ContactCapabilitiesMap, const Tp::UIntList &, DBusError * > GetContactCapabilitiesCallback
Definition: base-connection.h:699
static SharedPtr< BaseConnectionAvatarsInterfaceSubclass > create()
Definition: base-connection.h:591
Callback2< void, const Tp::UIntList &, DBusError * > RequestAvatarsCallback
Definition: base-connection.h:606
QList< FieldSpec > FieldSpecs
Definition: build/TelepathyQt/_gen/types.h:1593
Base class for D-Bus services.
Definition: dbus-service.h:46
Callback2< void, const Tp::AliasMap &, DBusError * > SetAliasesCallback
Definition: base-connection.h:561
Definition: build/TelepathyQt/_gen/types.h:196
static SharedPtr< BaseConnectionSimplePresenceInterfaceSubclass > create()
Definition: base-connection.h:255
Definition: build/TelepathyQt/_gen/types.h:109
Definition: build/TelepathyQt/_gen/types.h:973
static BaseConnectionAvatarsInterfacePtr create()
Definition: base-connection.h:586
Callback1< void, DBusError * > ClearAvatarCallback
Definition: base-connection.h:614
static SharedPtr< BaseConnectionRequestsInterfaceSubclass > create(BaseConnection *connection)
Definition: base-connection.h:168
Callback3< void, const QString &, const QString &, DBusError * > RenameGroupCallback
Definition: base-connection.h:414
Definition: build/TelepathyQt/_gen/types.h:3556
QFlags< ContactInfoFlag > ContactInfoFlags
Definition: build/TelepathyQt/_gen/constants.h:324
Definition: build/TelepathyQt/_gen/types.h:3476
QList< ContactInfoField > ContactInfoFieldList
Definition: build/TelepathyQt/_gen/types.h:1213
static BaseConnectionClientTypesInterfacePtr create()
Definition: base-connection.h:640
Definition: build/TelepathyQt/_gen/types.h:173
Callback2< QStringList, const Tp::UIntList &, DBusError * > RequestAliasesCallback
Definition: base-connection.h:553
Callback6< void, const QString &, const QStringList &, const QStringList &, Tp::AddressingNormalizationMap &, Tp::ContactAttributesMap &, DBusError * > GetContactsByVCardFieldCallback
Definition: base-connection.h:510
QList< AliasPair > AliasPairList
Definition: build/TelepathyQt/_gen/types.h:238
Callback with 5 arguments.
Definition: callbacks.h:290
static BaseConnectionAliasingInterfacePtr create()
Definition: base-connection.h:536
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
static BaseConnectionAddressingInterfacePtr create()
Definition: base-connection.h:498
static BaseConnectionContactsInterfacePtr create()
Definition: base-connection.h:206
Callback2< BaseChannelPtr, const QVariantMap &, DBusError * > CreateChannelCallback
Definition: base-connection.h:84
Callback2< Tp::AvatarTokenMap, const Tp::UIntList &, DBusError * > GetKnownAvatarTokensCallback
Definition: base-connection.h:602
Callback2< void, const Tp::UIntList &, DBusError * > RemoveContactsCallback
Definition: base-connection.h:335
ContactMetadataStorageType
Definition: build/TelepathyQt/_gen/constants.h:1880
Base class for implementations of Connection.Interface.Contacts.
Definition: base-connection.h:200
Definition: build/TelepathyQt/_gen/types.h:3903
static BaseConnectionRequestsInterfacePtr create(BaseConnection *connection)
Definition: base-connection.h:164
Callback2< void, const Tp::UIntList &, DBusError * > UnsubscribeCallback
Definition: base-connection.h:339
Base class for Connection implementations.
Definition: base-connection.h:44
Callback2< Tp::ContactInfoFieldList, uint, DBusError * > RequestContactInfoCallback
Definition: base-connection.h:469
Callback with 6 arguments.
Definition: callbacks.h:327
Callback2< void, const QString &, DBusError * > RemoveGroupCallback
Definition: base-connection.h:410
Callback1< void, DBusError * > DownloadCallback
Definition: base-connection.h:347
QFlags< ConnectionAliasFlag > ConnectionAliasFlags
Definition: build/TelepathyQt/_gen/constants.h:164
Callback2< void, const Tp::ContactInfoFieldList &, DBusError * > SetContactInfoCallback
Definition: base-connection.h:473
static SharedPtr< BaseConnectionAliasingInterfaceSubclass > create()
Definition: base-connection.h:541
Definition: build/TelepathyQt/_gen/types.h:279
Callback3< void, uint, const QStringList &, DBusError * > SetContactGroupsCallback
Definition: base-connection.h:394
Base class for implementations of Connection.Interface.Addressing.
Definition: base-connection.h:492
Callback2< Tp::ContactClientTypes, const Tp::UIntList &, DBusError * > GetClientTypesCallback
Definition: base-connection.h:653
Callback3< Tp::ContactAttributesMap, const Tp::UIntList &, const QStringList &, DBusError * > GetContactAttributesCallback
Definition: base-connection.h:224
Callback3< QString, const QByteArray &, const QString &, DBusError * > SetAvatarCallback
Definition: base-connection.h:610
Base class for implementations of Connection.Interface.ContactList.
Definition: base-connection.h:289
Callback2< void, const Tp::UIntList &, DBusError * > RefreshContactInfoCallback
Definition: base-connection.h:465
static BaseConnectionSimplePresenceInterfacePtr create()
Definition: base-connection.h:250
Callback3< void, const QString &, const Tp::UIntList &, DBusError * > RemoveFromGroupCallback
Definition: base-connection.h:406
static SharedPtr< BaseConnectionAddressingInterfaceSubclass > create()
Definition: base-connection.h:502
QList< HandlerCapabilities > HandlerCapabilitiesList
Definition: build/TelepathyQt/_gen/types.h:3619
Callback3< Tp::ContactAttributesMap, const QStringList &, bool, DBusError * > GetContactListAttributesCallback
Definition: base-connection.h:323
Callback2< Tp::ContactInfoMap, const Tp::UIntList &, DBusError * > GetContactInfoCallback
Definition: base-connection.h:461
Callback2< Tp::AliasMap, const Tp::UIntList &, DBusError * > GetAliasesCallback
Definition: base-connection.h:557
Base class for implementations of Connection.Interface.Avatars.
Definition: base-connection.h:580
The SharedPtr class is a pointer to an explicitly shared object.
Definition: shared-ptr.h:39
static BaseConnectionContactGroupsInterfacePtr create()
Definition: base-connection.h:372
Callback2< void, const Tp::UIntList &, DBusError * > UnpublishCallback
Definition: base-connection.h:343
Definition: build/TelepathyQt/_gen/types.h:3508
Tp::RequestableChannelClassList requestableChannelClasses
Definition: base-connection.h:177
Callback2< void, const Tp::HandlerCapabilitiesList &, DBusError * > UpdateCapabilitiesCallback
Definition: base-connection.h:695
static SharedPtr< BaseConnectionContactsInterfaceSubclass > create()
Definition: base-connection.h:211
Callback2< void, const Tp::UIntList &, DBusError * > AuthorizePublicationCallback
Definition: base-connection.h:331
static SharedPtr< BaseConnectionContactListInterfaceSubclass > create()
Definition: base-connection.h:300
Base class for implementations of Connection.Interface.Requests.
Definition: base-connection.h:158
Definition: build/TelepathyQt/_gen/types.h:3880
Callback3< void, const Tp::UIntList &, const QString &, DBusError * > RequestSubscriptionCallback
Definition: base-connection.h:327
static SharedPtr< BaseConnectionContactCapabilitiesInterfaceSubclass > create()
Definition: base-connection.h:687
Callback5< void, const QStringList &, const QStringList &, Tp::AddressingNormalizationMap &, Tp::ContactAttributesMap &, DBusError * > GetContactsByURICallback
Definition: base-connection.h:514
Definition: build/TelepathyQt/_gen/types.h:1031
Base class for implementations of Connection.Interface.Contact.Info.
Definition: base-connection.h:436
static BaseConnectionContactListInterfacePtr create()
Definition: base-connection.h:295
Callback3< Tp::UIntList, uint, const QStringList &, DBusError * > RequestHandlesCallback
Definition: base-connection.h:95
Callback1< Tp::ConnectionAliasFlags, DBusError * > GetAliasFlagsCallback
Definition: base-connection.h:549
Base class for implementations of Connection.Interface.SimplePresence.
Definition: base-connection.h:244
Callback2< QStringList, uint, DBusError * > RequestClientTypesCallback
Definition: base-connection.h:657
Small container class, containing a D-Bus error.
Definition: dbus-error.h:35
static BaseConnectionContactCapabilitiesInterfacePtr create()
Definition: base-connection.h:682
Base class for all the Connection object interface implementations.
Definition: base-connection.h:138
static SharedPtr< BaseConnectionContactInfoInterfaceSubclass > create()
Definition: base-connection.h:447
Definition: build/TelepathyQt/_gen/types.h:1677
Base class for implementations of Connection.Interface.ContactCapabilities.
Definition: base-connection.h:676
Callback3< void, const QString &, const Tp::UIntList &, DBusError * > SetGroupMembersCallback
Definition: base-connection.h:398
static SharedPtr< BaseConnectionSubclass > create(const QString &cmName, const QString &protocolName, const QVariantMap ¶meters, const QDBusConnection &dbusConnection=QDBusConnection::sessionBus())
Definition: base-connection.h:58
static SharedPtr< BaseConnectionClientTypesInterfaceSubclass > create()
Definition: base-connection.h:645
QList< ChannelInfo > ChannelInfoList
Definition: build/TelepathyQt/_gen/types.h:889
Base class for implementations of Connection.Interface.Aliasing.
Definition: base-connection.h:530
Base class for implementations of Connection.Interface.ContactGroups.
Definition: base-connection.h:366
Callback3< void, const QString &, const Tp::UIntList &, DBusError * > AddToGroupCallback
Definition: base-connection.h:402
QList< ChannelDetails > ChannelDetailsList
Definition: build/TelepathyQt/_gen/types.h:840
Definition: abstract-adaptor.cpp:31
Callback1< void, DBusError * > ConnectCallback
Definition: base-connection.h:88
static BaseConnectionPtr create(const QString &cmName, const QString &protocolName, const QVariantMap ¶meters, const QDBusConnection &dbusConnection=QDBusConnection::sessionBus())
Definition: base-connection.h:50
The AvatarSpec class represents a Telepathy avatar information supported by a protocol.
Definition: avatar.h:51
static BaseConnectionContactInfoInterfacePtr create()
Definition: base-connection.h:442
QList< RequestableChannelClass > RequestableChannelClassList
Definition: build/TelepathyQt/_gen/types.h:2664
Base class for implementations of Connection.Interface.ClientTypes.
Definition: base-connection.h:634
Callback3< uint, const QString &, const QString &, DBusError * > SetPresenceCallback
Definition: base-connection.h:269
static SharedPtr< BaseConnectionContactGroupsInterfaceSubclass > create()
Definition: base-connection.h:377