]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/Timeout_pimpl.h
5d94ff9b33ab781953b88348fe49a39124f038b1
[lyx.git] / src / frontends / qt2 / Timeout_pimpl.h
1 /**
2  * \file Timeout_pimpl.h
3  * Copyright 2001 LyX Team
4  * Read COPYING
5  *
6  * \author John Levon
7  */
8 #ifndef TIMEOUTPIMPL_H
9 #define TIMEOUTPIMPL_H
10
11 #include <config.h>
12
13 #ifdef __GNUG__
14 #pragma interface
15 #endif
16
17 #include "frontends/Timeout.h"
18
19 #include <sigc++/signal_system.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