]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GTimeout.h
Joao latest bits
[lyx.git] / src / frontends / gtk / GTimeout.h
1 // -*- C++ -*-
2 /**
3  * \file gtk/GTimeout.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Baruch Even
8  * \author Huang Ying
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef GTIMEOUT_H
14 #define GTIMEOUT_H
15
16 #include "frontends/Timeout.h"
17
18 #include <sigc++/sigc++.h>
19
20 /**
21  * This class executes the callback when the timeout expires
22  * using Gtk mechanisms
23  */
24 class GTimeout : public Timeout::Impl, public SigC::Object {
25 public:
26         ///
27         GTimeout(Timeout & owner_);
28         /// start the timer
29         void start();
30         /// stop the timer
31         void stop();
32         /// reset
33         void reset();
34         /// Is the timer running?
35         bool running() const;
36
37 public:
38         /// The timeout signal, this gets called when the timeout passed.
39         bool timeoutEvent();
40 private:
41         /// Timer connection
42         SigC::Connection conn_;
43         /// Used for running as SigC::Connection::connected() isn't const
44         bool running_;
45 };
46
47 #endif