📄 simpleclock.h
字号:
#include <e32base.h>
#ifndef _SIMPLE_CLOCK_
#define _SIMPLE_CLOCK_
class MClockObserver
{
public:
virtual void UpdateClock(TTime aTime) = 0;
};
//////////////////////////////////////////////////////////////////////////////
//
// -----> CSimpleClock (definition)
//
//////////////////////////////////////////////////////////////////////////////
class CSimpleClock : public CTimer
{
public:
// Construction
CSimpleClock();
// Destruction
~CSimpleClock();
public:
// Static construction
static CSimpleClock* NewL();
static CSimpleClock* NewLC(const TTime & aTime);
static CSimpleClock* NewL(const TTime & aTime);
public:
// Second phase construction
void ConstructL(const TTime & aTime);
// Cancel request
// Defined as pure virtual by CActive;
// implementation provided by this class.
void DoCancel();
// service completed request.
// Defined as pure virtual by CActive;
// implementation provided by this class.
void RunL();
void Start() ;
void Stop(){iStop = TRUE;}
//void SetObserver(MClockObserver * aObserver){iObserver = aObserver;}
void AddObserver(MClockObserver * aObserver);
void RemoveObserver(MClockObserver *aObserver);
void SetCurTime(TTime aTime) {iTime = aTime;}
TTime CurTime(){return iTime;}
protected:
// issue request
void IssueRequest();
private:
TTime iTime;
TBool iStop;
CArrayFixFlat<MClockObserver *> * iObservers;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -