]> git.lyx.org Git - lyx.git/blob - src/frontends/qt3/qtTimeout.h
Extracted from r14281
[lyx.git] / src / frontends / qt3 / qtTimeout.h
1 // -*- C++ -*-
2 /**
3  * \file qtTimeout.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef QTTIMEOUT_H
13 #define QTTIMEOUT_H
14
15 #ifdef emit
16 #undef emit
17 #include "frontends/Timeout.h"
18 #define emit
19 #else
20 #include "frontends/Timeout.h"
21 #endif
22 #include <qobject.h>
23
24
25 /**
26  * This class executes the callback when the timeout expires
27  * using Qt mechanisms
28  */
29 class qtTimeout : QObject, public Timeout::Impl {
30 public:
31         ///
32         qtTimeout(Timeout & owner_);
33         ///
34         virtual bool running() const;
35         /// start the timer
36         virtual void start();
37         /// stop the timer
38         virtual void stop();
39         /// reset
40         virtual void reset();
41
42 protected:
43         /// slot
44         virtual void timerEvent(QTimerEvent *);
45
46 private:
47         /// timout id
48         int timeout_id;
49 };
50
51 #endif // QTTIMEOUT_H