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 class Private;
146 friend class Private;
156 static BaseProtocolAddressingInterfacePtr
create()
160 template<
typename BaseProtocolAddressingInterfaceSub
class>
164 new BaseProtocolAddressingInterfaceSubclass());
169 QVariantMap immutableProperties()
const;
171 QStringList addressableVCardFields()
const;
172 void setAddressableVCardFields(
const QStringList &vcardFields);
174 QStringList addressableUriSchemes()
const;
175 void setAddressableUriSchemes(
const QStringList &uriSchemes);
179 QString normalizeVCardAddress(
const QString &vcardField,
const QString &vcardAddress,
DBusError *error);
183 QString normalizeContactUri(
const QString &uri,
DBusError *error);
189 void createAdaptor();
192 friend class Adaptee;
194 friend struct Private;
204 static BaseProtocolAvatarsInterfacePtr
create()
208 template<
typename BaseProtocolAvatarsInterfaceSub
class>
212 new BaseProtocolAvatarsInterfaceSubclass());
217 QVariantMap immutableProperties()
const;
220 void setAvatarDetails(
const AvatarSpec &spec);
226 void createAdaptor();
229 friend class Adaptee;
231 friend struct Private;
241 static BaseProtocolPresenceInterfacePtr
create()
245 template<
typename BaseProtocolPresenceInterfaceSub
class>
249 new BaseProtocolPresenceInterfaceSubclass());
254 QVariantMap immutableProperties()
const;
263 void createAdaptor();
266 friend class Adaptee;
268 friend struct Private;
static BaseProtocolPtr create(const QDBusConnection &dbusConnection, const QString &name)
Definition: base-protocol.h:63
static BaseProtocolAvatarsInterfacePtr create()
Definition: base-protocol.h:204
static SharedPtr< BaseProtocolAddressingInterfaceSubclass > create()
Definition: base-protocol.h:161
Base class for implementations of Protocol.Interface.Presence.
Definition: base-protocol.h:235
Callback2< QString, const QString &, DBusError * > NormalizeContactUriCallback
Definition: base-protocol.h:181
QList< ProtocolParameter > ProtocolParameterList
Definition: protocol-parameter.h:85
static BaseProtocolAddressingInterfacePtr create()
Definition: base-protocol.h:156
Base class for D-Bus services.
Definition: dbus-service.h:46
Callback2< QString, const QString &, DBusError * > NormalizeContactCallback
Definition: base-protocol.h:110
The PresenceSpecList class represents a list of PresenceSpec.
Definition: presence.h:125
Base class for implementations of Protocol.Interface.Avatars.
Definition: base-protocol.h:198
Base class for protocol implementations.
Definition: base-protocol.h:47
Small container class, containing a D-Bus error.
Definition: dbus-error.h:35
static SharedPtr< BaseProtocolAvatarsInterfaceSubclass > create()
Definition: base-protocol.h:209
static BaseProtocolPresenceInterfacePtr create()
Definition: base-protocol.h:241
Base class for D-Bus service interfaces.
Definition: dbus-service.h:73
Callback2< QString, const QVariantMap &, DBusError * > IdentifyAccountCallback
Definition: base-protocol.h:106
Base class for implementations of Protocol.Interface.Addressing.
Definition: base-protocol.h:150
Base class for all the Protocol object interface implementations.
Definition: base-protocol.h:133
The SharedPtr class is a pointer to an explicitly shared object.
Definition: shared-ptr.h:39
The RequestableChannelClassSpecList class represents a list of RequestableChannelClassSpec.
Definition: requestable-channel-class-spec.h:101
static SharedPtr< BaseProtocolSubclass > create(const QDBusConnection &dbusConnection, const QString &name)
Definition: base-protocol.h:68
Callback3< QString, const QString &, const QString &, DBusError * > NormalizeVCardAddressCallback
Definition: base-protocol.h:177
Callback2< BaseConnectionPtr, const QVariantMap &, DBusError * > CreateConnectionCallback
Definition: base-protocol.h:102
The AvatarSpec class represents a Telepathy avatar information supported by a protocol.
Definition: avatar.h:51
static SharedPtr< BaseProtocolSubclass > create(const QString &name)
Definition: base-protocol.h:58
static SharedPtr< BaseProtocolPresenceInterfaceSubclass > create()
Definition: base-protocol.h:246
static BaseProtocolPtr create(const QString &name)
Definition: base-protocol.h:53
Base class for connection manager implementations.
Definition: base-connection-manager.h:41