]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/timer.h
Added wxStream but I haven't tested them.
[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 and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __TIMERH__
13 #define __TIMERH_
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 DECLARE_DYNAMIC_CLASS(wxTimer)
24
25 public:
26 bool oneShot ;
27 int milli ;
28 int lastMilli ;
29
30 long id;
31 public:
32 wxTimer(void);
33 ~wxTimer(void);
34 virtual bool Start(int milliseconds = -1,bool one_shot = FALSE); // Start timer
35 virtual void Stop(void); // Stop timer
36 virtual void Notify(void) = 0; // Override this member
37 inline int Interval(void) { return milli ; }; // Returns the current interval time (0 if stop)
38 };
39
40 // Timer functions (milliseconds)
41 void WXDLLEXPORT wxStartTimer(void);
42 // Gets time since last wxStartTimer or wxGetElapsedTime
43 long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
44
45 // EXPERIMENTAL: comment this out if it doesn't compile.
46 bool WXDLLEXPORT wxGetLocalTime(long *timeZone, int *dstObserved);
47
48 // Get number of seconds since 00:00:00 GMT, Jan 1st 1970.
49 long WXDLLEXPORT wxGetCurrentTime(void);
50
51 #endif
52 // __TIMERH_