]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/Timeout_pimpl.h
The initial merge of the Qt frontend, and the necessary compile fixes.
[lyx.git] / src / frontends / qt2 / Timeout_pimpl.h
1 // -*- C++ -*-
2 /**
3  * \file qt2/Timeout_pimpl.h
4  * Copyright 2001 LyX Team
5  * Read COPYING
6  *
7  * \author John Levon
8  */
9
10 #ifndef TIMEOUTPIMPL_H
11 #define TIMEOUTPIMPL_H
12
13 #include <config.h>
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "frontends/Timeout.h"
20
21 #include <qobject.h>
22 // stupid Qt
23 #undef emit
24
25 /**
26  * This class executes the callback when the timeout expires
27  * using Qt mechanisms
28  */
29 struct Timeout::Pimpl : QObject {
30 public:
31         ///
32         Pimpl(Timeout * owner_);
33         /// start the timer
34         void start();
35         /// stop the timer
36         void stop();
37         /// reset
38         void reset();
39         /// is the timer running ?
40         bool running() const;
41
42 protected:
43         /// slot
44         virtual void timerEvent(QTimerEvent *);
45 private:
46         /// the owning timer
47         Timeout * owner_;
48         /// xforms id
49         int timeout_id;
50 };
51
52 #endif