]> git.lyx.org Git - lyx.git/blobdiff - src/Timeout.h
More fixes to insettabular/text (and some missing features added).
[lyx.git] / src / Timeout.h
index fb6797116af007ba64f668842392ba8a990be21e..9cecc49d7a43e8b615f829323d5b783ebf1a1ca5 100644 (file)
@@ -1,25 +1,46 @@
 // -*- C++ -*-
+/* This file is part of
+ * ====================================================== 
+ * 
+ *           LyX, The Document Processor
+ *        
+ *           Copyright 1995 Matthias Ettrich
+ *           Copyright 1995-2000 The LyX Team.
+ *
+ * ====================================================== */
+
 #ifndef TIMEOUT_H
 #define TIMEOUT_H
 
+#include <config.h>
+
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include <sigc++/signal_system.h>
+
+#ifdef SIGC_CXX_NAMESPACES
+using SigC::Signal0;
+#endif
+
 /** This class executes the callback when the timeout expires.
     This class currently uses a regular callback, later it will use
     signals and slots to provide the same.
 */
 class Timeout {
 public:
-       ///
-       typedef void (*TimeoutCallback)(void *);
-       
        ///
        enum Type {
+               ///
                ONETIME,
+               ///
                CONTINOUS
        };
        ///
        Timeout();
        ///
-       Timeout(int msec, Type = ONETIME);
+       Timeout(unsigned int msec, Type = ONETIME);
        ///
        ~Timeout();
        ///
@@ -29,24 +50,20 @@ public:
        ///
        void restart();
        ///
-       void callback(TimeoutCallback cb, void * data);
+       Signal0<void> timeout;
        ///
-       void callback();
+       void emit();
        ///
-       void setType(Type t);
+       Timeout & setType(Type t);
        ///
-       void setTimeout(int msec);
+       Timeout & setTimeout(unsigned int msec);
 private:
        ///
        Type type;
        ///
-       int timeout;
+       unsigned int timeout_ms;
        ///
        int timeout_id;
-       ///
-       TimeoutCallback callback_;
-       ///
-       void * data_;
 };
 
 #endif