]> git.saurik.com Git - wxWidgets.git/blob - include/wx/cocoa/timer.h
Expand tabs
[wxWidgets.git] / include / wx / cocoa / timer.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: timer.h
3 // Purpose: Cocoa wxTimer class
4 // Author: Ryan Norton
5 // Id: $Id$
6 // Copyright: (c) Ryan Norton
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10
11 #ifndef __WX_TIMER_H__
12 #define __WX_TIMER_H__
13
14 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
15 #pragma interface "timer.h"
16 #endif
17
18 #include "wx/cocoa/ObjcRef.h"
19
20 //-----------------------------------------------------------------------------
21 // wxTimer
22 //-----------------------------------------------------------------------------
23
24 DECLARE_WXCOCOA_OBJC_CLASS(NSTimer);
25
26 class WXDLLEXPORT wxTimer : public wxTimerBase
27 {
28 public:
29 wxTimer() { Init(); }
30 wxTimer(wxEvtHandler *owner, int timerid = -1) : wxTimerBase(owner, timerid)
31 { Init(); }
32 ~wxTimer();
33
34 virtual bool Start(int millisecs = -1, bool oneShot = false);
35 virtual void Stop();
36
37 virtual bool IsRunning() const;
38
39 inline WX_NSTimer GetNSTimer()
40 { return m_cocoaNSTimer; }
41
42 protected:
43 void Init();
44
45 private:
46 WX_NSTimer m_cocoaNSTimer;
47 static const wxObjcAutoRefFromAlloc<struct objc_object *> sm_cocoaDelegate;
48
49 DECLARE_ABSTRACT_CLASS(wxTimer)
50 };
51
52 #endif // __WX_TIMER_H__