]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/cocoa/private/timer.h | |
3 | // Purpose: Cocoa wxTimer class | |
4 | // Author: Ryan Norton | |
5 | // Copyright: (c) Ryan Norton | |
6 | // Licence: wxWindows licence | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | #ifndef _WX_COCOA_PRIVATE_TIMER_H_ | |
10 | #define _WX_COCOA_PRIVATE_TIMER_H_ | |
11 | ||
12 | #include "wx/private/timer.h" | |
13 | ||
14 | #include "wx/cocoa/ObjcRef.h" | |
15 | ||
16 | //----------------------------------------------------------------------------- | |
17 | // wxTimer | |
18 | //----------------------------------------------------------------------------- | |
19 | ||
20 | DECLARE_WXCOCOA_OBJC_CLASS(NSTimer); | |
21 | ||
22 | class WXDLLIMPEXP_CORE wxCocoaTimerImpl : public wxTimerImpl | |
23 | { | |
24 | public: | |
25 | wxCocoaTimerImpl(wxTimer* timer) : wxTimerImpl(timer) { Init(); } | |
26 | virtual ~wxCocoaTimerImpl(); | |
27 | ||
28 | virtual bool Start(int millisecs = -1, bool oneShot = false); | |
29 | virtual void Stop(); | |
30 | ||
31 | virtual bool IsRunning() const; | |
32 | ||
33 | WX_NSTimer GetNSTimer() { return m_cocoaNSTimer; } | |
34 | ||
35 | protected: | |
36 | void Init(); | |
37 | ||
38 | private: | |
39 | WX_NSTimer m_cocoaNSTimer; | |
40 | }; | |
41 | ||
42 | #endif // _WX_COCOA_PRIVATE_TIMER_H_ |