亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? activeobjectexample.cpp

?? 基于SYMBIAN的活動對象最經典的開發程序,對學習諾基亞平臺的人很有幫助,請支持一下本網站,真的很不錯!
?? CPP
字號:

//ActiveObjecExample.cpp

//Author:LiuLiPing
//version 1.0
//Date: 2006-1-25
//Example for showing you input words and if you press "Enter" showing how many
//you have inputed.

#include <e32cons.h>

LOCAL_D CConsoleBase* console;    // All messages written to this

// Function prototypes
 void callExampleL();
 void doExampleL();

//Static variable for count-switch-variable and count how many word you have inputed 
static TInt word;
static TInt num;

//////////////////////////////////////////////////////////////////////////////
//
//       CWord (definition)
//
// A class for print and count the word number
//
//////////////////////////////////////////////////////////////////////////////

class CWord:public CBase
{
public:
	static CWord* NewL(TInt aMaxLength);
	static CWord* NewLC(TInt aMaxLength);
private:
	CWord(TInt aMaxLength);
	void ConstructL(TInt aMaxLength);
public:
	TInt WordNumCountL(TChar aChar);	//Count the number of you input word
	void OutputWord();					//Outputing you input word
	TInt WordNum();						//return the number of the word that you input
	TInt Length();						//return the length of the curent word you have input
	TInt MaxLength();					//return the maxlenght of the word for limited your 
										//inputing and printing the word
	~CWord();
private:
	TInt iLength;
	TInt iMaxLength;
	HBufC* iHBufC;
};

//////////////////////////////////////////////////////////////////////////////
//
//       CAOExample (definition)
//
//////////////////////////////////////////////////////////////////////////////

class CAOExample:public CActive
{
public:
	static CAOExample* NewL(CConsoleBase* aConsole);
	static CAOExample* NewLC(CConsoleBase* aConsole);
private:
	CAOExample();
	void ConstructL(CConsoleBase* aConsole);
public:
	void Start();
	void PrintWord();					//Print the word
	void PrintWordNum();				//Print the number of the word
	void KeyPressInput(TChar aChar);	//process the key press input
	~CAOExample();
private:
	void RunL();
	void Cancel();
	void DoCancel();
private:
	CConsoleBase* iConsole;
	CWord* iCWord;

};

////////////////////////////////////////////////////////////////////////////////
//
//		CWord implement
// 
////////////////////////////////////////////////////////////////////////////////

CWord* CWord::NewL(TInt aMaxLength)
{
   CWord* self = NewLC(aMaxLength);
   CleanupStack::Pop(self);
   return self;
}
CWord* CWord::NewLC(TInt aMaxLength)
{
   CWord* self = new(ELeave) CWord(aMaxLength);
   CleanupStack::PushL(self);
   self->ConstructL(aMaxLength);
   return self;
}

void CWord::ConstructL(TInt aMaxLength)
{
   iHBufC = HBufC::NewL(aMaxLength);
}

CWord::CWord(TInt aMaxLength)
{
   iMaxLength = aMaxLength;
   iLength = 0;
}

TInt CWord::WordNumCountL(TChar aChar)
{
   TPtr ptr=iHBufC->Des();//Des():Creates and returns an modifiable pointer descriptor for the data represented by this heap descriptor.
   if(iLength<iMaxLength)
   {
	  ptr.Append(aChar);		 
	  if(!('A'<=aChar && aChar <='Z' || 'a'<=aChar && aChar <='z'))//if your input is not a letter
	  {
		 word = 0;
	  }
	  if('A'<=aChar && aChar <='Z' || 'a'<=aChar && aChar <='z')//if your input is a letter
	  {
     	 if(word==0)
		 {
		    word=1;
			++num;		//sum up the number of word 
		 }
      
	  }
	  iLength++;
      return 1;
   }
	else 
	  return 0;
}

void CWord::OutputWord()
{
   console->Printf(iHBufC->Des());
   iHBufC->Des().Zero();			//Sets the length of the data to zero
   iLength = 0;
}

TInt CWord::WordNum()
{
   return num;
}

TInt CWord::Length()
{
    return iLength;
}

TInt CWord::MaxLength()
{
    return iMaxLength;
}

CWord::~CWord()
{
   delete iHBufC;
   iHBufC = NULL;
   iLength = 0;
   iMaxLength = 0;
}

////////////////////////////////////////////////////////////////////////////////
//
//		CAOExample implement
// 
////////////////////////////////////////////////////////////////////////////////

CAOExample* CAOExample::NewL(CConsoleBase* aConsole)
{
   CAOExample* self =  NewLC(aConsole);
   CleanupStack::Pop(self);
   return self;
}

CAOExample* CAOExample::NewLC(CConsoleBase* aConsole)
{
   CAOExample* self = new(ELeave) CAOExample();
   CleanupStack::PushL(self);
   self->ConstructL(aConsole);
   return self;
}

void CAOExample::ConstructL(CConsoleBase* aConsole)
{
   iConsole = aConsole;
   iCWord = CWord::NewL(1);
   CActiveScheduler::Add(this);
}

CAOExample::CAOExample():CActive(EPriorityStandard)
{
}
void CAOExample::Start()
{
   iConsole->Read(iStatus);
   SetActive();
}

void CAOExample::PrintWord()
{
	iCWord->OutputWord();
}

void CAOExample::PrintWordNum()
{
	_LIT(KPrint,"You Input %d Word!\n");	//define the output format
	console->Printf(KPrint,iCWord->WordNum());
	//console->Printf(_L("If you want to know how many word you input please press \"Enter\"!"));
	console->Printf(_L("Please input the new word!\n"));
}

void CAOExample::KeyPressInput(TChar aChar)
{
	//if(aChar != EKeyEscape)
	//{
	iCWord->WordNumCountL(aChar);
	if(iCWord->Length() == iCWord->MaxLength())
	{
	   PrintWord();
	}
	if(aChar == EKeyEnter)
	{
		PrintWordNum();
		word = 0;
		num = 0;
	}
    Start();
	//}
	//else
	//{
	//	Cancel();
    //    CActiveScheduler::Stop();
	//}
 
}

void CAOExample::RunL()
{
   KeyPressInput((TChar)iConsole->KeyCode());
}

void CAOExample::Cancel()
{
   DoCancel();
}

void CAOExample::DoCancel()
{
   iConsole->ReadCancel(); //Cancels any pending Read() operations
}

CAOExample::~CAOExample()
{
	delete iCWord;
	iCWord = NULL;
	iConsole = NULL;
}

GLDEF_C TInt E32Main()
{
	
   CTrapCleanup* cleanup=CTrapCleanup::New();	// Get cleanup stack
   TRAPD(error,doExampleL());					// callExampleL() should never leave.
   _LIT(KMsgPanicEpoc32ex,"EPOC32EX");
   __ASSERT_ALWAYS(!error,User::Panic(KMsgPanicEpoc32ex,error));
   delete cleanup;								// destroy the cleanup stack
   return 0;									// return
    }

////////////////////////////////////////////////////////////////////////////////
//
//		doExample() implement
// 
////////////////////////////////////////////////////////////////////////////////

void doExampleL()
{
  	_LIT(KMsgExampleCode,"Symbian OS AOExample");
	console = Console::NewL(KMsgExampleCode,TSize(KConsFullScreen,KConsFullScreen));
	CleanupStack::PushL(console);		// Put console onto the cleanup stack.
	int error;
	TRAP(error,callExampleL());			//TRAPD(error,callExampleL());
	    if(error)
	{
		_LIT(KERROR,"error occured!\n");
		console->Printf(KERROR);
	}
	else{
      _LIT(KNOLEAVE,"No Leave!\n");
		console->Printf(KNOLEAVE);
	}
	console->Getch();
	CleanupStack::PopAndDestroy();		//Remove the cleanupstack and destroy
}

////////////////////////////////////////////////////////////////////////////////
//
//		callExample() implement
// 
////////////////////////////////////////////////////////////////////////////////

void callExampleL() 
    {
     CActiveScheduler* AS=new (ELeave)CActiveScheduler;	
	 CleanupStack::PushL(AS);
	 CActiveScheduler::Install(AS);	
	 CAOExample* activeObjectExample=CAOExample::NewLC(console);			
	 activeObjectExample->Start();							
	 console->Printf(_L("If you want to know how many word you input please press \"Enter\"!"));
	 console->Printf(_L("Please input the new word!\n"));
	 CActiveScheduler::Start();		
	 CleanupStack::PopAndDestroy();
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
最新中文字幕一区二区三区| 国内成人免费视频| 精品亚洲成a人| 9久草视频在线视频精品| 日韩一区二区三免费高清| 国产精品午夜免费| 日韩成人午夜精品| 91福利在线导航| 国产精品亲子乱子伦xxxx裸| 青青草国产成人av片免费| 99热这里都是精品| 国产欧美视频在线观看| 欧美bbbbb| 9191国产精品| 天天免费综合色| 91丨九色丨国产丨porny| 国产亚洲欧美色| 久久国产成人午夜av影院| 精品视频1区2区3区| 亚洲桃色在线一区| 成人99免费视频| 国产日韩亚洲欧美综合| 国产一区二区免费在线| 日韩免费在线观看| 日本怡春院一区二区| 欧美蜜桃一区二区三区| 亚洲地区一二三色| 欧美综合天天夜夜久久| 一区二区三区丝袜| 91黄色在线观看| 亚洲激情六月丁香| 色伊人久久综合中文字幕| 亚洲日本韩国一区| 一本色道亚洲精品aⅴ| 亚洲天堂网中文字| 99视频在线精品| 亚洲精品视频在线观看网站| 91丨国产丨九色丨pron| 亚洲欧美日韩国产成人精品影院| av电影天堂一区二区在线| 综合欧美一区二区三区| 9人人澡人人爽人人精品| 亚洲色图欧美偷拍| 欧美中文字幕亚洲一区二区va在线| 亚洲欧美韩国综合色| 在线观看成人免费视频| 偷拍亚洲欧洲综合| 精品三级在线看| 国产91精品一区二区麻豆网站| 中文字幕电影一区| 日本高清成人免费播放| 日韩综合一区二区| 久久一二三国产| 99视频有精品| 午夜欧美在线一二页| 精品久久久久香蕉网| 成人性生交大片免费看中文| 一区二区三区不卡视频在线观看| 欧美精品xxxxbbbb| 国产成人欧美日韩在线电影| 一区视频在线播放| 69成人精品免费视频| 精品一区二区日韩| 亚洲欧美国产三级| 日韩女优av电影| 91在线观看免费视频| 日本最新不卡在线| 国产精品久久毛片a| 欧美群妇大交群中文字幕| 国产又黄又大久久| 一区二区三区四区激情| 久久女同互慰一区二区三区| 91浏览器入口在线观看| 蜜臀久久99精品久久久久久9| 国产精品久久一级| 日韩视频不卡中文| 在线精品观看国产| 国产大陆a不卡| 青青草97国产精品免费观看无弹窗版 | 91蝌蚪国产九色| 蜜桃av噜噜一区二区三区小说| 国产精品美女视频| 日韩精品在线网站| 欧美性大战久久久久久久 | 亚洲精品少妇30p| 精品噜噜噜噜久久久久久久久试看| 91亚洲精品一区二区乱码| 精品一区二区成人精品| 亚洲成在线观看| 亚洲丝袜自拍清纯另类| 久久免费偷拍视频| 日韩欧美国产精品| 欧美日韩免费视频| 91久久精品一区二区| a在线欧美一区| 国产高清无密码一区二区三区| 三级不卡在线观看| 亚洲靠逼com| 国产精品久久久久9999吃药| 国产午夜精品美女毛片视频| 欧美日韩电影在线播放| 日本视频免费一区| 一区二区在线看| 国产精品乱码久久久久久| 亚洲精品在线电影| 欧美一级午夜免费电影| 欧美人xxxx| 欧美精品v日韩精品v韩国精品v| 在线这里只有精品| 欧美性猛交xxxxxx富婆| 色系网站成人免费| 96av麻豆蜜桃一区二区| 成人免费高清视频在线观看| 国产成人免费网站| 国产999精品久久| 国产v综合v亚洲欧| 不卡区在线中文字幕| 波多野结衣中文字幕一区| 成a人片国产精品| 北岛玲一区二区三区四区| 成人免费视频一区| 99在线热播精品免费| av中文字幕一区| 欧洲亚洲精品在线| 欧美美女一区二区三区| 欧美一级片免费看| 精品日韩av一区二区| 久久精品男人的天堂| 中文字幕不卡在线播放| 中文字幕制服丝袜一区二区三区 | 亚洲欧美另类久久久精品| 亚洲精品日日夜夜| 亚洲成年人网站在线观看| 美国欧美日韩国产在线播放| 精品无人区卡一卡二卡三乱码免费卡 | 国产精品视频yy9299一区| 中文一区在线播放| 亚洲精品中文字幕在线观看| 亚洲福利视频导航| 久久国产精品72免费观看| 国产不卡一区视频| 在线视频一区二区三区| 91精品国产色综合久久不卡蜜臀| 精品国产伦一区二区三区免费| 国产网红主播福利一区二区| 亚洲三级在线免费| 日本成人在线看| 国产aⅴ综合色| 欧美在线视频日韩| 久久这里只有精品6| 亚洲你懂的在线视频| 美脚の诱脚舐め脚责91| 99久久99久久综合| 日韩欧美aaaaaa| 亚洲女人****多毛耸耸8| 男男gaygay亚洲| 99国产精品久久| 精品黑人一区二区三区久久| 亚洲欧美一区二区视频| 久久精品国产澳门| 色狠狠桃花综合| 精品国产乱码久久久久久久| 亚洲女子a中天字幕| 国产伦理精品不卡| 欧美日韩亚洲综合一区二区三区| 亚洲国产精品av| 美国三级日本三级久久99| 91福利国产成人精品照片| 26uuu色噜噜精品一区| 亚洲v日本v欧美v久久精品| 国产精品一区在线观看你懂的| 欧美日韩免费一区二区三区 | 亚洲免费在线观看视频| 麻豆精品一区二区av白丝在线| 91麻豆精东视频| 久久精品这里都是精品| 午夜精品福利一区二区蜜股av| 播五月开心婷婷综合| 国产亚洲制服色| 蜜臀av在线播放一区二区三区| 91福利在线观看| 136国产福利精品导航| 国产福利一区在线| 精品国产乱码久久久久久夜甘婷婷 | 99久久亚洲一区二区三区青草| 欧美一区二区三区四区久久| 一区二区不卡在线视频 午夜欧美不卡在| 国产一本一道久久香蕉| 日韩一区二区免费电影| 亚洲国产精品久久久久婷婷884| 99视频精品在线| 亚洲欧洲日韩在线| 成人激情文学综合网| 欧美国产综合色视频| 国产成人精品在线看| 中文字幕精品一区二区三区精品| 国产一区二区导航在线播放| 精品国产乱码久久久久久闺蜜| 另类小说色综合网站| 精品欧美一区二区在线观看|