📄 essentials.h
字号:
// Copyright (C) UIQ Technology AB, 2007
//
// This material is provided "as is" without any warranty to its performance or functionality.
// In no event shall UIQ Technology be liable for any damages whatsoever arising out of the
// use or inabilty to use this material.
#ifndef __ESSENTIALS_H__
#define __ESSENTIALS_H__
#include <f32file.h>
class MPolygon
{
public:
virtual TInt CalculateNumberOfVerticesL() =0;
virtual ~MPolygon();
};
class CSquare : public CBase, public MPolygon
{
public:
static CSquare* NewL();
virtual TInt CalculateNumberOfVerticesL();
virtual ~CSquare();
private:
CSquare();
};
class CNotifyChange : public CActive
{
public:
~CNotifyChange();
static CNotifyChange* NewL(const TDesC& aPath);
void StartFilesystemMonitor();
protected:
CNotifyChange();
void ConstructL(const TDesC& aPath);
protected: // From CActive
virtual void RunL();
virtual void DoCancel();
virtual TInt RunError(TInt aError);
private:
RFs iFs;
HBufC* iPath;
TInt iChanges;
};
class TLongRunningCalculation
{
public:
TLongRunningCalculation() {iState=EWaiting;};
void StartCalculation(); // Initialization before starting the task
void DoTaskStep(); // Perform a short task step
TBool ContinueTask(); // Destroy intermediate data
void CancelCalculation() {iState=EWaiting;};
enum TCalcState { EWaiting, EBeginState, EIntermediateState, EFinalState };
TCalcState iState;
};
class CBackgroundTask : public CActive
{
public:
static CBackgroundTask* NewLC();
~CBackgroundTask(){};
public:
void PerformRecalculation(TRequestStatus& aStatus);
void CancelTask();
protected:
CBackgroundTask();
void ConstructL();
void SelfComplete();
protected: // From CActive
virtual void RunL();
virtual void DoCancel();
private:
TLongRunningCalculation iCalc;
TBool iMoreToDo;
TRequestStatus* iCallerStatus; // To notify caller on completion
};
class CExampleActive : public CActive
{
public:
static CExampleActive* NewLC(CBackgroundTask& aTask);
~CExampleActive(){Cancel();};
protected:
CExampleActive(CBackgroundTask& aTask);
void ConstructL();
protected: // From CActive
void RunL();
void DoCancel();
private:
CBackgroundTask& iTask;
};
#endif // __ESSENTIALS_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -