mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 21:49:51 +00:00
6c300f72a2
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15422 a592a061-630c-0410-9148-cb99ea01b6c8
78 lines
913 B
C
78 lines
913 B
C
/**
|
|
* \file Timeout.C
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Lars Gullik Bjønnes
|
|
* \author John Levon
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#include "Timeout.h"
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
Timeout::~Timeout()
|
|
{
|
|
pimpl_->stop();
|
|
}
|
|
|
|
|
|
bool Timeout::running() const
|
|
{
|
|
return pimpl_->running();
|
|
}
|
|
|
|
|
|
void Timeout::start()
|
|
{
|
|
pimpl_->start();
|
|
}
|
|
|
|
|
|
void Timeout::stop()
|
|
{
|
|
pimpl_->stop();
|
|
}
|
|
|
|
|
|
void Timeout::restart()
|
|
{
|
|
pimpl_->stop();
|
|
pimpl_->start();
|
|
}
|
|
|
|
|
|
void Timeout::emit()
|
|
{
|
|
pimpl_->reset();
|
|
timeout();
|
|
if (type == CONTINUOUS)
|
|
pimpl_->start();
|
|
}
|
|
|
|
|
|
Timeout & Timeout::setType(Type t)
|
|
{
|
|
type = t;
|
|
return * this;
|
|
}
|
|
|
|
|
|
Timeout & Timeout::setTimeout(unsigned int msec)
|
|
{
|
|
// Can't have a timeout of zero!
|
|
BOOST_ASSERT(msec);
|
|
|
|
timeout_ms = msec;
|
|
return * this;
|
|
}
|
|
|
|
|
|
} // namespace lyx
|