00001
00023 #ifndef _TelepathyQt_pending_operation_h_HEADER_GUARD_
00024 #define _TelepathyQt_pending_operation_h_HEADER_GUARD_
00025
00026 #ifndef IN_TP_QT_HEADER
00027 #error IN_TP_QT_HEADER
00028 #endif
00029
00030 #include <TelepathyQt/Global>
00031 #include <TelepathyQt/RefCounted>
00032 #include <TelepathyQt/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 TP_QT_EXPORT PendingOperation : public QObject
00046 {
00047 Q_OBJECT
00048 Q_DISABLE_COPY(PendingOperation)
00049
00050 public:
00051 virtual ~PendingOperation();
00052
00053 bool isFinished() const;
00054
00055 bool isValid() const;
00056
00057 bool isError() const;
00058 QString errorName() const;
00059 QString errorMessage() const;
00060
00061 Q_SIGNALS:
00062 void finished(Tp::PendingOperation *operation);
00063
00064 protected:
00065 PendingOperation(const SharedPtr<RefCounted> &object);
00066 SharedPtr<RefCounted> object() const;
00067
00068 protected Q_SLOTS:
00069 void setFinished();
00070 void setFinishedWithError(const QString &name, const QString &message);
00071 void setFinishedWithError(const QDBusError &error);
00072
00073 private Q_SLOTS:
00074 TP_QT_NO_EXPORT void emitFinished();
00075
00076 private:
00077 friend class ContactManager;
00078 friend class ReadinessHelper;
00079
00080 struct Private;
00081 friend struct Private;
00082 Private *mPriv;
00083 };
00084
00085 }
00086
00087 #endif