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

channel-dispatch-operation.h

00001 /*
00002  * This file is part of TelepathyQt4
00003  *
00004  * Copyright (C) 2009 Collabora Ltd. <http://www.collabora.co.uk/>
00005  * Copyright (C) 2009 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_channel_dispatch_operation_h_HEADER_GUARD_
00023 #define _TelepathyQt4_channel_dispatch_operation_h_HEADER_GUARD_
00024 
00025 #ifndef IN_TELEPATHY_QT4_HEADER
00026 #error IN_TELEPATHY_QT4_HEADER
00027 #endif
00028 
00029 #include <TelepathyQt4/_gen/cli-channel-dispatch-operation.h>
00030 
00031 #include <TelepathyQt4/Constants>
00032 #include <TelepathyQt4/DBus>
00033 #include <TelepathyQt4/DBusProxy>
00034 #include <TelepathyQt4/Feature>
00035 #include <TelepathyQt4/OptionalInterfaceFactory>
00036 #include <TelepathyQt4/ReadinessHelper>
00037 #include <TelepathyQt4/ReadyObject>
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                                  public ReadyObject,
00053                                  public RefCounted
00054 {
00055     Q_OBJECT
00056     Q_DISABLE_COPY(ChannelDispatchOperation)
00057 
00058 public:
00059     static const Feature FeatureCore;
00060 
00061     TELEPATHY_QT4_DEPRECATED static ChannelDispatchOperationPtr create(const QString &objectPath,
00062             const QVariantMap &immutableProperties);
00063     TELEPATHY_QT4_DEPRECATED static ChannelDispatchOperationPtr create(const QDBusConnection &bus,
00064             const QString &objectPath, const QVariantMap &immutableProperties);
00065 
00066     static ChannelDispatchOperationPtr create(const QDBusConnection &bus,
00067             const QString &objectPath, const QVariantMap &immutableProperties,
00068             const QList<ChannelPtr> &initialChannels,
00069             const AccountFactoryConstPtr &accountFactory,
00070             const ConnectionFactoryConstPtr &connectionFactory,
00071             const ChannelFactoryConstPtr &channelFactory,
00072             const ContactFactoryConstPtr &contactFactory);
00073     virtual ~ChannelDispatchOperation();
00074 
00075     ConnectionPtr connection() const;
00076 
00077     AccountPtr account() const;
00078 
00079     QList<ChannelPtr> channels() const;
00080 
00081     QStringList possibleHandlers() const;
00082 
00083     PendingOperation *handleWith(const QString &handler);
00084 
00085     PendingOperation *claim();
00086 
00087     TELEPATHY_QT4_DEPRECATED inline Client::DBus::PropertiesInterface *propertiesInterface() const
00088     {
00089         return optionalInterface<Client::DBus::PropertiesInterface>(BypassInterfaceCheck);
00090     }
00091 
00092 Q_SIGNALS:
00093     void channelLost(const ChannelPtr &channel, const QString &errorName,
00094             const QString &errorMessage);
00095 
00096 protected:
00097     TELEPATHY_QT4_DEPRECATED ChannelDispatchOperation(const QDBusConnection &bus,
00098             const QString &objectPath, const QVariantMap &immutableProperties);
00099 
00100     ChannelDispatchOperation(const QDBusConnection &bus,
00101             const QString &objectPath, const QVariantMap &immutableProperties,
00102             const QList<ChannelPtr> &initialChannels,
00103             const AccountFactoryConstPtr &accountFactory,
00104             const ConnectionFactoryConstPtr &connectionFactory,
00105             const ChannelFactoryConstPtr &channelFactory,
00106             const ContactFactoryConstPtr &contactFactory);
00107 
00108     Client::ChannelDispatchOperationInterface *baseInterface() const;
00109 
00110 private Q_SLOTS:
00111     void onFinished();
00112     void gotMainProperties(QDBusPendingCallWatcher *watcher);
00113     void onChannelLost(const QDBusObjectPath &channelObjectPath,
00114         const QString &errorName, const QString &errorMessage);
00115     void onProxiesPrepared(Tp::PendingOperation *op);
00116 
00117 private:
00118     struct Private;
00119     friend struct Private;
00120     Private *mPriv;
00121 };
00122 
00123 } // Tp
00124 
00125 #endif


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