]> git.lyx.org Git - lyx.git/blob - src/frontends/Timeout.C
Remove WorkArea.C (empty).
[lyx.git] / src / frontends / Timeout.C
1 /**
2  * \file Timeout.C
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 #include "support/LAssert.h"
17
18 using namespace lyx::support;
19
20
21 Timeout::~Timeout()
22 {
23         pimpl_->stop();
24 }
25
26
27 bool Timeout::running() const
28 {
29         return pimpl_->running();
30 }
31
32
33 void Timeout::start()
34 {
35         pimpl_->start();
36 }
37
38
39 void Timeout::stop()
40 {
41         pimpl_->stop();
42 }
43
44
45 void Timeout::restart()
46 {
47         pimpl_->stop();
48         pimpl_->start();
49 }
50
51
52 void Timeout::emit()
53 {
54         pimpl_->reset();
55         timeout();
56         if (type == CONTINUOUS)
57                 pimpl_->start();
58 }
59
60
61 Timeout & Timeout::setType(Type t)
62 {
63         type = t;
64         return * this;
65 }
66
67
68 Timeout & Timeout::setTimeout(unsigned int msec)
69 {
70         // Can't have a timeout of zero!
71         Assert(msec);
72
73         timeout_ms = msec;
74         return * this;
75 }