]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/Timeout_pimpl.h
Some string(widget->text()) fixes. Weirdness
[lyx.git] / src / frontends / qt2 / Timeout_pimpl.h
1 // -*- C++ -*-
2 /**
3  * \file qt2/Timeout_pimpl.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 TIMEOUTPIMPL_H
13 #define TIMEOUTPIMPL_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "frontends/Timeout.h"
20 #include <qobject.h>
21
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 protected:
42         /// slot
43         virtual void timerEvent(QTimerEvent *);
44 private:
45         /// the owning timer
46         Timeout * owner_;
47         /// QTimer id
48         int timeout_id;
49 };
50
51 #endif