Home · All Classes · All Namespaces · Modules · Functions · Files
channel-dispatch-operation.h
00001 
00023 #ifndef _TelepathyQt4_channel_dispatch_operation_h_HEADER_GUARD_
00024 #define _TelepathyQt4_channel_dispatch_operation_h_HEADER_GUARD_
00025 
00026 #ifndef IN_TELEPATHY_QT4_HEADER
00027 #error IN_TELEPATHY_QT4_HEADER
00028 #endif
00029 
00030 #include <TelepathyQt4/_gen/cli-channel-dispatch-operation.h>
00031 
00032 #include <TelepathyQt4/Constants>
00033 #include <TelepathyQt4/DBus>
00034 #include <TelepathyQt4/DBusProxy>
00035 #include <TelepathyQt4/Feature>
00036 #include <TelepathyQt4/OptionalInterfaceFactory>
00037 #include <TelepathyQt4/ReadinessHelper>
00038 #include <TelepathyQt4/Types>
00039 #include <TelepathyQt4/SharedPtr>
00040 
00041 #include <QString>
00042 #include <QStringList>
00043 #include <QVariantMap>
00044 
00045 namespace Tp
00046 {
00047 
00048 class PendingOperation;
00049 
00050 class TELEPATHY_QT4_EXPORT ChannelDispatchOperation : public StatefulDBusProxy,
00051                 public OptionalInterfaceFactory<ChannelDispatchOperation>
00052 {
00053     Q_OBJECT
00054     Q_DISABLE_COPY(ChannelDispatchOperation)
00055 
00056 public:
00057     static const Feature FeatureCore;
00058 
00059     static ChannelDispatchOperationPtr create(const QDBusConnection &bus,
00060             const QString &objectPath, const QVariantMap &immutableProperties,
00061             const QList<ChannelPtr> &initialChannels,
00062             const AccountFactoryConstPtr &accountFactory,
00063             const ConnectionFactoryConstPtr &connectionFactory,
00064             const ChannelFactoryConstPtr &channelFactory,
00065             const ContactFactoryConstPtr &contactFactory);
00066     virtual ~ChannelDispatchOperation();
00067 
00068     ConnectionPtr connection() const;
00069 
00070     AccountPtr account() const;
00071 
00072     QList<ChannelPtr> channels() const;
00073 
00074     QStringList possibleHandlers() const;
00075 
00076     PendingOperation *handleWith(const QString &handler);
00077 
00078     PendingOperation *claim();
00079     PendingOperation *claim(const AbstractClientHandlerPtr &handler);
00080 
00081 Q_SIGNALS:
00082     void channelLost(const Tp::ChannelPtr &channel, const QString &errorName,
00083             const QString &errorMessage);
00084 
00085 protected:
00086     ChannelDispatchOperation(const QDBusConnection &bus,
00087             const QString &objectPath, const QVariantMap &immutableProperties,
00088             const QList<ChannelPtr> &initialChannels,
00089             const AccountFactoryConstPtr &accountFactory,
00090             const ConnectionFactoryConstPtr &connectionFactory,
00091             const ChannelFactoryConstPtr &channelFactory,
00092             const ContactFactoryConstPtr &contactFactory);
00093 
00094     Client::ChannelDispatchOperationInterface *baseInterface() const;
00095 
00096 private Q_SLOTS:
00097     TELEPATHY_QT4_NO_EXPORT void onFinished();
00098     TELEPATHY_QT4_NO_EXPORT void gotMainProperties(QDBusPendingCallWatcher *watcher);
00099     TELEPATHY_QT4_NO_EXPORT void onChannelLost(const QDBusObjectPath &channelObjectPath,
00100         const QString &errorName, const QString &errorMessage);
00101     TELEPATHY_QT4_NO_EXPORT void onProxiesPrepared(Tp::PendingOperation *op);
00102 
00103 private:
00104     class PendingClaim;
00105     friend class PendingClaim;
00106 
00107     struct Private;
00108     friend struct Private;
00109     Private *mPriv;
00110 };
00111 
00112 } // Tp
00113 
00114 #endif


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