]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/timer.h
Protected -> public
[wxWidgets.git] / include / wx / msw / timer.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: timer.h
3 // Purpose: wxTimer class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_TIMER_H_
13 #define _WX_TIMER_H_
14
15 #ifdef __GNUG__
16 #pragma interface "timer.h"
17 #endif
18
19 #include "wx/object.h"
20
21 class WXDLLEXPORT wxTimer : public wxObject
22 {
23 public:
24 wxTimer();
25 ~wxTimer();
26
27 virtual bool Start(int milliseconds = -1,
28 bool one_shot = FALSE); // Start timer
29 virtual void Stop(); // Stop timer
30
31 virtual void Notify() = 0; // Override this member
32
33 // Returns the current interval time (0 if stop)
34 int Interval() const { return milli; };
35 bool OneShot() const { return oneShot; }
36
37 public:
38 bool oneShot ;
39 int milli ;
40 int lastMilli ;
41
42 long id;
43
44 private:
45 DECLARE_ABSTRACT_CLASS(wxTimer)
46 };
47
48 // Timer functions (milliseconds)
49 void WXDLLEXPORT wxStartTimer();
50 // Gets time since last wxStartTimer or wxGetElapsedTime
51 long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
52
53 // EXPERIMENTAL: comment this out if it doesn't compile.
54 bool WXDLLEXPORT wxGetLocalTime(long *timeZone, int *dstObserved);
55
56 // Get number of seconds since 00:00:00 GMT, Jan 1st 1970.
57 long WXDLLEXPORT wxGetCurrentTime();
58
59 #endif
60 // _WX_TIMERH_