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

channel-factory.h

00001 
00023 #ifndef _TelepathyQt4_channel_factory_h_HEADER_GUARD_
00024 #define _TelepathyQt4_channel_factory_h_HEADER_GUARD_
00025 
00026 #ifndef IN_TELEPATHY_QT4_HEADER
00027 #error IN_TELEPATHY_QT4_HEADER
00028 #endif
00029 
00030 #include <TelepathyQt4/DBusProxyFactory>
00031 #include <TelepathyQt4/SharedPtr>
00032 #include <TelepathyQt4/Types>
00033 
00034 // For Q_DISABLE_COPY
00035 #include <QtGlobal>
00036 #include <QString>
00037 #include <QVariantMap>
00038 
00039 class QDBusConnection;
00040 
00041 namespace Tp
00042 {
00043 
00044 class ChannelClassSpec;
00045 
00046 class TELEPATHY_QT4_EXPORT ChannelFactory : public DBusProxyFactory
00047 {
00048     Q_OBJECT
00049     Q_DISABLE_COPY(ChannelFactory)
00050 
00051 public:
00052 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00053     struct TELEPATHY_QT4_EXPORT Constructor : public RefCounted
00054     {
00055         virtual ~Constructor() {}
00056 
00057         virtual ChannelPtr construct(const ConnectionPtr &conn, const QString &objectPath,
00058                 const QVariantMap &immutableProperties) const = 0;
00059     };
00060     typedef SharedPtr<Constructor> ConstructorPtr;
00061     typedef SharedPtr<const Constructor> ConstructorConstPtr;
00062 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00063 
00064     static ChannelFactoryPtr create(const QDBusConnection &bus);
00065 
00066     virtual ~ChannelFactory();
00067 
00068     Features featuresForTextChats(const QVariantMap &additionalProps = QVariantMap()) const;
00069     void addFeaturesForTextChats(const Features &features,
00070             const QVariantMap &additionalProps = QVariantMap());
00071 
00072     ConstructorConstPtr constructorForTextChats(
00073             const QVariantMap &additionalProps = QVariantMap()) const;
00074 
00075     template<typename Subclass>
00076     void setSubclassForTextChats(const QVariantMap &additionalProps = QVariantMap())
00077     {
00078         setConstructorForTextChats(SubclassCtor<Subclass>::create(), additionalProps);
00079     }
00080 
00081     void setConstructorForTextChats(const ConstructorConstPtr &ctor,
00082             const QVariantMap &additionalProps = QVariantMap());
00083 
00084     Features featuresForTextChatrooms(const QVariantMap &additionalProps = QVariantMap()) const;
00085     void addFeaturesForTextChatrooms(const Features &features,
00086             const QVariantMap &additionalProps = QVariantMap());
00087 
00088     ConstructorConstPtr constructorForTextChatrooms(
00089             const QVariantMap &additionalProps = QVariantMap()) const;
00090 
00091     template<typename Subclass>
00092     void setSubclassForTextChatrooms(const QVariantMap &additionalProps = QVariantMap())
00093     {
00094         setConstructorForTextChatrooms(SubclassCtor<Subclass>::create(), additionalProps);
00095     }
00096 
00097     void setConstructorForTextChatrooms(const ConstructorConstPtr &ctor,
00098             const QVariantMap &additionalProps = QVariantMap());
00099 
00100     Features featuresForStreamedMediaCalls(const QVariantMap &additionalProps = QVariantMap()) const;
00101     void addFeaturesForStreamedMediaCalls(const Features &features,
00102             const QVariantMap &additionalProps = QVariantMap());
00103 
00104     ConstructorConstPtr constructorForStreamedMediaCalls(
00105             const QVariantMap &additionalProps = QVariantMap()) const;
00106 
00107     template<typename Subclass>
00108     void setSubclassForStreamedMediaCalls(const QVariantMap &additionalProps = QVariantMap())
00109     {
00110         setConstructorForStreamedMediaCalls(SubclassCtor<Subclass>::create(), additionalProps);
00111     }
00112 
00113     void setConstructorForStreamedMediaCalls(const ConstructorConstPtr &ctor,
00114             const QVariantMap &additionalProps = QVariantMap());
00115 
00116     Features featuresForRoomLists(const QVariantMap &additionalProps = QVariantMap()) const;
00117     void addFeaturesForRoomLists(const Features &features,
00118             const QVariantMap &additionalProps = QVariantMap());
00119 
00120     ConstructorConstPtr constructorForRoomLists(
00121             const QVariantMap &additionalProps = QVariantMap()) const;
00122 
00123     template<typename Subclass>
00124     void setSubclassForRoomLists(const QVariantMap &additionalProps = QVariantMap())
00125     {
00126         setConstructorForRoomLists(SubclassCtor<Subclass>::create(), additionalProps);
00127     }
00128 
00129     void setConstructorForRoomLists(const ConstructorConstPtr &ctor,
00130             const QVariantMap &additionalProps = QVariantMap());
00131 
00132     Features featuresForOutgoingFileTransfers(const QVariantMap &additionalProps = QVariantMap()) const;
00133     void addFeaturesForOutgoingFileTransfers(const Features &features,
00134             const QVariantMap &additionalProps = QVariantMap());
00135 
00136     ConstructorConstPtr constructorForOutgoingFileTransfers(
00137             const QVariantMap &additionalProps = QVariantMap()) const;
00138 
00139     template<typename Subclass>
00140     void setSubclassForOutgoingFileTransfers(const QVariantMap &additionalProps = QVariantMap())
00141     {
00142         setConstructorForOutgoingFileTransfers(SubclassCtor<Subclass>::create(), additionalProps);
00143     }
00144 
00145     void setConstructorForOutgoingFileTransfers(const ConstructorConstPtr &ctor,
00146             const QVariantMap &additionalProps = QVariantMap());
00147 
00148     Features featuresForIncomingFileTransfers(const QVariantMap &additionalProps = QVariantMap()) const;
00149     void addFeaturesForIncomingFileTransfers(const Features &features,
00150             const QVariantMap &additionalProps = QVariantMap());
00151 
00152     ConstructorConstPtr constructorForIncomingFileTransfers(
00153             const QVariantMap &additionalProps = QVariantMap()) const;
00154 
00155     template<typename Subclass>
00156     void setSubclassForIncomingFileTransfers(const QVariantMap &additionalProps = QVariantMap())
00157     {
00158         setConstructorForIncomingFileTransfers(SubclassCtor<Subclass>::create(), additionalProps);
00159     }
00160 
00161     void setConstructorForIncomingFileTransfers(const ConstructorConstPtr &ctor,
00162             const QVariantMap &additionalProps = QVariantMap());
00163 
00164     Features featuresForOutgoingStreamTubes(const QVariantMap &additionalProps = QVariantMap()) const;
00165     void addFeaturesForOutgoingStreamTubes(const Features &features,
00166             const QVariantMap &additionalProps = QVariantMap());
00167 
00168     ConstructorConstPtr constructorForOutgoingStreamTubes(
00169             const QVariantMap &additionalProps = QVariantMap()) const;
00170 
00171     template<typename Subclass>
00172     void setSubclassForOutgoingStreamTubes(const QVariantMap &additionalProps = QVariantMap())
00173     {
00174         setConstructorForOutgoingStreamTubes(SubclassCtor<Subclass>::create(), additionalProps);
00175     }
00176 
00177     void setConstructorForOutgoingStreamTubes(const ConstructorConstPtr &ctor,
00178             const QVariantMap &additionalProps = QVariantMap());
00179 
00180     Features featuresForIncomingStreamTubes(const QVariantMap &additionalProps = QVariantMap()) const;
00181     void addFeaturesForIncomingStreamTubes(const Features &features,
00182             const QVariantMap &additionalProps = QVariantMap());
00183 
00184     ConstructorConstPtr constructorForIncomingStreamTubes(
00185             const QVariantMap &additionalProps = QVariantMap()) const;
00186 
00187     template<typename Subclass>
00188     void setSubclassForIncomingStreamTubes(const QVariantMap &additionalProps = QVariantMap())
00189     {
00190         setConstructorForIncomingStreamTubes(SubclassCtor<Subclass>::create(), additionalProps);
00191     }
00192 
00193     void setConstructorForIncomingStreamTubes(const ConstructorConstPtr &ctor,
00194             const QVariantMap &additionalProps = QVariantMap());
00195 
00196     Features featuresForContactSearches(const QVariantMap &additionalProps = QVariantMap()) const;
00197     void addFeaturesForContactSearches(const Features &features,
00198             const QVariantMap &additionalProps = QVariantMap());
00199 
00200     ConstructorConstPtr constructorForContactSearches(
00201             const QVariantMap &additionalProps = QVariantMap()) const;
00202 
00203     template<typename Subclass>
00204     void setSubclassForContactSearches(const QVariantMap &additionalProps = QVariantMap())
00205     {
00206         setConstructorForContactSearches(SubclassCtor<Subclass>::create(), additionalProps);
00207     }
00208 
00209     void setConstructorForContactSearches(const ConstructorConstPtr &ctor,
00210             const QVariantMap &additionalProps = QVariantMap());
00211 
00212     Features commonFeatures() const;
00213     void addCommonFeatures(const Features &features);
00214 
00215     ConstructorConstPtr fallbackConstructor() const;
00216 
00217     template <typename Subclass>
00218     void setFallbackSubclass()
00219     {
00220         setFallbackConstructor(SubclassCtor<Subclass>::create());
00221     }
00222 
00223     void setFallbackConstructor(const ConstructorConstPtr &ctor);
00224 
00225     Features featuresFor(const ChannelClassSpec &channelClass) const;
00226     void addFeaturesFor(const ChannelClassSpec &channelClass, const Features &features);
00227 
00228     template <typename Subclass>
00229     void setSubclassFor(const ChannelClassSpec &channelClass)
00230     {
00231         setConstructorFor(channelClass, SubclassCtor<Subclass>::create());
00232     }
00233 
00234     ConstructorConstPtr constructorFor(const ChannelClassSpec &channelClass) const;
00235     void setConstructorFor(const ChannelClassSpec &channelClass, const ConstructorConstPtr &ctor);
00236 
00237     PendingReady *proxy(const ConnectionPtr &connection, const QString &channelPath,
00238             const QVariantMap &immutableProperties) const;
00239 
00240 protected:
00241     ChannelFactory(const QDBusConnection &bus);
00242 
00243 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00244     template <typename Subclass>
00245     struct SubclassCtor : public Constructor
00246     {
00247         static ConstructorPtr create()
00248         {
00249             return ConstructorPtr(new SubclassCtor<Subclass>());
00250         }
00251 
00252         virtual ~SubclassCtor() {}
00253 
00254         ChannelPtr construct(const ConnectionPtr &conn, const QString &objectPath,
00255                 const QVariantMap &immutableProperties) const
00256         {
00257             return Subclass::create(conn, objectPath, immutableProperties);
00258         }
00259     };
00260 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00261 
00262     virtual QString finalBusNameFrom(const QString &uniqueOrWellKnown) const;
00263     // Nothing we'd like to prepare()
00264     virtual Features featuresFor(const DBusProxyPtr &proxy) const;
00265 
00266 private:
00267     struct Private;
00268     Private *mPriv;
00269 };
00270 
00271 } // Tp
00272 
00273 #endif

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