MeeGo 1.2 Harmattan Developer Documentation Develop for the Nokia N9
   Home · All Classes · All Namespaces · Modules · Functions · Files

requestable-channel-class-spec.h

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

Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation
Telepathy-Qt4 0.6.5