Home · Modules · All Classes · All Namespaces
simple-pending-operations.h
1 
23 #ifndef _TelepathyQt_pending_operations_h_HEADER_GUARD_
24 #define _TelepathyQt_pending_operations_h_HEADER_GUARD_
25 
26 #ifndef IN_TP_QT_HEADER
27 #error IN_TP_QT_HEADER
28 #endif
29 
30 #include <QObject>
31 
32 #include <TelepathyQt/PendingOperation>
33 
34 namespace Tp
35 {
36 
37 class TP_QT_EXPORT PendingSuccess : public PendingOperation
38 {
39  Q_OBJECT
40  Q_DISABLE_COPY(PendingSuccess)
41 
42 public:
44  : PendingOperation(object)
45  {
46  setFinished();
47  }
48 };
49 
50 class TP_QT_EXPORT PendingFailure : public PendingOperation
51 {
52  Q_OBJECT
53  Q_DISABLE_COPY(PendingFailure)
54 
55 public:
56  PendingFailure(const QString &name, const QString &message,
57  const SharedPtr<RefCounted> &object)
58  : PendingOperation(object)
59  {
60  setFinishedWithError(name, message);
61  }
62 
63  PendingFailure(const QDBusError &error,
64  const SharedPtr<RefCounted> &object)
65  : PendingOperation(object)
66  {
67  setFinishedWithError(error);
68  }
69 };
70 
71 class TP_QT_EXPORT PendingVoid : public PendingOperation
72 {
73  Q_OBJECT
74  Q_DISABLE_COPY(PendingVoid)
75 
76 public:
77  PendingVoid(QDBusPendingCall call, const SharedPtr<RefCounted> &object);
78 
79 private Q_SLOTS:
80  TP_QT_NO_EXPORT void watcherFinished(QDBusPendingCallWatcher*);
81 
82 private:
83  struct Private;
84  friend struct Private;
85  Private *mPriv;
86 };
87 
88 class TP_QT_EXPORT PendingComposite : public PendingOperation
89 {
90  Q_OBJECT
91  Q_DISABLE_COPY(PendingComposite)
92 
93 public:
94  PendingComposite(const QList<PendingOperation*> &operations, const SharedPtr<RefCounted> &object);
95  PendingComposite(const QList<PendingOperation*> &operations, bool failOnFirstError,
96  const SharedPtr<RefCounted> &object);
98 
99 private Q_SLOTS:
100  TP_QT_NO_EXPORT void onOperationFinished(Tp::PendingOperation *);
101 
102 private:
103  struct Private;
104  friend struct Private;
105  Private *mPriv;
106 };
107 
108 } // Tp
109 
110 #endif
The PendingComposite class is a PendingOperation that can be used to track multiple pending operation...
Definition: simple-pending-operations.h:88
The PendingSuccess class represents PendingOperation that is always successful.
Definition: simple-pending-operations.h:37
PendingSuccess(const SharedPtr< RefCounted > &object)
Definition: simple-pending-operations.h:43
The SharedPtr class is a pointer to an explicitly shared object.
Definition: shared-ptr.h:39
The PendingVoid class is a generic subclass of PendingOperation representing a pending D-Bus method c...
Definition: simple-pending-operations.h:71
The PendingFailure class represents a PendingOperation that always fails with the error passed to the...
Definition: simple-pending-operations.h:50
PendingFailure(const QString &name, const QString &message, const SharedPtr< RefCounted > &object)
Definition: simple-pending-operations.h:56
PendingFailure(const QDBusError &error, const SharedPtr< RefCounted > &object)
Definition: simple-pending-operations.h:63
Definition: abstract-adaptor.cpp:31
The PendingOperation class is a base class for pending asynchronous operations.
Definition: pending-operation.h:45