22 #ifndef _TelepathyQt_base_channel_h_HEADER_GUARD_
23 #define _TelepathyQt_base_channel_h_HEADER_GUARD_
25 #ifndef IN_TP_QT_HEADER
26 #error IN_TP_QT_HEADER
29 #include <TelepathyQt/DBusService>
30 #include <TelepathyQt/Global>
31 #include <TelepathyQt/Types>
32 #include <TelepathyQt/Callbacks>
33 #include <TelepathyQt/Constants>
35 #include <QDBusConnection>
50 return BaseChannelPtr(
new BaseChannel(QDBusConnection::sessionBus(), connection,
51 channelType, targetHandle, targetHandleType));
61 QList<AbstractChannelInterfacePtr>
interfaces()
const;
62 AbstractChannelInterfacePtr
interface(
const QString &interfaceName)
const;
108 friend class Private;
121 template<
typename BaseChannelTextTypeSub
class>
124 new BaseChannelTextTypeSubclass(channel));
135 QVariantMap immutableProperties()
const;
147 void sent(uint timestamp, uint type, QString text);
153 void createAdaptor();
156 friend class Adaptee;
158 friend struct Private;
169 QStringList supportedContentTypes,
171 uint messagePartSupportFlags,
172 uint deliveryReportingSupport) {
174 supportedContentTypes,
176 messagePartSupportFlags,
177 deliveryReportingSupport));
179 template<
typename BaseChannelMessagesInterfaceSub
class>
182 new BaseChannelMessagesInterfaceSubclass());
186 QVariantMap immutableProperties()
const;
188 QStringList supportedContentTypes();
190 uint messagePartSupportFlags();
191 uint deliveryReportingSupport();
194 void messageSent(
const Tp::MessagePartList &content, uint flags,
const QString &messageToken);
201 void pendingMessagesRemoved(
const Tp::UIntList &messageIDs);
205 QStringList supportedContentTypes,
207 uint messagePartSupportFlags,
208 uint deliveryReportingSupport);
209 void createAdaptor();
212 friend class Adaptee;
214 friend struct Private;
224 static BaseChannelServerAuthenticationTypePtr
create(
const QString &authenticationMethod) {
227 template<
typename BaseChannelServerAuthenticationTypeSub
class>
230 new BaseChannelServerAuthenticationTypeSubclass(authenticationMethod));
234 QVariantMap immutableProperties()
const;
238 void createAdaptor();
241 friend class Adaptee;
243 friend struct Private;
253 static BaseChannelCaptchaAuthenticationInterfacePtr
create(
bool canRetryCaptcha) {
256 template<
typename BaseChannelCaptchaAuthenticationInterfaceSub
class>
259 new BaseChannelCaptchaAuthenticationInterfaceSubclass(canRetryCaptcha));
263 QVariantMap immutableProperties()
const;
277 void setCaptchaStatus(uint status);
278 void setCaptchaError(
const QString &busName);
279 void setCaptchaErrorDetails(
const QVariantMap &error);
283 void createAdaptor();
286 friend class Adaptee;
288 friend struct Private;
298 static BaseChannelSASLAuthenticationInterfacePtr
create(
const QStringList &availableMechanisms,
301 const QString &authorizationIdentity,
302 const QString &defaultUsername,
303 const QString &defaultRealm,
304 bool maySaveResponse)
309 authorizationIdentity,
314 template<
typename BaseChannelSASLAuthenticationInterfaceSub
class>
318 const QString &authorizationIdentity,
319 const QString &defaultUsername,
320 const QString &defaultRealm,
321 bool maySaveResponse)
324 new BaseChannelSASLAuthenticationInterfaceSubclass(availableMechanisms,
327 authorizationIdentity,
335 QVariantMap immutableProperties()
const;
337 QStringList availableMechanisms()
const;
338 bool hasInitialData()
const;
339 bool canTryAgain()
const;
340 QString authorizationIdentity()
const;
341 QString defaultUsername()
const;
342 QString defaultRealm()
const;
343 bool maySaveResponse()
const;
345 uint saslStatus()
const;
346 void setSaslStatus(uint status,
const QString &reason,
const QVariantMap &details);
348 QString saslError()
const;
349 void setSaslError(
const QString &saslError);
351 QVariantMap saslErrorDetails()
const;
352 void setSaslErrorDetails(
const QVariantMap &saslErrorDetails);
356 void startMechanism(
const QString &mechanism,
DBusError *error);
360 void startMechanismWithData(
const QString &mechanism,
const QByteArray &initialData,
DBusError *error);
364 void respond(
const QByteArray &responseData,
DBusError *error);
372 void abortSasl(uint reason,
const QString &debugMessage,
DBusError *error);
374 void newChallenge(
const QByteArray &challengeData);
380 const QString &authorizationIdentity,
381 const QString &defaultUsername,
382 const QString &defaultRealm,
383 bool maySaveResponse);
386 void createAdaptor();
389 friend class Adaptee;
391 friend struct Private;
401 static BaseChannelSecurableInterfacePtr
create()
405 template<
typename BaseChannelSecurableInterfaceSub
class>
409 new BaseChannelSecurableInterfaceSubclass());
414 QVariantMap immutableProperties()
const;
416 bool encrypted()
const;
417 void setEncrypted(
bool encrypted);
419 bool verified()
const;
420 void setVerified(
bool verified);
426 void createAdaptor();
429 friend class Adaptee;
431 friend struct Private;
441 static BaseChannelChatStateInterfacePtr
create()
445 template<
typename BaseChannelChatStateInterfaceSub
class>
449 new BaseChannelChatStateInterfaceSubclass());
454 QVariantMap immutableProperties()
const;
461 void setChatState(uint state,
DBusError *error);
463 void chatStateChanged(uint contact, uint state);
469 void createAdaptor();
472 friend class Adaptee;
474 friend struct Private;
487 template<
typename BaseChannelGroupInterfaceSub
class>
490 new BaseChannelGroupInterfaceSubclass(initialFlags, selfHandle));
494 QVariantMap immutableProperties()
const;
503 void addMembers(
const Tp::UIntList &handles,
const QStringList &identifiers);
509 void createAdaptor();
512 friend class Adaptee;
514 friend struct Private;
Base class for implementations of Channel.Interface.CaptchaAuthentication.
Definition: base-channel.h:247
static SharedPtr< BaseChannelSecurableInterfaceSubclass > create()
Definition: base-channel.h:406
void setInitiatorID(const QString &initiatorID)
Definition: base-channel.cpp:223
Callback2< QDBusObjectPath, const QVariantMap &, DBusError * > CreateChannelCallback
Definition: base-channel.h:127
Callback3< void, const QString &, const QByteArray &, DBusError * > StartMechanismWithDataCallback
Definition: base-channel.h:358
Base class for Connection implementations.
Definition: base-connection.h:43
void setRequested(bool requested)
Definition: base-channel.cpp:233
Definition: buildqt4/TelepathyQt/_gen/types.h:752
static SharedPtr< BaseChannelMessagesInterfaceSubclass > create()
Definition: base-channel.h:180
Callback2< void, const QByteArray &, DBusError * > RespondCallback
Definition: base-channel.h:362
BaseChannel(const QDBusConnection &dbusConnection, BaseConnection *connection, const QString &channelType, uint targetHandle, uint targetHandleType)
Definition: base-channel.cpp:118
bool plugInterface(const AbstractChannelInterfacePtr &interface)
Definition: base-channel.cpp:314
QVariantMap immutableProperties() const
Definition: base-channel.cpp:253
QList< MessagePart > MessagePartList
Definition: buildqt4/TelepathyQt/_gen/types.h:2031
Callback2< bool, const QVariantMap &, DBusError * > EnsureChannelCallback
Definition: base-channel.h:130
CreateChannelCallback createChannel
Definition: base-channel.h:128
Callback2< void, uint, DBusError * > SetChatStateCallback
Definition: base-channel.h:459
static BaseChannelSecurableInterfacePtr create()
Definition: base-channel.h:401
Base class for D-Bus services.
Definition: dbus-service.h:46
Definition: buildqt4/TelepathyQt/_gen/types.h:101
static SharedPtr< BaseChannelTextTypeSubclass > create(BaseChannel *channel)
Definition: base-channel.h:122
Base class for implementations of Channel.Interface.Messages.
Definition: base-channel.h:162
Callback1< void, DBusError * > AcceptSASLCallback
Definition: base-channel.h:366
QDBusConnection dbusConnection() const
Definition: dbus-service.cpp:88
uint targetHandle() const
Definition: base-channel.cpp:193
Callback3< void, const Tp::UIntList &, const QString &, DBusError * > AddMembersCallback
Definition: base-channel.h:499
Base class for implementations of Channel.Type.ServerAuthentifcation.
Definition: base-channel.h:218
static SharedPtr< BaseChannelServerAuthenticationTypeSubclass > create(const QString &authenticationMethod)
Definition: base-channel.h:228
virtual QString uniqueName() const
Definition: base-channel.cpp:141
QString objectPath() const
Definition: dbus-service.cpp:114
static BaseChannelSASLAuthenticationInterfacePtr create(const QStringList &availableMechanisms, bool hasInitialData, bool canTryAgain, const QString &authorizationIdentity, const QString &defaultUsername, const QString &defaultRealm, bool maySaveResponse)
Definition: base-channel.h:298
Callback1< void, QString > MessageAcknowledgedCallback
Definition: base-channel.h:139
virtual ~BaseChannel()
Definition: base-channel.cpp:131
Callback2< void, const QString &, DBusError * > StartMechanismCallback
Definition: base-channel.h:354
QList< AbstractChannelInterfacePtr > interfaces() const
Definition: base-channel.cpp:189
uint initiatorHandle() const
Definition: base-channel.cpp:209
Callback3< void, const Tp::UIntList &, const QString &, DBusError * > RemoveMembersCallback
Definition: base-channel.h:496
QString busName() const
Definition: dbus-service.cpp:101
static BaseChannelMessagesInterfacePtr create(BaseChannelTextType *textTypeInterface, QStringList supportedContentTypes, UIntList messageTypes, uint messagePartSupportFlags, uint deliveryReportingSupport)
Definition: base-channel.h:168
Callback3< void, uint, const QString &, DBusError * > CancelCaptchaCallback
Definition: base-channel.h:274
Base class for implementations of Channel.Interface.Group.
Definition: base-channel.h:478
Tp::ChannelDetails details() const
Definition: base-channel.cpp:275
Base class for implementations of Channel.Type.Text.
Definition: base-channel.h:112
static SharedPtr< BaseChannelSASLAuthenticationInterfaceSubclass > create(const QStringList &availableMechanisms, bool hasInitialData, bool canTryAgain, const QString &authorizationIdentity, const QString &defaultUsername, const QString &defaultRealm, bool maySaveResponse)
Definition: base-channel.h:315
static BaseChannelCaptchaAuthenticationInterfacePtr create(bool canRetryCaptcha)
Definition: base-channel.h:253
Callback2< void, const Tp::CaptchaAnswers &, DBusError * > AnswerCaptchasCallback
Definition: base-channel.h:271
Small container class, containing a D-Bus error.
Definition: dbus-error.h:35
Definition: buildqt4/TelepathyQt/_gen/types.h:907
EnsureChannelCallback ensureChannel
Definition: base-channel.h:131
static BaseChannelServerAuthenticationTypePtr create(const QString &authenticationMethod)
Definition: base-channel.h:224
void setTargetID(const QString &targetID)
Definition: base-channel.cpp:228
QString channelType() const
Definition: base-channel.cpp:185
Base class for D-Bus service interfaces.
Definition: dbus-service.h:73
friend class Adaptee
Definition: base-channel.h:88
Callback3< void, uint, const QString &, DBusError * > AbortSASLCallback
Definition: base-channel.h:370
QFlags< ChannelGroupFlag > ChannelGroupFlags
Definition: buildqt4/TelepathyQt/_gen/constants.h:1043
QList< MessagePartList > MessagePartListList
Definition: buildqt4/TelepathyQt/_gen/types.h:2039
Base class for implementations of Channel.Interface.Securable.
Definition: base-channel.h:395
friend class Private
Definition: base-channel.h:90
The SharedPtr class is a pointer to an explicitly shared object.
Definition: shared-ptr.h:39
Tp::RequestableChannelClassList requestableChannelClasses
Definition: base-channel.h:137
static BaseChannelTextTypePtr create(BaseChannel *channel)
Definition: base-channel.h:118
Base class for all the Channel object interface implementations.
Definition: base-channel.h:95
static BaseChannelPtr create(BaseConnection *connection, const QString &channelType, uint targetHandle, uint targetHandleType)
Definition: base-channel.h:48
Base class for implementations of Channel.Interface.Chat.State.
Definition: base-channel.h:435
static SharedPtr< BaseChannelChatStateInterfaceSubclass > create()
Definition: base-channel.h:446
void setInitiatorHandle(uint initiatorHandle)
Definition: base-channel.cpp:218
Base class for channel implementations.
Definition: base-channel.h:42
void close()
Definition: base-channel.cpp:238
uint targetHandleType() const
Definition: base-channel.cpp:201
AbstractChannelInterfacePtr interface(const QString &interfaceName) const
Definition: base-channel.cpp:298
bool registerObject(DBusError *error=NULL)
Definition: base-channel.cpp:146
bool requested() const
Definition: base-channel.cpp:205
QList< RequestableChannelClass > RequestableChannelClassList
Definition: buildqt4/TelepathyQt/_gen/types.h:2621
Callback4< void, Tp::CaptchaInfoList &, uint &, QString &, DBusError * > GetCaptchasCallback
Definition: base-channel.h:265
Base class for implementations of Channel.Interface.SASLAuthentication.
Definition: base-channel.h:292
QString targetID() const
Definition: base-channel.cpp:197
Callback3< QByteArray, uint, const QString &, DBusError * > GetCaptchaDataCallback
Definition: base-channel.h:268
static BaseChannelGroupInterfacePtr create(ChannelGroupFlags initialFlags, uint selfHandle)
Definition: base-channel.h:484
QString initiatorID() const
Definition: base-channel.cpp:213
static BaseChannelChatStateInterfacePtr create()
Definition: base-channel.h:441
static SharedPtr< BaseChannelGroupInterfaceSubclass > create(ChannelGroupFlags initialFlags, uint selfHandle)
Definition: base-channel.h:488
static SharedPtr< BaseChannelCaptchaAuthenticationInterfaceSubclass > create(bool canRetryCaptcha)
Definition: base-channel.h:257
Callback3< QString, const Tp::MessagePartList &, uint, DBusError * > SendMessageCallback
Definition: base-channel.h:196