]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/Timeout_pimpl.C
small cleanup, doxygen, formatting changes
[lyx.git] / src / frontends / kde / Timeout_pimpl.C
1 /**
2  * \file 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 void Timeout::Pimpl::start()
40 {
41         if (timeout_id != -1)
42                 lyxerr << "Timeout::start: already running!" << endl;
43         timeout_id = startTimer(owner_->timeout_ms);
44 }
45         
46
47 void Timeout::Pimpl::stop()
48 {
49         if (timeout_id != -1)
50                 reset();
51 }