⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 haneaseengine.h

📁 三字经输入法源码
💻 H
字号:
#ifndef HANEASEENGINE_H
#define HANEASEENGINE_H

// INCLUDES
#include <e32base.h>
#include <e32std.h>
#include <coedef.h>

// Forward declarations
class CHaneaseFepControl;
class CHaneaseTimer;

class MTimerNotifier
    {
public:
    virtual void OnTimer() = 0;
    };

class CHaneaseEngine : public CBase, MTimerNotifier
{
	public:
		CHaneaseEngine(CHaneaseFepControl& aControl, TDes16& aInput, CArrayFix<TUint> &aCand, CArrayFix<TUint> &aOutput);
		~CHaneaseEngine();
		  // Static construction
		static CHaneaseEngine* NewL (CHaneaseFepControl& aControl, TDes16& aInput, CArrayFix<TUint> &aCand, CArrayFix<TUint> &aOutput);

		  // Second phase construction
		void ConstructL();
		
		void AppenChar(TInt aKeyCode);
		
		void ChangeLastChar(TInt aKeyCode);
		
		TKeyResponse DelChar();
		
		void CommitCand();
		
		void PrePage();
		
		void NextPage();
		
		void PreCand();
		
		void NextCand();

		void MakeCandArray();
		
		void MakeCand();
		
		TKeyResponse OnKey(TInt aKeyCode);
		void OnTimer();

	private:
		CHaneaseFepControl&			iFepControl;	// not owned
		TDes16& iInput;
		CArrayFix<TUint> &iCand;
		CArrayFix<TUint> &iOutput;

		CHaneaseTimer *iTimer;
		TInt iPrekey;
		TInt iKeyPos;
		
		TInt iStart;
		TInt iEnd;
		TInt iCur;
		
};


class CMultiTapEngine : public CBase, MTimerNotifier
{
	public:
		CMultiTapEngine(CHaneaseFepControl& aControl, TDes16& aInput, CArrayFix<TUint> &aCand, CArrayFix<TUint> &aOutput);
		~CMultiTapEngine();
		  // Static construction
		static CMultiTapEngine* NewL (CHaneaseFepControl& aControl, TDes16& aInput, CArrayFix<TUint> &aCand, CArrayFix<TUint> &aOutput);

		  // Second phase construction
		void ConstructL();
		
		TKeyResponse OnKey(TInt aKeyCode);
		void CommitInput();
		void OnTimer();

	private:
		CHaneaseFepControl&			iFepControl;	// not owned
		TDes16& iInput;
		CArrayFix<TUint> &iCand;
		CArrayFix<TUint> &iOutput;

		CHaneaseTimer *iTimer;
		TInt iPrekey;
		TInt iKeyPos;
};

class CHaneaseTimer : public CTimer
{
public:
	CHaneaseTimer();
	void ConstructL(MTimerNotifier *aEngine);
	void RunL();
	void Restart();
	
private:
    MTimerNotifier *iEngine;
};

#endif // HANEASEENGINE_H

// end of file

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -