dolphin/Externals/wxWidgets3/include/wx/private/timer.h
Soren Jorvang d14efe561b Import r67258 of the wxWidgets trunk, which I expect will before
long become wxWidgets 2.9.2, which in turn is expected to be the
last 2.9 release before the 3.0 stable release.

Since the full wxWidgets distribution is rather large, I have
imported only the parts that we use, on a subdirectory basis:

art
include/wx/*.*
include/wx/aui
include/wx/cocoa
include/wx/generic
include/wx/gtk
include/wx/meta
include/wx/msw
include/wx/osx
include/wx/persist
include/wx/private
include/wx/protocol
include/wx/unix
src/aui
src/common
src/generic
src/gtk
src/msw
src/osx
src/unix


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7380 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-03-20 18:05:19 +00:00

73 lines
2.3 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: wx/private/timer.h
// Purpose: Base class for wxTimer implementations
// Author: Lukasz Michalski <lmichalski@sf.net>
// Created: 31.10.2006
// RCS-ID: $Id: timer.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 2006-2007 wxWidgets dev team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TIMERIMPL_H_BASE_
#define _WX_TIMERIMPL_H_BASE_
#include "wx/defs.h"
#include "wx/event.h"
#include "wx/timer.h"
// ----------------------------------------------------------------------------
// wxTimerImpl: abstract base class for wxTimer implementations
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxTimerImpl
{
public:
// default ctor, SetOwner() must be called after it (wxTimer does it)
wxTimerImpl(wxTimer *owner);
// this must be called initially but may be also called later
void SetOwner(wxEvtHandler *owner, int timerid);
// empty but virtual base class dtor, the caller is responsible for
// stopping the timer before it's destroyed (it can't be done from here as
// it's too late)
virtual ~wxTimerImpl() { }
// start the timer. When overriding call base version first.
virtual bool Start(int milliseconds = -1, bool oneShot = false);
// stop the timer, only called if the timer is really running (unlike
// wxTimer::Stop())
virtual void Stop() = 0;
// return true if the timer is running
virtual bool IsRunning() const = 0;
// this should be called by the port-specific code when the timer expires
virtual void Notify() { m_timer->Notify(); }
// the default implementation of wxTimer::Notify(): generate a wxEVT_TIMER
void SendEvent();
// accessors for wxTimer:
wxEvtHandler *GetOwner() const { return m_owner; }
int GetId() const { return m_idTimer; }
int GetInterval() const { return m_milli; }
bool IsOneShot() const { return m_oneShot; }
protected:
wxTimer *m_timer;
wxEvtHandler *m_owner;
int m_idTimer; // id passed to wxTimerEvent
int m_milli; // the timer interval
bool m_oneShot; // true if one shot
wxDECLARE_NO_COPY_CLASS(wxTimerImpl);
};
#endif // _WX_TIMERIMPL_H_BASE_