📄 asyncserialappui.cpp
字号:
/*
* ============================================================================
* Name : CAsyncSerialAppUi from AsyncSerialAppui.cpp
* Part of : AsyncSerial
* Created : 23.02.2006 by ToBeReplacedByAuthor
* Implementation notes:
* Initial content was generated by Series 60 Application Wizard.
* Version :
* Copyright: ToBeReplacedByCopyright
* ============================================================================
*/
// INCLUDE FILES
#include "AsyncSerialAppui.h"
#include "AsyncSerialContainer.h"
#include <AsyncSerial.rsg>
#include "AsyncSerial.hrh"
#include <avkon.hrh>
// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CAsyncSerialAppUi::ConstructL()
//
// ----------------------------------------------------------
//
void CAsyncSerialAppUi::ConstructL()
{
BaseConstructL();
iAppContainer = new (ELeave) CAsyncSerialContainer;
iAppContainer->SetMopParent( this );
iAppContainer->ConstructL( ClientRect() );
AddToStackL( iAppContainer );
iEngine = CAsyncSerialEngine::NewL(*this);
}
// ----------------------------------------------------
// CAsyncSerialAppUi::~CAsyncSerialAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CAsyncSerialAppUi::~CAsyncSerialAppUi()
{
if (iAppContainer)
{
RemoveFromStack( iAppContainer );
delete iAppContainer;
}
delete iEngine;
}
// Functions from CAsyncSerialEngine::MObserver
void CAsyncSerialAppUi::OnCompleteL(TInt aError)
{
if(aError==KErrNone)
{
TBuf<32> buf;
buf.Copy(iBuffer);
iAppContainer->AppendTextL(buf);
}
iBuffer.Zero();
iEngine->Receive(iBuffer);
User::LeaveIfError(aError);
}
// ------------------------------------------------------------------------------
// CAsyncSerialAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
// This function is called by the EIKON framework just before it displays
// a menu pane. Its default implementation is empty, and by overriding it,
// the application can set the state of menu items dynamically according
// to the state of application data.
// ------------------------------------------------------------------------------
//
void CAsyncSerialAppUi::DynInitMenuPaneL(
TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
{
}
// ----------------------------------------------------
// CAsyncSerialAppUi::HandleKeyEventL(
// const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// takes care of key event handling
// ----------------------------------------------------
//
TKeyResponse CAsyncSerialAppUi::HandleKeyEventL(
const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
{
return EKeyWasNotConsumed;
}
// ----------------------------------------------------
// CAsyncSerialAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CAsyncSerialAppUi::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
case EAknSoftkeyBack:
case EEikCmdExit:
{
Exit();
break;
}
case EAsyncSerialCmdReceive:
{
iBuffer.Zero();
iEngine->Receive(iBuffer);
iEikonEnv->InfoMsg(_L("test"));
break;
}
// TODO: Add Your command handling code here
default:
break;
}
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -