LyX 1.5.0 is released
[lyx.git] / src / frontends / Timeout.cpp
blob7ef659b3d9482d6e2c5411cb61639e41791b0ff7
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.
6 * \author Lars Gullik Bjønnes
7 * \author John Levon
9 * Full author contact details are available in file CREDITS.
12 #include <config.h>
14 #include "Timeout.h"
17 namespace lyx {
20 Timeout::~Timeout()
22 pimpl_->stop();
26 bool Timeout::running() const
28 return pimpl_->running();
32 void Timeout::start()
34 pimpl_->start();
38 void Timeout::stop()
40 pimpl_->stop();
44 void Timeout::restart()
46 pimpl_->stop();
47 pimpl_->start();
51 void Timeout::emit()
53 pimpl_->reset();
54 timeout();
55 if (type == CONTINUOUS)
56 pimpl_->start();
60 Timeout & Timeout::setType(Type t)
62 type = t;
63 return * this;
67 Timeout & Timeout::setTimeout(unsigned int msec)
69 // Can't have a timeout of zero!
70 BOOST_ASSERT(msec);
72 timeout_ms = msec;
73 return * this;
77 } // namespace lyx