Home · All Classes · All Namespaces · Modules · Functions · Files
base-channel.h
00001 
00022 #ifndef _TelepathyQt_base_channel_h_HEADER_GUARD_
00023 #define _TelepathyQt_base_channel_h_HEADER_GUARD_
00024 
00025 #ifndef IN_TP_QT_HEADER
00026 #error IN_TP_QT_HEADER
00027 #endif
00028 
00029 #include <TelepathyQt/DBusService>
00030 #include <TelepathyQt/Global>
00031 #include <TelepathyQt/Types>
00032 #include <TelepathyQt/Callbacks>
00033 #include <TelepathyQt/Constants>
00034 
00035 #include <QDBusConnection>
00036 
00037 class QString;
00038 
00039 namespace Tp
00040 {
00041 
00042 class TP_QT_EXPORT BaseChannel : public DBusService
00043 {
00044     Q_OBJECT
00045     Q_DISABLE_COPY(BaseChannel)
00046 
00047 public:
00048     static BaseChannelPtr create(BaseConnection *connection, const QString &channelType,
00049                                  Tp::HandleType targetHandleType = Tp::HandleTypeNone, uint targetHandle = 0) {
00050         return BaseChannelPtr(new BaseChannel(QDBusConnection::sessionBus(), connection,
00051                                               channelType, targetHandleType, targetHandle));
00052     }
00053 
00054     virtual ~BaseChannel();
00055 
00056     QVariantMap immutableProperties() const;
00057     bool registerObject(DBusError *error = NULL);
00058     virtual QString uniqueName() const;
00059 
00060     QString channelType() const;
00061     QList<AbstractChannelInterfacePtr> interfaces() const;
00062     AbstractChannelInterfacePtr interface(const QString &interfaceName) const;
00063     uint targetHandle() const;
00064     QString targetID() const;
00065     uint targetHandleType() const;
00066     bool requested() const;
00067     uint initiatorHandle() const;
00068     QString initiatorID() const;
00069     Tp::ChannelDetails details() const;
00070 
00071     void setInitiatorHandle(uint initiatorHandle);
00072     void setInitiatorID(const QString &initiatorID);
00073     void setTargetID(const QString &targetID);
00074     void setRequested(bool requested);
00075 
00076     void close();
00077 
00078     bool plugInterface(const AbstractChannelInterfacePtr &interface);
00079 
00080 Q_SIGNALS:
00081     void closed();
00082 protected:
00083     BaseChannel(const QDBusConnection &dbusConnection, BaseConnection *connection,
00084                 const QString &channelType, uint targetHandleType, uint targetHandle);
00085     virtual bool registerObject(const QString &busName, const QString &objectPath,
00086                                 DBusError *error);
00087 private:
00088     class Adaptee;
00089     friend class Adaptee;
00090     struct Private;
00091     friend struct Private;
00092     Private *mPriv;
00093 };
00094 
00095 class TP_QT_EXPORT AbstractChannelInterface : public AbstractDBusServiceInterface
00096 {
00097     Q_OBJECT
00098     Q_DISABLE_COPY(AbstractChannelInterface)
00099 
00100 public:
00101     AbstractChannelInterface(const QString &interfaceName);
00102     virtual ~AbstractChannelInterface();
00103 
00104 private:
00105     friend class BaseChannel;
00106 
00107     struct Private;
00108     friend struct Private;
00109     Private *mPriv;
00110 
00111 };
00112 
00113 class TP_QT_EXPORT BaseChannelTextType : public AbstractChannelInterface
00114 {
00115     Q_OBJECT
00116     Q_DISABLE_COPY(BaseChannelTextType)
00117 
00118 public:
00119     static BaseChannelTextTypePtr create(BaseChannel* channel) {
00120         return BaseChannelTextTypePtr(new BaseChannelTextType(channel));
00121     }
00122     template<typename BaseChannelTextTypeSubclass>
00123     static SharedPtr<BaseChannelTextTypeSubclass> create(BaseChannel* channel) {
00124         return SharedPtr<BaseChannelTextTypeSubclass>(
00125                    new BaseChannelTextTypeSubclass(channel));
00126     }
00127 
00128     typedef Callback2<QDBusObjectPath, const QVariantMap&, DBusError*> CreateChannelCallback;
00129     CreateChannelCallback createChannel;
00130 
00131     typedef Callback2<bool, const QVariantMap&, DBusError*> EnsureChannelCallback;
00132     EnsureChannelCallback ensureChannel;
00133 
00134     virtual ~BaseChannelTextType();
00135 
00136     QVariantMap immutableProperties() const;
00137 
00138     Tp::RequestableChannelClassList requestableChannelClasses;
00139 
00140     typedef Callback1<void, QString> MessageAcknowledgedCallback;
00141     void setMessageAcknowledgedCallback(const MessageAcknowledgedCallback &cb);
00142 
00143     Tp::MessagePartListList pendingMessages();
00144 
00145     /* Convenience function */
00146     void addReceivedMessage(const Tp::MessagePartList &message);
00147 private Q_SLOTS:
00148     void sent(uint timestamp, uint type, QString text);
00149 protected:
00150     BaseChannelTextType(BaseChannel* channel);
00151     void acknowledgePendingMessages(const Tp::UIntList &IDs, DBusError* error);
00152 
00153 private:
00154     void createAdaptor();
00155 
00156     class Adaptee;
00157     friend class Adaptee;
00158     struct Private;
00159     friend struct Private;
00160     Private *mPriv;
00161 };
00162 
00163 class TP_QT_EXPORT BaseChannelMessagesInterface : public AbstractChannelInterface
00164 {
00165     Q_OBJECT
00166     Q_DISABLE_COPY(BaseChannelMessagesInterface)
00167 
00168 public:
00169     static BaseChannelMessagesInterfacePtr create(BaseChannelTextType* textTypeInterface,
00170             QStringList supportedContentTypes,
00171             UIntList messageTypes,
00172             uint messagePartSupportFlags,
00173             uint deliveryReportingSupport) {
00174         return BaseChannelMessagesInterfacePtr(new BaseChannelMessagesInterface(textTypeInterface,
00175                                                supportedContentTypes,
00176                                                messageTypes,
00177                                                messagePartSupportFlags,
00178                                                deliveryReportingSupport));
00179     }
00180     template<typename BaseChannelMessagesInterfaceSubclass>
00181     static SharedPtr<BaseChannelMessagesInterfaceSubclass> create() {
00182         return SharedPtr<BaseChannelMessagesInterfaceSubclass>(
00183                    new BaseChannelMessagesInterfaceSubclass());
00184     }
00185     virtual ~BaseChannelMessagesInterface();
00186 
00187     QVariantMap immutableProperties() const;
00188 
00189     QStringList supportedContentTypes();
00190     Tp::UIntList messageTypes();
00191     uint messagePartSupportFlags();
00192     uint deliveryReportingSupport();
00193     Tp::MessagePartListList pendingMessages();
00194 
00195     void messageSent(const Tp::MessagePartList &content, uint flags, const QString &messageToken);
00196 
00197     typedef Callback3<QString, const Tp::MessagePartList&, uint, DBusError*> SendMessageCallback;
00198     void setSendMessageCallback(const SendMessageCallback &cb);
00199 protected:
00200     QString sendMessage(const Tp::MessagePartList &message, uint flags, DBusError* error);
00201 private Q_SLOTS:
00202     void pendingMessagesRemoved(const Tp::UIntList &messageIDs);
00203     void messageReceived(const Tp::MessagePartList &message);
00204 private:
00205     BaseChannelMessagesInterface(BaseChannelTextType* textType,
00206                                  QStringList supportedContentTypes,
00207                                  Tp::UIntList messageTypes,
00208                                  uint messagePartSupportFlags,
00209                                  uint deliveryReportingSupport);
00210     void createAdaptor();
00211 
00212     class Adaptee;
00213     friend class Adaptee;
00214     struct Private;
00215     friend struct Private;
00216     Private *mPriv;
00217 };
00218 
00219 class TP_QT_EXPORT BaseChannelRoomListType : public AbstractChannelInterface
00220 {
00221     Q_OBJECT
00222     Q_DISABLE_COPY(BaseChannelRoomListType)
00223 
00224 public:
00225     static BaseChannelRoomListTypePtr create(const QString &server = QString())
00226     {
00227         return BaseChannelRoomListTypePtr(new BaseChannelRoomListType(server));
00228     }
00229     template<typename BaseChannelRoomListTypeSubclass>
00230     static SharedPtr<BaseChannelRoomListTypeSubclass> create(const QString &server = QString())
00231     {
00232         return SharedPtr<BaseChannelRoomListTypeSubclass>(
00233                 new BaseChannelRoomListTypeSubclass(server));
00234     }
00235 
00236     virtual ~BaseChannelRoomListType();
00237 
00238     QVariantMap immutableProperties() const;
00239 
00240     QString server() const;
00241 
00242     bool getListingRooms();
00243     void setListingRooms(bool listing);
00244 
00245     typedef Callback1<void, DBusError*> ListRoomsCallback;
00246     void setListRoomsCallback(const ListRoomsCallback &cb);
00247     void listRooms(DBusError *error);
00248 
00249     typedef Callback1<void, DBusError*> StopListingCallback;
00250     void setStopListingCallback(const StopListingCallback &cb);
00251     void stopListing(DBusError *error);
00252 
00253     void gotRooms(const Tp::RoomInfoList &rooms);
00254 
00255 protected:
00256     BaseChannelRoomListType(const QString &server);
00257 
00258 private:
00259     void createAdaptor();
00260 
00261     class Adaptee;
00262     friend class Adaptee;
00263     struct Private;
00264     friend struct Private;
00265     Private *mPriv;
00266 };
00267 
00268 class TP_QT_EXPORT BaseChannelServerAuthenticationType : public AbstractChannelInterface
00269 {
00270     Q_OBJECT
00271     Q_DISABLE_COPY(BaseChannelServerAuthenticationType)
00272 
00273 public:
00274     static BaseChannelServerAuthenticationTypePtr create(const QString &authenticationMethod) {
00275         return BaseChannelServerAuthenticationTypePtr(new BaseChannelServerAuthenticationType(authenticationMethod));
00276     }
00277     template<typename BaseChannelServerAuthenticationTypeSubclass>
00278     static SharedPtr<BaseChannelServerAuthenticationTypeSubclass> create(const QString &authenticationMethod) {
00279         return SharedPtr<BaseChannelServerAuthenticationTypeSubclass>(
00280                    new BaseChannelServerAuthenticationTypeSubclass(authenticationMethod));
00281     }
00282     virtual ~BaseChannelServerAuthenticationType();
00283 
00284     QVariantMap immutableProperties() const;
00285 private Q_SLOTS:
00286 private:
00287     BaseChannelServerAuthenticationType(const QString &authenticationMethod);
00288     void createAdaptor();
00289 
00290     class Adaptee;
00291     friend class Adaptee;
00292     struct Private;
00293     friend struct Private;
00294     Private *mPriv;
00295 };
00296 
00297 class TP_QT_EXPORT BaseChannelCaptchaAuthenticationInterface : public AbstractChannelInterface
00298 {
00299     Q_OBJECT
00300     Q_DISABLE_COPY(BaseChannelCaptchaAuthenticationInterface)
00301 
00302 public:
00303     static BaseChannelCaptchaAuthenticationInterfacePtr create(bool canRetryCaptcha) {
00304         return BaseChannelCaptchaAuthenticationInterfacePtr(new BaseChannelCaptchaAuthenticationInterface(canRetryCaptcha));
00305     }
00306     template<typename BaseChannelCaptchaAuthenticationInterfaceSubclass>
00307     static SharedPtr<BaseChannelCaptchaAuthenticationInterfaceSubclass> create(bool canRetryCaptcha) {
00308         return SharedPtr<BaseChannelCaptchaAuthenticationInterfaceSubclass>(
00309                    new BaseChannelCaptchaAuthenticationInterfaceSubclass(canRetryCaptcha));
00310     }
00311     virtual ~BaseChannelCaptchaAuthenticationInterface();
00312 
00313     QVariantMap immutableProperties() const;
00314 
00315     typedef Callback4<void, Tp::CaptchaInfoList&, uint&, QString&, DBusError*> GetCaptchasCallback;
00316     void setGetCaptchasCallback(const GetCaptchasCallback &cb);
00317 
00318     typedef Callback3<QByteArray, uint, const QString&, DBusError*> GetCaptchaDataCallback;
00319     void setGetCaptchaDataCallback(const GetCaptchaDataCallback &cb);
00320 
00321     typedef Callback2<void, const Tp::CaptchaAnswers&, DBusError*> AnswerCaptchasCallback;
00322     void setAnswerCaptchasCallback(const AnswerCaptchasCallback &cb);
00323 
00324     typedef Callback3<void, uint, const QString&, DBusError*> CancelCaptchaCallback;
00325     void setCancelCaptchaCallback(const CancelCaptchaCallback &cb);
00326 
00327     void setCaptchaStatus(uint status);
00328     void setCaptchaError(const QString &busName);
00329     void setCaptchaErrorDetails(const QVariantMap &error);
00330 private Q_SLOTS:
00331 private:
00332     BaseChannelCaptchaAuthenticationInterface(bool canRetryCaptcha);
00333     void createAdaptor();
00334 
00335     class Adaptee;
00336     friend class Adaptee;
00337     struct Private;
00338     friend struct Private;
00339     Private *mPriv;
00340 };
00341 
00342 class TP_QT_EXPORT BaseChannelSASLAuthenticationInterface : public AbstractChannelInterface
00343 {
00344     Q_OBJECT
00345     Q_DISABLE_COPY(BaseChannelSASLAuthenticationInterface)
00346 
00347 public:
00348     static BaseChannelSASLAuthenticationInterfacePtr create(const QStringList &availableMechanisms,
00349                                                             bool hasInitialData,
00350                                                             bool canTryAgain,
00351                                                             const QString &authorizationIdentity,
00352                                                             const QString &defaultUsername,
00353                                                             const QString &defaultRealm,
00354                                                             bool maySaveResponse)
00355     {
00356         return BaseChannelSASLAuthenticationInterfacePtr(new BaseChannelSASLAuthenticationInterface(availableMechanisms,
00357                                                                                                     hasInitialData,
00358                                                                                                     canTryAgain,
00359                                                                                                     authorizationIdentity,
00360                                                                                                     defaultUsername,
00361                                                                                                     defaultRealm,
00362                                                                                                     maySaveResponse));
00363     }
00364     template<typename BaseChannelSASLAuthenticationInterfaceSubclass>
00365     static SharedPtr<BaseChannelSASLAuthenticationInterfaceSubclass> create(const QStringList &availableMechanisms,
00366                                                                             bool hasInitialData,
00367                                                                             bool canTryAgain,
00368                                                                             const QString &authorizationIdentity,
00369                                                                             const QString &defaultUsername,
00370                                                                             const QString &defaultRealm,
00371                                                                             bool maySaveResponse)
00372     {
00373         return SharedPtr<BaseChannelSASLAuthenticationInterfaceSubclass>(
00374                 new BaseChannelSASLAuthenticationInterfaceSubclass(availableMechanisms,
00375                                                                    hasInitialData,
00376                                                                    canTryAgain,
00377                                                                    authorizationIdentity,
00378                                                                    defaultUsername,
00379                                                                    defaultRealm,
00380                                                                    maySaveResponse));
00381     }
00382 
00383     virtual ~BaseChannelSASLAuthenticationInterface();
00384 
00385     QVariantMap immutableProperties() const;
00386 
00387     QStringList availableMechanisms() const;
00388     bool hasInitialData() const;
00389     bool canTryAgain() const;
00390     QString authorizationIdentity() const;
00391     QString defaultUsername() const;
00392     QString defaultRealm() const;
00393     bool maySaveResponse() const;
00394 
00395     uint saslStatus() const;
00396     void setSaslStatus(uint status, const QString &reason, const QVariantMap &details);
00397 
00398     QString saslError() const;
00399     void setSaslError(const QString &saslError);
00400 
00401     QVariantMap saslErrorDetails() const;
00402     void setSaslErrorDetails(const QVariantMap &saslErrorDetails);
00403 
00404     typedef Callback2<void, const QString &, DBusError*> StartMechanismCallback;
00405     void setStartMechanismCallback(const StartMechanismCallback &cb);
00406     void startMechanism(const QString &mechanism, DBusError *error);
00407 
00408     typedef Callback3<void, const QString &, const QByteArray &, DBusError*> StartMechanismWithDataCallback;
00409     void setStartMechanismWithDataCallback(const StartMechanismWithDataCallback &cb);
00410     void startMechanismWithData(const QString &mechanism, const QByteArray &initialData, DBusError *error);
00411 
00412     typedef Callback2<void, const QByteArray &, DBusError*> RespondCallback;
00413     void setRespondCallback(const RespondCallback &cb);
00414     void respond(const QByteArray &responseData, DBusError *error);
00415 
00416     typedef Callback1<void, DBusError*> AcceptSASLCallback;
00417     void setAcceptSaslCallback(const AcceptSASLCallback &cb);
00418     void acceptSasl(DBusError *error);
00419 
00420     typedef Callback3<void, uint, const QString &, DBusError*> AbortSASLCallback;
00421     void setAbortSaslCallback(const AbortSASLCallback &cb);
00422     void abortSasl(uint reason, const QString &debugMessage, DBusError *error);
00423 
00424     void newChallenge(const QByteArray &challengeData);
00425 
00426 protected:
00427     BaseChannelSASLAuthenticationInterface(const QStringList &availableMechanisms,
00428                                            bool hasInitialData,
00429                                            bool canTryAgain,
00430                                            const QString &authorizationIdentity,
00431                                            const QString &defaultUsername,
00432                                            const QString &defaultRealm,
00433                                            bool maySaveResponse);
00434 
00435 private:
00436     void createAdaptor();
00437 
00438     class Adaptee;
00439     friend class Adaptee;
00440     struct Private;
00441     friend struct Private;
00442     Private *mPriv;
00443 };
00444 
00445 class TP_QT_EXPORT BaseChannelSecurableInterface : public AbstractChannelInterface
00446 {
00447     Q_OBJECT
00448     Q_DISABLE_COPY(BaseChannelSecurableInterface)
00449 
00450 public:
00451     static BaseChannelSecurableInterfacePtr create()
00452     {
00453         return BaseChannelSecurableInterfacePtr(new BaseChannelSecurableInterface());
00454     }
00455     template<typename BaseChannelSecurableInterfaceSubclass>
00456     static SharedPtr<BaseChannelSecurableInterfaceSubclass> create()
00457     {
00458         return SharedPtr<BaseChannelSecurableInterfaceSubclass>(
00459                 new BaseChannelSecurableInterfaceSubclass());
00460     }
00461 
00462     virtual ~BaseChannelSecurableInterface();
00463 
00464     QVariantMap immutableProperties() const;
00465 
00466     bool encrypted() const;
00467     void setEncrypted(bool encrypted);
00468 
00469     bool verified() const;
00470     void setVerified(bool verified);
00471 
00472 protected:
00473     BaseChannelSecurableInterface();
00474 
00475 private:
00476     void createAdaptor();
00477 
00478     class Adaptee;
00479     friend class Adaptee;
00480     struct Private;
00481     friend struct Private;
00482     Private *mPriv;
00483 };
00484 
00485 class TP_QT_EXPORT BaseChannelChatStateInterface : public AbstractChannelInterface
00486 {
00487     Q_OBJECT
00488     Q_DISABLE_COPY(BaseChannelChatStateInterface)
00489 
00490 public:
00491     static BaseChannelChatStateInterfacePtr create()
00492     {
00493         return BaseChannelChatStateInterfacePtr(new BaseChannelChatStateInterface());
00494     }
00495     template<typename BaseChannelChatStateInterfaceSubclass>
00496     static SharedPtr<BaseChannelChatStateInterfaceSubclass> create()
00497     {
00498         return SharedPtr<BaseChannelChatStateInterfaceSubclass>(
00499                 new BaseChannelChatStateInterfaceSubclass());
00500     }
00501 
00502     virtual ~BaseChannelChatStateInterface();
00503 
00504     QVariantMap immutableProperties() const;
00505 
00506     Tp::ChatStateMap chatStates() const;
00507     void setChatStates(const Tp::ChatStateMap &chatStates);
00508 
00509     typedef Callback2<void, uint, DBusError*> SetChatStateCallback;
00510     void setSetChatStateCallback(const SetChatStateCallback &cb);
00511     void setChatState(uint state, DBusError *error);
00512 
00513     void chatStateChanged(uint contact, uint state);
00514 
00515 protected:
00516     BaseChannelChatStateInterface();
00517 
00518 private:
00519     void createAdaptor();
00520 
00521     class Adaptee;
00522     friend class Adaptee;
00523     struct Private;
00524     friend struct Private;
00525     Private *mPriv;
00526 };
00527 
00528 class TP_QT_EXPORT BaseChannelGroupInterface : public AbstractChannelInterface
00529 {
00530     Q_OBJECT
00531     Q_DISABLE_COPY(BaseChannelGroupInterface)
00532 
00533 public:
00534     static BaseChannelGroupInterfacePtr create(ChannelGroupFlags initialFlags, uint selfHandle) {
00535         return BaseChannelGroupInterfacePtr(new BaseChannelGroupInterface(initialFlags, selfHandle));
00536     }
00537     template<typename BaseChannelGroupInterfaceSubclass>
00538     static SharedPtr<BaseChannelGroupInterfaceSubclass> create(ChannelGroupFlags initialFlags, uint selfHandle) {
00539         return SharedPtr<BaseChannelGroupInterfaceSubclass>(
00540                    new BaseChannelGroupInterfaceSubclass(initialFlags, selfHandle));
00541     }
00542     virtual ~BaseChannelGroupInterface();
00543 
00544     QVariantMap immutableProperties() const;
00545 
00546     typedef Callback3<void, const Tp::UIntList&, const QString&, DBusError*> RemoveMembersCallback;
00547     void setRemoveMembersCallback(const RemoveMembersCallback &cb);
00548 
00549     typedef Callback3<void, const Tp::UIntList&, const QString&, DBusError*> AddMembersCallback;
00550     void setAddMembersCallback(const AddMembersCallback &cb);
00551 
00552     /* Adds a contact to this group. No-op if already in this group */
00553     void addMembers(const Tp::UIntList &handles, const QStringList &identifiers);
00554     void removeMembers(const Tp::UIntList &handles);
00555 
00556 private Q_SLOTS:
00557 private:
00558     BaseChannelGroupInterface(ChannelGroupFlags initialFlags, uint selfHandle);
00559     void createAdaptor();
00560 
00561     class Adaptee;
00562     friend class Adaptee;
00563     struct Private;
00564     friend struct Private;
00565     Private *mPriv;
00566 };
00567 
00568 class TP_QT_EXPORT BaseChannelRoomInterface : public AbstractChannelInterface
00569 {
00570     Q_OBJECT
00571     Q_DISABLE_COPY(BaseChannelRoomInterface)
00572 
00573 public:
00574     static BaseChannelRoomInterfacePtr create(const QString &roomName,
00575                                               const QString &server,
00576                                               const QString &creator,
00577                                               uint creatorHandle,
00578                                               const QDateTime &creationTimestamp)
00579     {
00580         return BaseChannelRoomInterfacePtr(new BaseChannelRoomInterface(roomName,
00581                                                                         server,
00582                                                                         creator,
00583                                                                         creatorHandle,
00584                                                                         creationTimestamp));
00585     }
00586     template<typename BaseChannelRoomInterfaceSubclass>
00587     static SharedPtr<BaseChannelRoomInterfaceSubclass> create(const QString &roomName,
00588                                                               const QString &server,
00589                                                               const QString &creator,
00590                                                               uint creatorHandle,
00591                                                               const QDateTime &creationTimestamp)
00592     {
00593         return SharedPtr<BaseChannelRoomInterfaceSubclass>(
00594                 new BaseChannelRoomInterfaceSubclass(roomName,
00595                                                      server,
00596                                                      creator,
00597                                                      creatorHandle,
00598                                                      creationTimestamp));
00599     }
00600 
00601     virtual ~BaseChannelRoomInterface();
00602 
00603     QVariantMap immutableProperties() const;
00604 
00605     QString roomName() const;
00606     QString server() const;
00607     QString creator() const;
00608     uint creatorHandle() const;
00609     QDateTime creationTimestamp() const;
00610 
00611 protected:
00612     BaseChannelRoomInterface(const QString &roomName,
00613                              const QString &server,
00614                              const QString &creator,
00615                              uint creatorHandle,
00616                              const QDateTime &creationTimestamp);
00617 
00618 private:
00619     void createAdaptor();
00620 
00621     class Adaptee;
00622     friend class Adaptee;
00623     struct Private;
00624     friend struct Private;
00625     Private *mPriv;
00626 };
00627 
00628 class TP_QT_EXPORT BaseChannelRoomConfigInterface : public AbstractChannelInterface
00629 {
00630     Q_OBJECT
00631     Q_DISABLE_COPY(BaseChannelRoomConfigInterface)
00632 
00633 public:
00634     static BaseChannelRoomConfigInterfacePtr create()
00635     {
00636         return BaseChannelRoomConfigInterfacePtr(new BaseChannelRoomConfigInterface());
00637     }
00638     template<typename BaseChannelRoomConfigInterfaceSubclass>
00639     static SharedPtr<BaseChannelRoomConfigInterfaceSubclass> create()
00640     {
00641         return SharedPtr<BaseChannelRoomConfigInterfaceSubclass>(
00642                 new BaseChannelRoomConfigInterfaceSubclass());
00643     }
00644 
00645     virtual ~BaseChannelRoomConfigInterface();
00646 
00647     QVariantMap immutableProperties() const;
00648 
00649     bool anonymous() const;
00650     void setAnonymous(bool anonymous);
00651 
00652     bool inviteOnly() const;
00653     void setInviteOnly(bool inviteOnly);
00654 
00655     uint limit() const;
00656     void setLimit(uint limit);
00657 
00658     bool moderated() const;
00659     void setModerated(bool moderated);
00660 
00661     QString title() const;
00662     void setTitle(const QString &title);
00663 
00664     QString description() const;
00665     void setDescription(const QString &description);
00666 
00667     bool persistent() const;
00668     void setPersistent(bool persistent);
00669 
00670     bool isPrivate() const;
00671     void setPrivate(bool newPrivate);
00672 
00673     bool passwordProtected() const;
00674     void setPasswordProtected(bool passwordProtected);
00675 
00676     QString password() const;
00677     void setPassword(const QString &password);
00678 
00679     QString passwordHint() const;
00680     void setPasswordHint(const QString &passwordHint);
00681 
00682     bool canUpdateConfiguration() const;
00683     void setCanUpdateConfiguration(bool canUpdateConfiguration);
00684 
00685     QStringList mutableProperties() const;
00686     void setMutableProperties(const QStringList &mutableProperties);
00687 
00688     bool configurationRetrieved() const;
00689     void setConfigurationRetrieved(bool configurationRetrieved);
00690 
00691     typedef Callback2<void, const QVariantMap &, DBusError*> UpdateConfigurationCallback;
00692     void setUpdateConfigurationCallback(const UpdateConfigurationCallback &cb);
00693     void updateConfiguration(const QVariantMap &properties, DBusError *error);
00694 
00695 protected:
00696     BaseChannelRoomConfigInterface();
00697 
00698 private:
00699     void createAdaptor();
00700 
00701     class Adaptee;
00702     friend class Adaptee;
00703     struct Private;
00704     friend struct Private;
00705     Private *mPriv;
00706 };
00707 
00708 class TP_QT_EXPORT BaseChannelCallType : public AbstractChannelInterface
00709 {
00710     Q_OBJECT
00711     Q_DISABLE_COPY(BaseChannelCallType)
00712 
00713 public:
00714     static BaseChannelCallTypePtr create(BaseChannel* channel, bool hardwareStreaming,
00715                                          uint initialTransport,
00716                                          bool initialAudio,
00717                                          bool initialVideo,
00718                                          QString initialAudioName,
00719                                          QString initialVideoName,
00720                                          bool mutableContents = false) {
00721         return BaseChannelCallTypePtr(new BaseChannelCallType(channel,
00722                                                               hardwareStreaming,
00723                                                               initialTransport,
00724                                                               initialAudio,
00725                                                               initialVideo,
00726                                                               initialAudioName,
00727                                                               initialVideoName,
00728                                                               mutableContents));
00729     }
00730     template<typename BaseChannelCallTypeSubclass>
00731     static SharedPtr<BaseChannelCallTypeSubclass> create(BaseChannel* channel, bool hardwareStreaming,
00732                                                          uint initialTransport,
00733                                                          bool initialAudio,
00734                                                          bool initialVideo,
00735                                                          QString initialAudioName,
00736                                                          QString initialVideoName,
00737                                                          bool mutableContents = false) {
00738         return SharedPtr<BaseChannelCallTypeSubclass>(
00739                    new BaseChannelCallTypeSubclass(channel,
00740                                                    hardwareStreaming,
00741                                                    initialTransport,
00742                                                    initialAudio,
00743                                                    initialVideo,
00744                                                    initialAudioName,
00745                                                    initialVideoName,
00746                                                    mutableContents));
00747     }
00748 
00749     typedef Callback2<QDBusObjectPath, const QVariantMap&, DBusError*> CreateChannelCallback;
00750     CreateChannelCallback createChannel;
00751 
00752     typedef Callback2<bool, const QVariantMap&, DBusError*> EnsureChannelCallback;
00753     EnsureChannelCallback ensureChannel;
00754 
00755     virtual ~BaseChannelCallType();
00756 
00757     QVariantMap immutableProperties() const;
00758 
00759     Tp::ObjectPathList contents();
00760     QVariantMap callStateDetails();
00761     uint callState();
00762     uint callFlags();
00763     Tp::CallStateReason callStateReason();
00764     bool hardwareStreaming();
00765     Tp::CallMemberMap callMembers();
00766     Tp::HandleIdentifierMap memberIdentifiers();
00767     uint initialTransport();
00768     bool initialAudio();
00769     bool initialVideo();
00770     QString initialAudioName();
00771     QString initialVideoName();
00772     bool mutableContents();
00773 
00774     typedef Callback1<void, DBusError*> AcceptCallback;
00775     void setAcceptCallback(const AcceptCallback &cb);
00776 
00777     typedef Callback4<void, uint, const QString &, const QString &, DBusError*> HangupCallback;
00778     void setHangupCallback(const HangupCallback &cb);
00779 
00780     typedef Callback1<void, DBusError*> SetRingingCallback;
00781     void setSetRingingCallback(const SetRingingCallback &cb);
00782 
00783     typedef Callback1<void, DBusError*> SetQueuedCallback;
00784     void setSetQueuedCallback(const SetQueuedCallback &cb);
00785 
00786     typedef Callback4<QDBusObjectPath, const QString&, const Tp::MediaStreamType&, const Tp::MediaStreamDirection&, DBusError*> AddContentCallback;
00787     void setAddContentCallback(const AddContentCallback &cb);
00788 
00789     void setCallState(const Tp::CallState &state, uint flags, const Tp::CallStateReason &stateReason, const QVariantMap &callStateDetails);
00790     void setMembersFlags(const Tp::CallMemberMap &flagsChanged, const Tp::HandleIdentifierMap &identifiers, const Tp::UIntList &removed, const Tp::CallStateReason &reason);
00791     BaseCallContentPtr addContent(const QString &name, const Tp::MediaStreamType &type, const Tp::MediaStreamDirection &direction);
00792     void addContent(BaseCallContentPtr content);
00793 
00794     Tp::RequestableChannelClassList requestableChannelClasses;
00795 
00796 protected:
00797     BaseChannelCallType(BaseChannel* channel,
00798                         bool hardwareStreaming,
00799                         uint initialTransport,
00800                         bool initialAudio,
00801                         bool initialVideo,
00802                         QString initialAudioName,
00803                         QString initialVideoName,
00804                         bool mutableContents = false);
00805 
00806 private:
00807     void createAdaptor();
00808 
00809     class Adaptee;
00810     friend class Adaptee;
00811     struct Private;
00812     friend struct Private;
00813     Private *mPriv;
00814 };
00815 
00816 class TP_QT_EXPORT BaseChannelHoldInterface : public AbstractChannelInterface
00817 {
00818     Q_OBJECT
00819     Q_DISABLE_COPY(BaseChannelHoldInterface)
00820 
00821 public:
00822     static BaseChannelHoldInterfacePtr create() {
00823         return BaseChannelHoldInterfacePtr(new BaseChannelHoldInterface());
00824     }
00825     template<typename BaseChannelHoldInterfaceSubclass>
00826     static SharedPtr<BaseChannelHoldInterfaceSubclass> create() {
00827         return SharedPtr<BaseChannelHoldInterfaceSubclass>(
00828                    new BaseChannelHoldInterfaceSubclass());
00829     }
00830     virtual ~BaseChannelHoldInterface();
00831 
00832     QVariantMap immutableProperties() const;
00833 
00834     Tp::LocalHoldState getHoldState() const;
00835     Tp::LocalHoldStateReason getHoldReason() const;
00836     void setHoldState(const Tp::LocalHoldState &state, const Tp::LocalHoldStateReason &reason);
00837 
00838     typedef Callback3<void, const Tp::LocalHoldState&, const Tp::LocalHoldStateReason &, DBusError*> SetHoldStateCallback;
00839     void setSetHoldStateCallback(const SetHoldStateCallback &cb);
00840 Q_SIGNALS:
00841     void holdStateChanged(const Tp::LocalHoldState &state, const Tp::LocalHoldStateReason &reason);
00842 private:
00843     BaseChannelHoldInterface();
00844     void createAdaptor();
00845 
00846     class Adaptee;
00847     friend class Adaptee;
00848     struct Private;
00849     friend struct Private;
00850     Private *mPriv;
00851 };
00852 
00853 class TP_QT_EXPORT BaseChannelMergeableConferenceInterface : public AbstractChannelInterface
00854 {
00855     Q_OBJECT
00856     Q_DISABLE_COPY(BaseChannelMergeableConferenceInterface)
00857 
00858 public:
00859     static BaseChannelMergeableConferenceInterfacePtr create() {
00860         return BaseChannelMergeableConferenceInterfacePtr(new BaseChannelMergeableConferenceInterface());
00861     }
00862     template<typename BaseChannelMergeableConferenceInterfaceSubclass>
00863     static SharedPtr<BaseChannelMergeableConferenceInterfaceSubclass> create() {
00864         return SharedPtr<BaseChannelMergeableConferenceInterfaceSubclass>(
00865                    new BaseChannelMergeableConferenceInterfaceSubclass());
00866     }
00867     virtual ~BaseChannelMergeableConferenceInterface();
00868 
00869     QVariantMap immutableProperties() const;
00870 
00871     void merge(const QDBusObjectPath &channel);
00872 
00873     typedef Callback2<void, const QDBusObjectPath&, DBusError*> MergeCallback;
00874     void setMergeCallback(const MergeCallback &cb);
00875 private:
00876     BaseChannelMergeableConferenceInterface();
00877     void createAdaptor();
00878 
00879     class Adaptee;
00880     friend class Adaptee;
00881     struct Private;
00882     friend struct Private;
00883     Private *mPriv;
00884 };
00885 
00886 class TP_QT_EXPORT BaseChannelSplittableInterface : public AbstractChannelInterface
00887 {
00888     Q_OBJECT
00889     Q_DISABLE_COPY(BaseChannelSplittableInterface)
00890 
00891 public:
00892     static BaseChannelSplittableInterfacePtr create() {
00893         return BaseChannelSplittableInterfacePtr(new BaseChannelSplittableInterface());
00894     }
00895     template<typename BaseChannelSplittableInterfaceSubclass>
00896     static SharedPtr<BaseChannelSplittableInterfaceSubclass> create() {
00897         return SharedPtr<BaseChannelSplittableInterfaceSubclass>(
00898                    new BaseChannelSplittableInterfaceSubclass());
00899     }
00900     virtual ~BaseChannelSplittableInterface();
00901 
00902     QVariantMap immutableProperties() const;
00903 
00904     void split();
00905 
00906     typedef Callback1<void, DBusError*> SplitCallback;
00907     void setSplitCallback(const SplitCallback &cb);
00908 private:
00909     BaseChannelSplittableInterface();
00910     void createAdaptor();
00911 
00912     class Adaptee;
00913     friend class Adaptee;
00914     struct Private;
00915     friend struct Private;
00916     Private *mPriv;
00917 };
00918 
00919 class TP_QT_EXPORT BaseChannelConferenceInterface : public AbstractChannelInterface
00920 {
00921     Q_OBJECT
00922     Q_DISABLE_COPY(BaseChannelConferenceInterface)
00923 
00924 public:
00925     static BaseChannelConferenceInterfacePtr create(Tp::ObjectPathList initialChannels = Tp::ObjectPathList(),
00926             Tp::UIntList initialInviteeHandles = Tp::UIntList(),
00927             QStringList initialInviteeIDs = QStringList(),
00928             QString invitationMessage = QString(),
00929             ChannelOriginatorMap originalChannels = ChannelOriginatorMap()) {
00930         return BaseChannelConferenceInterfacePtr(new BaseChannelConferenceInterface(initialChannels, initialInviteeHandles, initialInviteeIDs, invitationMessage, originalChannels));
00931     }
00932     template<typename BaseChannelConferenceInterfaceSubclass>
00933     static SharedPtr<BaseChannelConferenceInterfaceSubclass> create(Tp::ObjectPathList initialChannels = Tp::ObjectPathList(),
00934             Tp::UIntList initialInviteeHandles = Tp::UIntList(),
00935             QStringList initialInviteeIDs = QStringList(),
00936             QString invitationMessage = QString(),
00937             ChannelOriginatorMap originalChannels = ChannelOriginatorMap()) {
00938         return SharedPtr<BaseChannelConferenceInterfaceSubclass>(
00939                    new BaseChannelConferenceInterfaceSubclass(initialChannels, initialInviteeHandles, initialInviteeIDs, invitationMessage, originalChannels));
00940     }
00941     virtual ~BaseChannelConferenceInterface();
00942 
00943     QVariantMap immutableProperties() const;
00944     Tp::ObjectPathList channels() const;
00945     Tp::ObjectPathList initialChannels() const;
00946     Tp::UIntList initialInviteeHandles() const;
00947     QStringList initialInviteeIDs() const;
00948     QString invitationMessage() const;
00949     ChannelOriginatorMap originalChannels() const;
00950 
00951     void mergeChannel(const QDBusObjectPath &channel, uint channelHandle, const QVariantMap &properties);
00952     void removeChannel(const QDBusObjectPath &channel, const QVariantMap &details);
00953 
00954 private:
00955     BaseChannelConferenceInterface(Tp::ObjectPathList initialChannels, Tp::UIntList initialInviteeHandles, QStringList initialInviteeIDs, QString invitationMessage, ChannelOriginatorMap originalChannels);
00956     void createAdaptor();
00957 
00958     class Adaptee;
00959     friend class Adaptee;
00960     struct Private;
00961     friend struct Private;
00962     Private *mPriv;
00963 };
00964 
00965 class TP_QT_EXPORT BaseChannelSMSInterface : public AbstractChannelInterface
00966 {
00967     Q_OBJECT
00968     Q_DISABLE_COPY(BaseChannelSMSInterface)
00969 
00970 public:
00971     static BaseChannelSMSInterfacePtr create(bool flash, bool smsChannel) {
00972         return BaseChannelSMSInterfacePtr(new BaseChannelSMSInterface(flash, smsChannel));
00973     }
00974     template<typename BaseChannelSMSInterfaceSubclass>
00975     static SharedPtr<BaseChannelSMSInterfaceSubclass> create(bool flash, bool smsChannel) {
00976         return SharedPtr<BaseChannelSMSInterfaceSubclass>(
00977                    new BaseChannelSMSInterfaceSubclass(flash, smsChannel));
00978     }
00979     virtual ~BaseChannelSMSInterface();
00980 
00981     QVariantMap immutableProperties() const;
00982 
00983     typedef Callback2<void, const Tp::MessagePartList &, DBusError*> GetSMSLengthCallback;
00984     void setGetSMSLengthCallback(const GetSMSLengthCallback &cb);
00985 
00986     bool flash() const;
00987     bool smsChannel() const;
00988 
00989 Q_SIGNALS:
00990     void smsChannelChanged(bool smsChannel);
00991 
00992 private:
00993     BaseChannelSMSInterface(bool flash, bool smsChannel);
00994     void createAdaptor();
00995 
00996     class Adaptee;
00997     friend class Adaptee;
00998     struct Private;
00999     friend struct Private;
01000     Private *mPriv;
01001 };
01002 
01003 }
01004 #endif


Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt 0.9.6.1