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/Types>
00038 #include <TelepathyQt4/SharedPtr>
00039 
00040 #include <QString>
00041 #include <QStringList>
00042 #include <QVariantMap>
00043 
00044 namespace Tp
00045 {
00046 
00047 class PendingOperation;
00048 
00049 class TELEPATHY_QT4_EXPORT ChannelRequest : public StatefulDBusProxy,
00050                 public OptionalInterfaceFactory<ChannelRequest>
00051 {
00052     Q_OBJECT
00053     Q_DISABLE_COPY(ChannelRequest)
00054 
00055 public:
00056     static const Feature FeatureCore;
00057 
00058     static ChannelRequestPtr create(const QDBusConnection &bus,
00059             const QString &objectPath, const QVariantMap &immutableProperties,
00060             const AccountFactoryConstPtr &accountFactory,
00061             const ConnectionFactoryConstPtr &connectionFactory,
00062             const ChannelFactoryConstPtr &channelFactory,
00063             const ContactFactoryConstPtr &contactFactory);
00064 
00065     static ChannelRequestPtr create(const AccountPtr &account,
00066             const QString &objectPath, const QVariantMap &immutableProperties);
00067 
00068     virtual ~ChannelRequest();
00069 
00070     AccountPtr account() const;
00071     QDateTime userActionTime() const;
00072     QString preferredHandler() const;
00073     QualifiedPropertyValueMapList requests() const;
00074 
00075     QVariantMap immutableProperties() const;
00076 
00077     PendingOperation *cancel();
00078 
00079 Q_SIGNALS:
00080     void failed(const QString &errorName, const QString &errorMessage);
00081     void succeeded();
00082 
00083 protected:
00084     ChannelRequest(const QDBusConnection &bus,
00085             const QString &objectPath, const QVariantMap &immutableProperties,
00086             const AccountFactoryConstPtr &accountFactory,
00087             const ConnectionFactoryConstPtr &connectionFactory,
00088             const ChannelFactoryConstPtr &channelFactory,
00089             const ContactFactoryConstPtr &contactFactory);
00090 
00091     ChannelRequest(const AccountPtr &account,
00092             const QString &objectPath, const QVariantMap &immutableProperties);
00093 
00094     Client::ChannelRequestInterface *baseInterface() const;
00095 
00096 private Q_SLOTS:
00097     void gotMainProperties(QDBusPendingCallWatcher *watcher);
00098     void onAccountReady(Tp::PendingOperation *op);
00099 
00100 private:
00101     friend class PendingChannelRequest;
00102 
00103     PendingOperation *proceed();
00104 
00105     struct Private;
00106     friend struct Private;
00107     Private *mPriv;
00108 };
00109 
00110 } // Tp
00111 
00112 #endif


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