📄 alarmtimer.h
字号:
/*
* ============================================================================
* Name : CAlarmTimer from AlarmTimer.h
* Part of : Alarm
* Created : 05.02.2006 by ToBeReplacedByAuthor
* Description:
* Declares the timer engine class.
* Version :
* Copyright: ToBeReplacedByCopyright
* ============================================================================
*/
#ifndef __ALARM_TIMER_H__
#define __ALARM_TIMER_H__
// INCLUDES
#include <e32base.h> // for CTimer
// FORWARD DECLARATIONS
// CLASS DECLARATIONS
/**
* A simple timer with observer.
*/
class CAlarmTimer : public CTimer
{
public: // interface
/**
* The object which wants to receive timer event will implements
* this interface
*/
class MObserver
{
public:
/**
* Called when timer request completed
* @param aError The error code
*/
virtual void OnTimerL(TInt aError) = 0;
};
public: // standard construction sequence
/**
* Create a CAlarmTimer object
* @param aObserver The timer event observer
* @result a pointer to the created instance of CAlarmTimer
*/
static CAlarmTimer* NewL(MObserver& aObserver);
/**
* Create a CAlarmTimer object
* @param aObserver The timer event observer
* @result a pointer to the created instance of CAlarmTimer
*/
static CAlarmTimer* NewLC(MObserver& aObserver);
/**
* Destroy the object and release all memory objects
*/
~CAlarmTimer();
public: // new functions
void Start(const TTime& aTime);
void Stop();
private: // standard construction sequence
/**
* Perform the first phase of two phase construction
* @param aObserver The timer event observer
*/
CAlarmTimer(MObserver& aObserver);
/**
* Perform the second phase construction of
*/
void ConstructL();
private: //from CActive
/**
* Used to trigger timer event
*/
void RunL();
private: // member variables
/**
* The timer event observer
*/
MObserver& iObserver;
};
#endif // __ALARM_TIMER_H__
// End Of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -