]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/timer.h
Reworked the undef stuff a little
[wxWidgets.git] / include / wx / gtk / timer.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: timer.h
3// Purpose:
4// Author: Robert Roebling
58614078
RR
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
c801d85f
KB
7// Licence: wxWindows licence
8/////////////////////////////////////////////////////////////////////////////
9
10
11#ifndef __GTKTIMERH__
12#define __GTKTIMERH__
13
14#ifdef __GNUG__
15#pragma interface
16#endif
17
18#include "wx/defs.h"
19#include "wx/object.h"
20
21//-----------------------------------------------------------------------------
22// derived classes
23//-----------------------------------------------------------------------------
24
25class wxTimer;
26
bbe0af5b
RR
27//-----------------------------------------------------------------------------
28// global functions
29//-----------------------------------------------------------------------------
30
31/* Timer functions (milliseconds) */
32void wxStartTimer();
33
34/* Gets time since last wxStartTimer or wxGetElapsedTime */
35long wxGetElapsedTime(bool resetTimer = TRUE);
36
37/* EXPERIMENTAL: comment this out if it doesn't compile. */
38bool wxGetLocalTime(long *timeZone, int *dstObserved);
39
40/* Get number of seconds since 00:00:00 GMT, Jan 1st 1970. */
41long wxGetCurrentTime();
42
c801d85f
KB
43//-----------------------------------------------------------------------------
44// wxTimer
45//-----------------------------------------------------------------------------
46
47class wxTimer: public wxObject
48{
03f38c58
VZ
49public:
50 wxTimer();
51 ~wxTimer();
52
53 int Interval() const { return m_time; }
54
55 bool OneShot() const { return m_oneShot; }
56
57 virtual bool Start( int millisecs = -1, bool oneShot = FALSE );
58 virtual void Stop();
59
60 virtual void Notify() = 0; // override this
61
62protected:
c801d85f
KB
63 int m_tag;
64 int m_time;
65 bool m_oneShot;
03f38c58
VZ
66
67private:
68 DECLARE_ABSTRACT_CLASS(wxTimer)
c801d85f
KB
69};
70
71#endif // __GTKTIMERH__