| Home · All Classes · All Namespaces · Modules · Functions · Files

requestable-channel-class-spec.h

    00001
    00023 #ifndef _TelepathyQt_requestable_channel_class_spec_h_HEADER_GUARD_
    00024 #define _TelepathyQt_requestable_channel_class_spec_h_HEADER_GUARD_
    00025
    00026 #ifndef IN_TP_QT_HEADER
    00027 #error IN_TP_QT_HEADER
    00028 #endif
    00029
    00030 #include <TelepathyQt/Constants>
    00031 #include <TelepathyQt/Types>
    00032
    00033 namespace Tp
    00034 {
    00035
    00036 class TP_QT_EXPORT RequestableChannelClassSpec
    00037 {
    00038 public:
    00039     RequestableChannelClassSpec();
    00040     RequestableChannelClassSpec(const RequestableChannelClass &rcc);
    00041     RequestableChannelClassSpec(const RequestableChannelClassSpec &other);
    00042     ~RequestableChannelClassSpec();
    00043
    00044     static RequestableChannelClassSpec textChat();
    00045     static RequestableChannelClassSpec textChatroom();
    00046
    00047     static RequestableChannelClassSpec audioCall();
    00048     static RequestableChannelClassSpec audioCallWithVideoAllowed();
    00049     static RequestableChannelClassSpec videoCall();
    00050     static RequestableChannelClassSpec videoCallWithAudioAllowed();
    00051
    00052     TP_QT_DEPRECATED static RequestableChannelClassSpec streamedMediaCall();
    00053     TP_QT_DEPRECATED static RequestableChannelClassSpec streamedMediaAudioCall();
    00054     TP_QT_DEPRECATED static RequestableChannelClassSpec streamedMediaVideoCall();
    00055     TP_QT_DEPRECATED static RequestableChannelClassSpec streamedMediaVideoCallWithAudio();
    00056
    00057     static RequestableChannelClassSpec fileTransfer();
    00058
    00059     static RequestableChannelClassSpec conferenceTextChat();
    00060     static RequestableChannelClassSpec conferenceTextChatWithInvitees();
    00061     static RequestableChannelClassSpec conferenceTextChatroom();
    00062     static RequestableChannelClassSpec conferenceTextChatroomWithInvitees();
    00063     TP_QT_DEPRECATED static RequestableChannelClassSpec conferenceStreamedMediaCall();
    00064     TP_QT_DEPRECATED static RequestableChannelClassSpec conferenceStreamedMediaCallWithInvitees();
    00065
    00066     static RequestableChannelClassSpec contactSearch();
    00067     static RequestableChannelClassSpec contactSearchWithSpecificServer();
    00068     static RequestableChannelClassSpec contactSearchWithLimit();
    00069     static RequestableChannelClassSpec contactSearchWithSpecificServerAndLimit();
    00070
    00071     static RequestableChannelClassSpec dbusTube(const QString &serviceName = QString());
    00072     static RequestableChannelClassSpec streamTube(const QString &service = QString());
    00073
    00074     bool isValid() const { return mPriv.constData() != 0; }
    00075
    00076     RequestableChannelClassSpec &operator=(const RequestableChannelClassSpec &other);
    00077     bool operator==(const RequestableChannelClassSpec &other) const;
    00078
    00079     bool supports(const RequestableChannelClassSpec &spec) const;
    00080
    00081     QString channelType() const;
    00082
    00083     bool hasTargetHandleType() const;
    00084     HandleType targetHandleType() const;
    00085
    00086     bool hasFixedProperty(const QString &name) const;
    00087     QVariant fixedProperty(const QString &name) const;
    00088     QVariantMap fixedProperties() const;
    00089
    00090     bool allowsProperty(const QString &name) const;
    00091     QStringList allowedProperties() const;
    00092
    00093     RequestableChannelClass bareClass() const;
    00094
    00095 private:
    00096     struct Private;
    00097     friend struct Private;
    00098     QSharedDataPointer<Private> mPriv;
    00099 };
    00100
    00101 class TP_QT_EXPORT RequestableChannelClassSpecList :
    00102                 public QList<RequestableChannelClassSpec>
    00103 {
    00104 public:
    00105     RequestableChannelClassSpecList() { }
    00106     RequestableChannelClassSpecList(const RequestableChannelClass &rcc)
    00107     {
    00108         append(RequestableChannelClassSpec(rcc));
    00109     }
    00110     RequestableChannelClassSpecList(const RequestableChannelClassList &rccs)
    00111     {
    00112         Q_FOREACH (const RequestableChannelClass &rcc, rccs) {
    00113             append(RequestableChannelClassSpec(rcc));
    00114         }
    00115     }
    00116     RequestableChannelClassSpecList(const RequestableChannelClassSpec &rccSpec)
    00117     {
    00118         append(rccSpec);
    00119     }
    00120     RequestableChannelClassSpecList(const QList<RequestableChannelClassSpec> &other)
    00121         : QList<RequestableChannelClassSpec>(other)
    00122     {
    00123     }
    00124
    00125     RequestableChannelClassList bareClasses() const
    00126     {
    00127         RequestableChannelClassList list;
    00128         Q_FOREACH (const RequestableChannelClassSpec &rccSpec, *this) {
    00129             list.append(rccSpec.bareClass());
    00130         }
    00131         return list;
    00132     }
    00133 };
    00134
    00135 } // Tp
    00136
    00137 Q_DECLARE_METATYPE(Tp::RequestableChannelClassSpec);
    00138 Q_DECLARE_METATYPE(Tp::RequestableChannelClassSpecList);
    00139
    00140 #endif