TelepathyQt4: channel-request.h Source File

| 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     static ChannelRequestPtr create(const QString &objectPath,
    00062             const QVariantMap &immutableProperties);
    00063     static ChannelRequestPtr create(const QDBusConnection &bus,
    00064             const QString &objectPath, const QVariantMap &immutableProperties);
    00065
    00066     virtual ~ChannelRequest();
    00067
    00068     AccountPtr account() const;
    00069
    00070     QDateTime userActionTime() const;
    00071
    00072     QString preferredHandler() const;
    00073
    00074     QualifiedPropertyValueMapList requests() const;
    00075
    00076     PendingOperation *cancel();
    00077
    00078     inline Client::DBus::PropertiesInterface *propertiesInterface() const
    00079     {
    00080         return optionalInterface<Client::DBus::PropertiesInterface>(BypassInterfaceCheck);
    00081     }
    00082
    00083 Q_SIGNALS:
    00084     void failed(const QString &errorName, const QString &errorMessage);
    00085     void succeeded();
    00086
    00087 protected:
    00088     ChannelRequest(const QDBusConnection &bus,
    00089             const QString &objectPath, const QVariantMap &immutableProperties);
    00090
    00091     Client::ChannelRequestInterface *baseInterface() const;
    00092
    00093 private Q_SLOTS:
    00094     void gotMainProperties(QDBusPendingCallWatcher *watcher);
    00095     void onAccountReady(Tp::PendingOperation *op);
    00096
    00097 private:
    00098     friend class PendingChannelRequest;
    00099
    00100     PendingOperation *proceed();
    00101
    00102     struct Private;
    00103     friend struct Private;
    00104     Private *mPriv;
    00105 };
    00106
    00107 } // Tp
    00108
    00109 #endif