2002-03-11 22:47:41 +00:00
|
|
|
// -*- C++ -*-
|
2001-08-25 03:00:19 +00:00
|
|
|
/**
|
2003-02-22 18:01:16 +00:00
|
|
|
* \file qtTimeout.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
|
|
|
*
|
2003-08-23 00:17:00 +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
|
|
|
|
2003-02-22 18:01:16 +00:00
|
|
|
#ifndef QTTIMEOUT_H
|
|
|
|
#define QTTIMEOUT_H
|
2001-08-25 03:00:19 +00:00
|
|
|
|
|
|
|
#include "frontends/Timeout.h"
|
2003-02-25 13:35:26 +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
|
|
|
|
*/
|
2005-01-19 15:03:31 +00:00
|
|
|
class qtTimeout : QObject, public Timeout::Impl {
|
2001-08-25 03:00:19 +00:00
|
|
|
public:
|
|
|
|
///
|
2003-02-22 18:01:16 +00:00
|
|
|
qtTimeout(Timeout & owner_);
|
|
|
|
///
|
|
|
|
virtual bool running() const;
|
2001-08-25 03:00:19 +00:00
|
|
|
/// start the timer
|
2003-02-22 18:01:16 +00:00
|
|
|
virtual void start();
|
2001-08-25 03:00:19 +00:00
|
|
|
/// stop the timer
|
2003-02-22 18:01:16 +00:00
|
|
|
virtual void stop();
|
2001-08-25 03:00:19 +00:00
|
|
|
/// reset
|
2003-02-22 18:01:16 +00:00
|
|
|
virtual void reset();
|
|
|
|
|
2001-08-25 03:00:19 +00:00
|
|
|
protected:
|
|
|
|
/// slot
|
|
|
|
virtual void timerEvent(QTimerEvent *);
|
2003-02-22 18:01:16 +00:00
|
|
|
|
2001-08-25 03:00:19 +00:00
|
|
|
private:
|
2003-02-22 18:01:16 +00:00
|
|
|
/// timout id
|
2001-08-25 03:00:19 +00:00
|
|
|
int timeout_id;
|
|
|
|
};
|
|
|
|
|
2003-02-22 18:01:16 +00:00
|
|
|
#endif // QTTIMEOUT_H
|