]> git.saurik.com Git - wxWidgets.git/blame - include/wx/qt/timer.h
1. some minor but nasty bugs fixed (see post to the list)
[wxWidgets.git] / include / wx / qt / timer.h
CommitLineData
7c78e7c7
RR
1/////////////////////////////////////////////////////////////////////////////
2// Name: timer.h
01b2eeec
KB
3// Purpose: wxTimer class
4// Author: AUTHOR
5// Modified by:
6// Created: ??/??/98
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
03f38c58 9// Licence: wxWindows licence
7c78e7c7
RR
10/////////////////////////////////////////////////////////////////////////////
11
01b2eeec
KB
12#ifndef _WX_TIMER_H_
13#define _WX_TIMER_H_
7c78e7c7
RR
14
15#ifdef __GNUG__
01b2eeec 16#pragma interface "timer.h"
7c78e7c7
RR
17#endif
18
7c78e7c7
RR
19#include "wx/object.h"
20
01b2eeec 21class WXDLLEXPORT wxTimer: public wxObject
7c78e7c7 22{
03f38c58
VZ
23public:
24 wxTimer();
25 ~wxTimer();
7c78e7c7 26
03f38c58
VZ
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; }
01b2eeec
KB
36
37protected:
03f38c58
VZ
38 bool oneShot ;
39 int milli ;
40 int lastMilli ;
41
42 long id;
01b2eeec 43
03f38c58
VZ
44private:
45 DECLARE_ABSTRACT_CLASS(wxTimer)
7c78e7c7
RR
46};
47
01b2eeec
KB
48/* Note: these are implemented in common/timercmn.cpp, so need to implement them separately.
49 * But you may need to modify timercmn.cpp.
50 */
51
52// Timer functions (milliseconds)
53void WXDLLEXPORT wxStartTimer();
54// Gets time since last wxStartTimer or wxGetElapsedTime
55long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
56
57// EXPERIMENTAL: comment this out if it doesn't compile.
58bool WXDLLEXPORT wxGetLocalTime(long *timeZone, int *dstObserved);
59
60// Get number of seconds since 00:00:00 GMT, Jan 1st 1970.
61long WXDLLEXPORT wxGetCurrentTime();
62
63#endif
64 // _WX_TIMER_H_