]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/qtTimeout.h
* src/frontends/qt4/ui/TextLayoutUi.ui:
[lyx.git] / src / frontends / qt4 / 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 #include "frontends/Timeout.h"
16 #include <qobject.h>
17 //Added by qt3to4:
18 #include <QTimerEvent>
19
20
21 namespace lyx {
22
23 // stupid Qt
24 #undef emit
25
26 /**
27  * This class executes the callback when the timeout expires
28  * using Qt mechanisms
29  */
30 class qtTimeout : QObject, public Timeout::Impl {
31 public:
32         ///
33         qtTimeout(Timeout & owner_);
34         ///
35         virtual bool running() const;
36         /// start the timer
37         virtual void start();
38         /// stop the timer
39         virtual void stop();
40         /// reset
41         virtual void reset();
42
43 protected:
44         /// slot
45         virtual void timerEvent(QTimerEvent *);
46
47 private:
48         /// timout id
49         int timeout_id;
50 };
51
52
53 } // namespace lyx
54
55 #endif // QTTIMEOUT_H