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

channel-request.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_request_h_HEADER_GUARD_
00023 #define _TelepathyQt4_channel_request_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-request.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 ChannelRequest : public StatefulDBusProxy,
00051                        public OptionalInterfaceFactory<ChannelRequest>,
00052                        public ReadyObject,
00053                        public RefCounted
00054 {
00055     Q_OBJECT
00056     Q_DISABLE_COPY(ChannelRequest)
00057 
00058 public:
00059     static const Feature FeatureCore;
00060 
00061     TELEPATHY_QT4_DEPRECATED static ChannelRequestPtr create(const QString &objectPath,
00062             const QVariantMap &immutableProperties);
00063     TELEPATHY_QT4_DEPRECATED static ChannelRequestPtr create(const QDBusConnection &bus,
00064             const QString &objectPath, const QVariantMap &immutableProperties);
00065 
00066     static ChannelRequestPtr create(const QDBusConnection &bus,
00067             const QString &objectPath, const QVariantMap &immutableProperties,
00068             const AccountFactoryConstPtr &accountFactory,
00069             const ConnectionFactoryConstPtr &connectionFactory,
00070             const ChannelFactoryConstPtr &channelFactory,
00071             const ContactFactoryConstPtr &contactFactory);
00072 
00073     static ChannelRequestPtr create(const AccountPtr &account,
00074             const QString &objectPath, const QVariantMap &immutableProperties);
00075 
00076     virtual ~ChannelRequest();
00077 
00078     AccountPtr account() const;
00079     QDateTime userActionTime() const;
00080     QString preferredHandler() const;
00081     QualifiedPropertyValueMapList requests() const;
00082 
00083     QVariantMap immutableProperties() const;
00084 
00085     PendingOperation *cancel();
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 failed(const QString &errorName, const QString &errorMessage);
00094     void succeeded();
00095 
00096 protected:
00097     TELEPATHY_QT4_DEPRECATED ChannelRequest(const QDBusConnection &bus,
00098             const QString &objectPath, const QVariantMap &immutableProperties);
00099 
00100     ChannelRequest(const QDBusConnection &bus,
00101             const QString &objectPath, const QVariantMap &immutableProperties,
00102             const AccountFactoryConstPtr &accountFactory,
00103             const ConnectionFactoryConstPtr &connectionFactory,
00104             const ChannelFactoryConstPtr &channelFactory,
00105             const ContactFactoryConstPtr &contactFactory);
00106 
00107     ChannelRequest(const AccountPtr &account,
00108             const QString &objectPath, const QVariantMap &immutableProperties);
00109 
00110     Client::ChannelRequestInterface *baseInterface() const;
00111 
00112 private Q_SLOTS:
00113     void gotMainProperties(QDBusPendingCallWatcher *watcher);
00114     void onAccountReady(Tp::PendingOperation *op);
00115 
00116 private:
00117     friend class PendingChannelRequest;
00118 
00119     PendingOperation *proceed();
00120 
00121     struct Private;
00122     friend struct Private;
00123     Private *mPriv;
00124 };
00125 
00126 } // Tp
00127 
00128 #endif


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