]> git.lyx.org Git - lyx.git/blob - src/Timeout.h
make doc++ able to generate the source documentation for lyx
[lyx.git] / src / Timeout.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *        
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2000 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef TIMEOUT_H
13 #define TIMEOUT_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include <sigc++/signal_system.h>
20
21 #ifdef SIGC_CXX_NAMESPACES
22 using SigC::Signal0;
23 #endif
24
25 /** This class executes the callback when the timeout expires.
26     This class currently uses a regular callback, later it will use
27     signals and slots to provide the same.
28 */
29 class Timeout {
30 public:
31         ///
32         enum Type {
33                 ///
34                 ONETIME,
35                 ///
36                 CONTINOUS
37         };
38         ///
39         Timeout();
40         ///
41         Timeout(int msec, Type = ONETIME);
42         ///
43         ~Timeout();
44         ///
45         void start();
46         ///
47         void stop();
48         ///
49         void restart();
50         ///
51         Signal0<void> timeout;
52         ///
53         void emit();
54         ///
55         void setType(Type t);
56         ///
57         void setTimeout(int msec);
58 private:
59         ///
60         Type type;
61         ///
62         int timeout_ms;
63         ///
64         int timeout_id;
65 };
66
67 #endif