23 #ifndef _TelepathyQt_base_protocol_h_HEADER_GUARD_ 24 #define _TelepathyQt_base_protocol_h_HEADER_GUARD_ 26 #ifndef IN_TP_QT_HEADER 27 #error IN_TP_QT_HEADER 30 #include <TelepathyQt/AvatarSpec> 31 #include <TelepathyQt/Callbacks> 32 #include <TelepathyQt/DBusService> 33 #include <TelepathyQt/Global> 34 #include <TelepathyQt/PresenceSpecList> 35 #include <TelepathyQt/ProtocolParameterList> 36 #include <TelepathyQt/RequestableChannelClassSpecList> 37 #include <TelepathyQt/Types> 39 #include <QDBusConnection> 53 static BaseProtocolPtr
create(
const QString &name)
55 return BaseProtocolPtr(
new BaseProtocol(QDBusConnection::sessionBus(), name));
57 template<
typename BaseProtocolSub
class>
61 QDBusConnection::sessionBus(), name));
63 static BaseProtocolPtr
create(
const QDBusConnection &dbusConnection,
const QString &name)
65 return BaseProtocolPtr(
new BaseProtocol(dbusConnection, name));
67 template<
typename BaseProtocolSub
class>
78 QVariantMap immutableProperties()
const;
81 QStringList connectionInterfaces()
const;
82 void setConnectionInterfaces(
const QStringList &connInterfaces);
90 QString vcardField()
const;
91 void setVCardField(
const QString &vcardField);
93 QString englishName()
const;
94 void setEnglishName(
const QString &englishName);
96 QString iconName()
const;
97 void setIconName(
const QString &iconName);
99 QStringList authenticationTypes()
const;
100 void setAuthenticationTypes(
const QStringList &authenticationTypes);
104 Tp::BaseConnectionPtr createConnection(
const QVariantMap ¶meters,
DBusError *error);
108 QString identifyAccount(
const QVariantMap ¶meters,
DBusError *error);
112 QString normalizeContact(
const QString &contactId,
DBusError *error);
114 QList<AbstractProtocolInterfacePtr> interfaces()
const;
115 AbstractProtocolInterfacePtr interface(
const QString & interfaceName)
const;
116 bool plugInterface(
const AbstractProtocolInterfacePtr &interface);
119 BaseProtocol(
const QDBusConnection &dbusConnection,
const QString &name);
121 virtual bool registerObject(
const QString &busName,
const QString &objectPath,
127 friend class Adaptee;
129 friend struct Private;
146 friend struct Private;
156 static BaseProtocolAddressingInterfacePtr
create()
160 template<
typename BaseProtocolAddressingInterfaceSub
class>
164 new BaseProtocolAddressingInterfaceSubclass());
169 QStringList addressableVCardFields()
const;
170 void setAddressableVCardFields(
const QStringList &vcardFields);
172 QStringList addressableUriSchemes()
const;
173 void setAddressableUriSchemes(
const QStringList &uriSchemes);
177 QString normalizeVCardAddress(
const QString &vcardField,
const QString &vcardAddress,
DBusError *error);
181 QString normalizeContactUri(
const QString &uri,
DBusError *error);
187 void createAdaptor();
190 friend class Adaptee;
192 friend struct Private;
202 static BaseProtocolAvatarsInterfacePtr
create()
206 template<
typename BaseProtocolAvatarsInterfaceSub
class>
210 new BaseProtocolAvatarsInterfaceSubclass());
215 QVariantMap immutableProperties()
const;
218 void setAvatarDetails(
const AvatarSpec &spec);
224 void createAdaptor();
227 friend class Adaptee;
229 friend struct Private;
239 static BaseProtocolPresenceInterfacePtr
create()
243 template<
typename BaseProtocolPresenceInterfaceSub
class>
247 new BaseProtocolPresenceInterfaceSubclass());
252 QVariantMap immutableProperties()
const;
261 void createAdaptor();
264 friend class Adaptee;
266 friend struct Private;
Base class for protocol implementations.
Definition: base-protocol.h:47
static BaseProtocolPresenceInterfacePtr create()
Definition: base-protocol.h:239
Base class for D-Bus services.
Definition: dbus-service.h:46
static BaseProtocolPtr create(const QDBusConnection &dbusConnection, const QString &name)
Definition: base-protocol.h:63
static SharedPtr< BaseProtocolPresenceInterfaceSubclass > create()
Definition: base-protocol.h:244
Callback2< QString, const QString &, DBusError * > NormalizeContactCallback
Definition: base-protocol.h:110
Callback2< BaseConnectionPtr, const QVariantMap &, DBusError * > CreateConnectionCallback
Definition: base-protocol.h:102
Base class for implementations of Protocol.Interface.Presence.
Definition: base-protocol.h:233
static BaseProtocolAddressingInterfacePtr create()
Definition: base-protocol.h:156
Base class for all the Protocol object interface implementations.
Definition: base-protocol.h:133
Base class for D-Bus service interfaces.
Definition: dbus-service.h:73
Callback2< QString, const QVariantMap &, DBusError * > IdentifyAccountCallback
Definition: base-protocol.h:106
Callback2< QString, const QString &, DBusError * > NormalizeContactUriCallback
Definition: base-protocol.h:179
static BaseProtocolAvatarsInterfacePtr create()
Definition: base-protocol.h:202
static SharedPtr< BaseProtocolSubclass > create(const QString &name)
Definition: base-protocol.h:58
The RequestableChannelClassSpecList class represents a list of RequestableChannelClassSpec.
Definition: requestable-channel-class-spec.h:101
The PresenceSpecList class represents a list of PresenceSpec.
Definition: presence.h:125
Callback3< QString, const QString &, const QString &, DBusError * > NormalizeVCardAddressCallback
Definition: base-protocol.h:175
static BaseProtocolPtr create(const QString &name)
Definition: base-protocol.h:53
Base class for implementations of Protocol.Interface.Avatars.
Definition: base-protocol.h:196
The SharedPtr class is a pointer to an explicitly shared object.
Definition: shared-ptr.h:39
static SharedPtr< BaseProtocolAvatarsInterfaceSubclass > create()
Definition: base-protocol.h:207
Base class for implementations of Protocol.Interface.Addressing.
Definition: base-protocol.h:150
static SharedPtr< BaseProtocolSubclass > create(const QDBusConnection &dbusConnection, const QString &name)
Definition: base-protocol.h:68
Small container class, containing a D-Bus error.
Definition: dbus-error.h:35
Base class for connection manager implementations.
Definition: base-connection-manager.h:41
static SharedPtr< BaseProtocolAddressingInterfaceSubclass > create()
Definition: base-protocol.h:161
Definition: abstract-adaptor.cpp:31
The AvatarSpec class represents a Telepathy avatar information supported by a protocol.
Definition: avatar.h:51
QList< ProtocolParameter > ProtocolParameterList
Definition: protocol-parameter.h:85