]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/Timeout_pimpl.C
doxygen fixes
[lyx.git] / src / frontends / qt2 / Timeout_pimpl.C
1 /**
2  * \file qt2/Timeout_pimpl.C
3  * Copyright 2001 LyX Team
4  * Read COPYING
5  *
6  * \author John Levon
7  */
8
9 #ifdef __GNUG__
10 #pragma implementation
11 #endif
12
13 #include <config.h>
14
15 #include "Timeout_pimpl.h"
16 #include "debug.h"
17
18 using std::endl;
19
20 Timeout::Pimpl::Pimpl(Timeout * owner)
21         : owner_(owner), timeout_id(-1)
22 {
23 }
24
25
26 void Timeout::Pimpl::timerEvent(QTimerEvent *)
27 {
28         owner_->emit();
29 }
30  
31
32 void Timeout::Pimpl::reset()
33 {
34         killTimers();
35         timeout_id = -1;
36 }
37
38
39 bool Timeout::Pimpl::running() const
40 {
41         return timeout_id != -1;
42 }
43
44  
45 void Timeout::Pimpl::start()
46 {
47         if (running())
48                 lyxerr << "Timeout::start: already running!" << endl;
49         timeout_id = startTimer(owner_->timeout_ms);
50 }
51         
52
53 void Timeout::Pimpl::stop()
54 {
55         if (running())
56                 reset();
57 }