2002-03-11 22:47:41 +00:00
|
|
|
// -*- C++ -*-
|
2001-08-25 03:00:19 +00:00
|
|
|
/**
|
2002-03-11 22:47:41 +00:00
|
|
|
* \file qt2/Timeout_pimpl.h
|
2002-09-24 13:57:09 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2001-08-25 03:00:19 +00:00
|
|
|
*
|
|
|
|
* \author John Levon
|
2002-09-24 13:57:09 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2001-08-25 03:00:19 +00:00
|
|
|
*/
|
2002-03-11 22:47:41 +00:00
|
|
|
|
2001-08-25 03:00:19 +00:00
|
|
|
#ifndef TIMEOUTPIMPL_H
|
|
|
|
#define TIMEOUTPIMPL_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "frontends/Timeout.h"
|
2002-03-21 21:21:28 +00:00
|
|
|
#include <qobject.h>
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2001-08-25 03:00:19 +00:00
|
|
|
// stupid Qt
|
|
|
|
#undef emit
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-25 03:00:19 +00:00
|
|
|
/**
|
|
|
|
* This class executes the callback when the timeout expires
|
|
|
|
* using Qt mechanisms
|
|
|
|
*/
|
|
|
|
struct Timeout::Pimpl : QObject {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
Pimpl(Timeout * owner_);
|
|
|
|
/// start the timer
|
|
|
|
void start();
|
|
|
|
/// stop the timer
|
|
|
|
void stop();
|
|
|
|
/// reset
|
|
|
|
void reset();
|
2002-03-01 18:47:56 +00:00
|
|
|
/// is the timer running ?
|
2002-03-21 21:21:28 +00:00
|
|
|
bool running() const;
|
2001-08-25 03:00:19 +00:00
|
|
|
protected:
|
|
|
|
/// slot
|
|
|
|
virtual void timerEvent(QTimerEvent *);
|
|
|
|
private:
|
|
|
|
/// the owning timer
|
|
|
|
Timeout * owner_;
|
2002-09-26 08:57:43 +00:00
|
|
|
/// QTimer id
|
2001-08-25 03:00:19 +00:00
|
|
|
int timeout_id;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|