📄 phonebkexappui.cpp
字号:
/*
* ============================================================================
* Name : CPhoneBkExAppUi from PhoneBkExAppUi.cpp
* Part of : PhoneBkEx
* Created : 13/06/2003 by
* Implementation notes:
* Initial content was generated by Series 60 AppWizard.
* Version :
* Copyright: Forum Nokia
* ============================================================================
*/
// INCLUDE FILES
#include "PhoneBkExAppUi.h"
#include <avkon.hrh>
#include <akntabgrp.h>
#include <aknnavide.h>
#include <PhoneBkEx.rsg>
#include "PhoneBkExEngine.h"
#include "PhoneBkExView.h"
#include "PhoneBkExView2.h"
#include "phonebkex.hrh"
// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CPhoneBkExAppUi::ConstructL()
// ?implementation_description
// ----------------------------------------------------------
//
void CPhoneBkExAppUi::ConstructL()
{
BaseConstructL();
// Show tabs for main views from resources
CEikStatusPane* sp = StatusPane();
// Fetch pointer to the default navi pane control
iNaviPane = (CAknNavigationControlContainer*)sp->ControlL(
TUid::Uid(EEikStatusPaneUidNavi));
// Tabgroup has been read from resource and it were pushed to the navi pane.
// Get pointer to the navigation decorator with the ResourceDecorator() function.
// Application owns the decorator and it has responsibility to delete the object.
iDecoratedTabGroup = iNaviPane->ResourceDecorator();
if (iDecoratedTabGroup)
{
iTabGroup = (CAknTabGroup*) iDecoratedTabGroup->DecoratedControl();
}
// Construct the engine
iEngine = CPhoneBkExEngine::NewL();
CPhoneBkExView* view1 = new (ELeave) CPhoneBkExView(*iEngine);
CleanupStack::PushL( view1 );
view1->ConstructL();
AddViewL( view1 ); // transfer ownership to CAknViewAppUi
CleanupStack::Pop(view1); // view1
CPhoneBkExView2* view2 = new (ELeave) CPhoneBkExView2(*iEngine);
CleanupStack::PushL( view2 );
view2->ConstructL();
AddViewL( view2 ); // transfer ownership to CAknViewAppUi
CleanupStack::Pop(view2); // view2
SetDefaultViewL(*view1);
}
// ----------------------------------------------------
// CPhoneBkExAppUi::~CPhoneBkExAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CPhoneBkExAppUi::~CPhoneBkExAppUi()
{
delete iDecoratedTabGroup;
delete iEngine;
}
// ------------------------------------------------------------------------------
// CPhoneBkExAppUi::::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 CPhoneBkExAppUi::DynInitMenuPaneL(
TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
{
}
// ----------------------------------------------------
// CPhoneBkExAppUi::HandleKeyEventL(
// const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// ?implementation_description
// ----------------------------------------------------
//
TKeyResponse CPhoneBkExAppUi::HandleKeyEventL(
const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
{
if ( iTabGroup == NULL )
{
return EKeyWasNotConsumed;
}
TInt active = iTabGroup->ActiveTabIndex();
TInt count = iTabGroup->TabCount();
switch ( aKeyEvent.iCode )
{
case EKeyLeftArrow:
if ( active > 0 )
{
active--;
iTabGroup->SetActiveTabByIndex( active );
ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)));
}
break;
case EKeyRightArrow:
if( (active + 1) < count )
{
active++;
iTabGroup->SetActiveTabByIndex( active );
ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(active)));
}
break;
default:
return EKeyWasNotConsumed;
break;
}
return EKeyWasConsumed;
}
// ----------------------------------------------------
// CPhoneBkExAppUi::HandleCommandL(TInt aCommand)
// ?implementation_description
// ----------------------------------------------------
//
void CPhoneBkExAppUi::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
case EEikCmdExit:
{
Exit();
break;
}
default:
break;
}
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -