timer.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #ifndef _WX_COCOA_PRIVATE_TIMER_H_
  9. #define _WX_COCOA_PRIVATE_TIMER_H_
  10. #include "wx/private/timer.h"
  11. #include "wx/cocoa/ObjcRef.h"
  12. //-----------------------------------------------------------------------------
  13. // wxTimer
  14. //-----------------------------------------------------------------------------
  15. DECLARE_WXCOCOA_OBJC_CLASS(NSTimer);
  16. class WXDLLIMPEXP_CORE wxCocoaTimerImpl : public wxTimerImpl
  17. {
  18. public:
  19. wxCocoaTimerImpl(wxTimer* timer) : wxTimerImpl(timer) { Init(); }
  20. virtual ~wxCocoaTimerImpl();
  21. virtual bool Start(int millisecs = -1, bool oneShot = false);
  22. virtual void Stop();
  23. virtual bool IsRunning() const;
  24. WX_NSTimer GetNSTimer() { return m_cocoaNSTimer; }
  25. protected:
  26. void Init();
  27. private:
  28. WX_NSTimer m_cocoaNSTimer;
  29. };
  30. #endif // _WX_COCOA_PRIVATE_TIMER_H_