?? clocationexampleappui.cpp
字號:
/*
* ============================================================================
* Name : clocationexampleappui.cpp
* Part of : Location Example
* Created : 21.05.2007 by Forum Nokia
* Description:
* Version : 1.0
* Copyright: Nokia Corporation
* ============================================================================
*/
#include <e32std.h>
#include <locationexample.rsg>
#include "locationexample.pan"
#include "clocationexampleappui.h"
#include "clocationexampleview.h"
#include "clocationexampleengine.h"
#include "locationexample.hrh"
// -----------------------------------------------------------------------------
// CLocationExampleAppUi::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CLocationExampleAppUi::ConstructL()
{
// Initialise app UI
BaseConstructL(EAknEnableSkin);
// Initialise Views
iAppView1 = CLocationExampleView::NewL(this);
// Initialise Engine
iEngine = CLocationExampleEngine::NewL(iAppView1);
AddViewL( iAppView1 );
SetDefaultViewL( *iAppView1 );
}
CLocationExampleAppUi::~CLocationExampleAppUi()
{
delete iEngine;
}
// -----------------------------------------------------------------------------
// CLocationExampleAppUi::HandleCommandL()
// Takes care of command handling.
// -----------------------------------------------------------------------------
//
void CLocationExampleAppUi::HandleCommandL( TInt aCommand )
{
switch ( aCommand )
{
case EEikCmdExit:
case EAknSoftkeyExit:
Exit();
break;
case ELocationExampleGpsStart:
{
iEngine->ActivateGpsL();
break;
}
case ELocationExampleGpsStop:
{
iEngine->DeactivateGpsL();
break;
}
case ELocationExampleSendLocation:
{
TInt err = iEngine->NumberQueryL();
if (!err)
{
TRAP_IGNORE(iEngine->DoMessageAndSendL(EPositionResponse));
}
break;
}
case ELocationExampleGetLocation:
{
TInt err = iEngine->NumberQueryL();
if (!err)
{
TRAP_IGNORE(iEngine->DoMessageAndSendL(EPositionRequest));
}
break;
}
default:
Panic( ELocationExampleViewsBasicUi );
break;
}
}
// -----------------------------------------------------------------------------
// CLocationExampleAppUi::HandleResourceChangeL()
// Called by framework when layout is changed.
// -----------------------------------------------------------------------------
//
void CLocationExampleAppUi::HandleResourceChangeL( TInt aType )
{
CAknAppUi::HandleResourceChangeL( aType );
if ( aType==KEikDynamicLayoutVariantSwitch )
{
iAppView1->HandleSizeChange(aType);
}
}
// End of File
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -