]> git.lyx.org Git - lyx.git/blob - src/frontends/Timeout.C
Rename .C ==> .cpp for files in src/frontends, part one
[lyx.git] / src / frontends / Timeout.C
1 /**
2  * \file Timeout.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "Timeout.h"
15
16
17 namespace lyx {
18
19
20 Timeout::~Timeout()
21 {
22         pimpl_->stop();
23 }
24
25
26 bool Timeout::running() const
27 {
28         return pimpl_->running();
29 }
30
31
32 void Timeout::start()
33 {
34         pimpl_->start();
35 }
36
37
38 void Timeout::stop()
39 {
40         pimpl_->stop();
41 }
42
43
44 void Timeout::restart()
45 {
46         pimpl_->stop();
47         pimpl_->start();
48 }
49
50
51 void Timeout::emit()
52 {
53         pimpl_->reset();
54         timeout();
55         if (type == CONTINUOUS)
56                 pimpl_->start();
57 }
58
59
60 Timeout & Timeout::setType(Type t)
61 {
62         type = t;
63         return * this;
64 }
65
66
67 Timeout & Timeout::setTimeout(unsigned int msec)
68 {
69         // Can't have a timeout of zero!
70         BOOST_ASSERT(msec);
71
72         timeout_ms = msec;
73         return * this;
74 }
75
76
77 } // namespace lyx