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

pending-operation.h

    00001
    00023 #ifndef _TelepathyQt4_pending_operation_h_HEADER_GUARD_
    00024 #define _TelepathyQt4_pending_operation_h_HEADER_GUARD_
    00025
    00026 #ifndef IN_TELEPATHY_QT4_HEADER
    00027 #error IN_TELEPATHY_QT4_HEADER
    00028 #endif
    00029
    00030 #include <TelepathyQt4/Global>
    00031 #include <TelepathyQt4/RefCounted>
    00032 #include <TelepathyQt4/SharedPtr>
    00033
    00034 #include <QObject>
    00035
    00036 class QDBusError;
    00037 class QDBusPendingCall;
    00038 class QDBusPendingCallWatcher;
    00039
    00040 namespace Tp
    00041 {
    00042
    00043 class ReadinessHelper;
    00044
    00045 class TELEPATHY_QT4_EXPORT PendingOperation : public QObject
    00046 {
    00047     Q_OBJECT
    00048     Q_DISABLE_COPY(PendingOperation)
    00049
    00050 public:
    00051     virtual ~PendingOperation();
    00052
    00053     TELEPATHY_QT4_DEPRECATED SharedPtr<RefCounted> object() const;
    00054
    00055     bool isFinished() const;
    00056
    00057     bool isValid() const;
    00058
    00059     bool isError() const;
    00060     QString errorName() const;
    00061     QString errorMessage() const;
    00062
    00063 Q_SIGNALS:
    00064     void finished(Tp::PendingOperation *operation);
    00065
    00066 protected:
    00067     PendingOperation(const SharedPtr<RefCounted> &object);
    00068     TELEPATHY_QT4_NO_EXPORT SharedPtr<RefCounted> _object() const; // TODO: turn this into _object()
    00069
    00070 protected Q_SLOTS:
    00071     void setFinished();
    00072     void setFinishedWithError(const QString &name, const QString &message);
    00073     void setFinishedWithError(const QDBusError &error);
    00074
    00075 private Q_SLOTS:
    00076     TELEPATHY_QT4_NO_EXPORT void emitFinished();
    00077
    00078 private:
    00079     friend class ContactManager;
    00080     friend class ReadinessHelper;
    00081
    00082     struct Private;
    00083     friend struct Private;
    00084     Private *mPriv;
    00085 };
    00086
    00087 } // Tp
    00088
    00089 #endif