]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/qtTimeout.h
Make the GUI instantiation invisible to Timeout.
[lyx.git] / src / frontends / qt2 / 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
18 // stupid Qt
19 #undef emit
20
21 /**
22  * This class executes the callback when the timeout expires
23  * using Qt mechanisms
24  */
25 struct qtTimeout : QObject, public Timeout::Impl {
26 public:
27         ///
28         qtTimeout(Timeout & owner_);
29         ///
30         virtual bool running() const;
31         /// start the timer
32         virtual void start();
33         /// stop the timer
34         virtual void stop();
35         /// reset
36         virtual void reset();
37
38 protected:
39         /// slot
40         virtual void timerEvent(QTimerEvent *);
41
42 private:
43         /// timout id
44         int timeout_id;
45 };
46
47 #endif // QTTIMEOUT_H