| 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     static RequestableChannelClassSpec streamedMediaCall();
    00053     static RequestableChannelClassSpec streamedMediaAudioCall();
    00054     static RequestableChannelClassSpec streamedMediaVideoCall();
    00055     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     static RequestableChannelClassSpec conferenceStreamedMediaCall();
    00064     static RequestableChannelClassSpec conferenceStreamedMediaCallWithInvitees();
    00065
    00066     static RequestableChannelClassSpec contactSearch();
    00067     static RequestableChannelClassSpec contactSearchWithSpecificServer();
    00068     static RequestableChannelClassSpec contactSearchWithLimit();
    00069     static RequestableChannelClassSpec contactSearchWithSpecificServerAndLimit();
    00070
    00071     static RequestableChannelClassSpec streamTube(const QString &service = QString());
    00072
    00073     bool isValid() const { return mPriv.constData() != 0; }
    00074
    00075     RequestableChannelClassSpec &operator=(const RequestableChannelClassSpec &other);
    00076     bool operator==(const RequestableChannelClassSpec &other) const;
    00077
    00078     bool supports(const RequestableChannelClassSpec &spec) const;
    00079
    00080     QString channelType() const;
    00081
    00082     bool hasTargetHandleType() const;
    00083     HandleType targetHandleType() const;
    00084
    00085     bool hasFixedProperty(const QString &name) const;
    00086     QVariant fixedProperty(const QString &name) const;
    00087     QVariantMap fixedProperties() const;
    00088
    00089     bool allowsProperty(const QString &name) const;
    00090     QStringList allowedProperties() const;
    00091
    00092     RequestableChannelClass bareClass() const;
    00093
    00094 private:
    00095     struct Private;
    00096     friend struct Private;
    00097     QSharedDataPointer<Private> mPriv;
    00098 };
    00099
    00100 class TP_QT_EXPORT RequestableChannelClassSpecList :
    00101                 public QList<RequestableChannelClassSpec>
    00102 {
    00103 public:
    00104     RequestableChannelClassSpecList() { }
    00105     RequestableChannelClassSpecList(const RequestableChannelClass &rcc)
    00106     {
    00107         append(RequestableChannelClassSpec(rcc));
    00108     }
    00109     RequestableChannelClassSpecList(const RequestableChannelClassList &rccs)
    00110     {
    00111         Q_FOREACH (const RequestableChannelClass &rcc, rccs) {
    00112             append(RequestableChannelClassSpec(rcc));
    00113         }
    00114     }
    00115     RequestableChannelClassSpecList(const RequestableChannelClassSpec &rccSpec)
    00116     {
    00117         append(rccSpec);
    00118     }
    00119     RequestableChannelClassSpecList(const QList<RequestableChannelClassSpec> &other)
    00120         : QList<RequestableChannelClassSpec>(other)
    00121     {
    00122     }
    00123
    00124     RequestableChannelClassList bareClasses() const
    00125     {
    00126         RequestableChannelClassList list;
    00127         Q_FOREACH (const RequestableChannelClassSpec &rccSpec, *this) {
    00128             list.append(rccSpec.bareClass());
    00129         }
    00130         return list;
    00131     }
    00132 };
    00133
    00134 } // Tp
    00135
    00136 Q_DECLARE_METATYPE(Tp::RequestableChannelClassSpec);
    00137 Q_DECLARE_METATYPE(Tp::RequestableChannelClassSpecList);
    00138
    00139 #endif