mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 13:46:43 +00:00
1e39473100
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4281 a592a061-630c-0410-9148-cb99ea01b6c8
77 lines
901 B
C
77 lines
901 B
C
/**
|
|
* \file Timeout.C
|
|
* Copyright 2001 LyX Team
|
|
* Read COPYING
|
|
*
|
|
* \author Lars Gullik Bjønnes
|
|
* \author John Levon
|
|
*/
|
|
#ifdef __GNUG__
|
|
#pragma implementation
|
|
#endif
|
|
|
|
#include <config.h>
|
|
|
|
#include "Timeout.h"
|
|
#include "debug.h"
|
|
|
|
#include "Timeout_pimpl.h"
|
|
|
|
|
|
Timeout::Timeout(unsigned int msec, Type t)
|
|
: type(t), timeout_ms(msec)
|
|
{
|
|
pimpl_ = new Pimpl(this);
|
|
}
|
|
|
|
|
|
Timeout::~Timeout()
|
|
{
|
|
pimpl_->stop();
|
|
delete pimpl_;
|
|
}
|
|
|
|
|
|
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)
|
|
{
|
|
timeout_ms = msec;
|
|
return * this;
|
|
}
|