Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef QDISPATCH_TIMER_H_
00023 #define QDISPATCH_TIMER_H_
00024
00025 #include "qdispatchglobal.h"
00026 #include "../xdispatch/dispatch.h"
00027 #include <qobject.h>
00028
00029 QT_BEGIN_HEADER
00030 QT_BEGIN_NAMESPACE
00031
00032 class QTime;
00033 class QRunnable;
00034
00035 QT_MODULE(Dispatch)
00036
00037
00046 class Q_DISPATCH_EXPORT QDispatchTimer : public QObject, private xdispatch::timer {
00047
00048 Q_OBJECT
00049
00050 public:
00058 QDispatchTimer(int msec, QObject* parent = NULL);
00059 QDispatchTimer(const QDispatchTimer&);
00060 QDispatchTimer(const xdispatch::timer&, QObject* parent = NULL);
00061 ~QDispatchTimer();
00065 void setInterval(int msec);
00069 void setTargetQueue(const xdispatch::queue&);
00077 void setHandler(QRunnable*);
00078 #ifdef XDISPATCH_HAS_BLOCKS
00079
00083 void setHandler(dispatch_block_t);
00084 #endif
00085
00091 void setLatency(int usec);
00096 static void singleShot(dispatch_time_t, const xdispatch::queue&, QRunnable*);
00101 static void singleShot(const QTime&, const xdispatch::queue&, QRunnable*);
00102 #ifdef XDISPATCH_HAS_BLOCKS
00103
00107 static void singleShot(dispatch_time_t, const xdispatch::queue&, dispatch_block_t);
00112 static void singleShot(const QTime&, const xdispatch::queue&, dispatch_block_t);
00113 #endif
00114 static QDispatchTimer* current();
00115
00116 bool operator ==(const QDispatchTimer&);
00117
00118 public slots:
00123 void start();
00128 void stop();
00129
00130 private:
00131 class Private;
00132 Private* d;
00133
00134 };
00135
00136 QT_END_NAMESPACE
00137 QT_END_HEADER
00138
00139 #endif