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

requestable-channel-class-spec.h

00001 /*
00002  * This file is part of TelepathyQt4
00003  *
00004  * Copyright (C) 2010 Collabora Ltd. <http://www.collabora.co.uk/>
00005  * Copyright (C) 2010 Nokia Corporation
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020  */
00021 
00022 #ifndef _TelepathyQt4_requestable_channel_class_spec_h_HEADER_GUARD_
00023 #define _TelepathyQt4_requestable_channel_class_spec_h_HEADER_GUARD_
00024 
00025 #ifndef IN_TELEPATHY_QT4_HEADER
00026 #error IN_TELEPATHY_QT4_HEADER
00027 #endif
00028 
00029 #include <TelepathyQt4/Constants>
00030 #include <TelepathyQt4/Types>
00031 
00032 namespace Tp
00033 {
00034 
00035 class TELEPATHY_QT4_EXPORT RequestableChannelClassSpec
00036 {
00037 public:
00038     RequestableChannelClassSpec();
00039     RequestableChannelClassSpec(const RequestableChannelClass &rcc);
00040     RequestableChannelClassSpec(const RequestableChannelClassSpec &other);
00041     ~RequestableChannelClassSpec();
00042 
00043     static RequestableChannelClassSpec textChat();
00044     static RequestableChannelClassSpec textChatroom();
00045 
00046     static RequestableChannelClassSpec streamedMediaCall();
00047     static RequestableChannelClassSpec streamedMediaAudioCall();
00048     static RequestableChannelClassSpec streamedMediaVideoCall();
00049     static RequestableChannelClassSpec streamedMediaVideoCallWithAudio();
00050 
00051     static RequestableChannelClassSpec fileTransfer();
00052 
00053     static RequestableChannelClassSpec conferenceTextChat();
00054     static RequestableChannelClassSpec conferenceTextChatWithInvitees();
00055     static RequestableChannelClassSpec conferenceTextChatroom();
00056     static RequestableChannelClassSpec conferenceTextChatroomWithInvitees();
00057     static RequestableChannelClassSpec conferenceStreamedMediaCall();
00058     static RequestableChannelClassSpec conferenceStreamedMediaCallWithInvitees();
00059 
00060     static RequestableChannelClassSpec contactSearch();
00061     static RequestableChannelClassSpec contactSearchWithSpecificServer();
00062     static RequestableChannelClassSpec contactSearchWithLimit();
00063     static RequestableChannelClassSpec contactSearchWithSpecificServerAndLimit();
00064 
00065     bool isValid() const { return mPriv.constData() != 0; }
00066 
00067     RequestableChannelClassSpec &operator=(const RequestableChannelClassSpec &other);
00068     bool operator==(const RequestableChannelClassSpec &other) const;
00069 
00070     bool supports(const RequestableChannelClassSpec &spec) const;
00071 
00072     QString channelType() const;
00073 
00074     bool hasTargetHandleType() const;
00075     HandleType targetHandleType() const;
00076 
00077     bool hasFixedProperty(const QString &name) const;
00078     QVariant fixedProperty(const QString &name) const;
00079     QVariantMap fixedProperties() const;
00080 
00081     bool allowsProperty(const QString &name) const;
00082     QStringList allowedProperties() const;
00083 
00084     RequestableChannelClass bareClass() const;
00085 
00086 private:
00087     struct Private;
00088     friend struct Private;
00089     QSharedDataPointer<Private> mPriv;
00090 };
00091 
00092 class TELEPATHY_QT4_EXPORT RequestableChannelClassSpecList :
00093                 public QList<RequestableChannelClassSpec>
00094 {
00095 public:
00096     RequestableChannelClassSpecList() { }
00097     RequestableChannelClassSpecList(const RequestableChannelClass &rcc)
00098     {
00099         append(RequestableChannelClassSpec(rcc));
00100     }
00101     RequestableChannelClassSpecList(const RequestableChannelClassList &rccs)
00102     {
00103         Q_FOREACH (const RequestableChannelClass &rcc, rccs) {
00104             append(RequestableChannelClassSpec(rcc));
00105         }
00106     }
00107     RequestableChannelClassSpecList(const RequestableChannelClassSpec &rccSpec)
00108     {
00109         append(rccSpec);
00110     }
00111     RequestableChannelClassSpecList(const QList<RequestableChannelClassSpec> &other)
00112         : QList<RequestableChannelClassSpec>(other)
00113     {
00114     }
00115 
00116     RequestableChannelClassList bareClasses() const
00117     {
00118         RequestableChannelClassList list;
00119         Q_FOREACH (const RequestableChannelClassSpec &rccSpec, *this) {
00120             list.append(rccSpec.bareClass());
00121         }
00122         return list;
00123     }
00124 };
00125 
00126 } // Tp
00127 
00128 Q_DECLARE_METATYPE(Tp::RequestableChannelClassSpec);
00129 Q_DECLARE_METATYPE(Tp::RequestableChannelClassSpecList);
00130 
00131 #endif


Copyright © 2008-2010 Collabora Ltd. and Nokia Corporation
Telepathy-Qt4 0.5.6.1