📄 systemsoundsappui.cpp
字号:
/*
* ============================================================================
* Name : CSystemSoundsAppUi from SystemSoundsAppUi.cpp
* Part of : SystemSounds
* Created : 06/12/2003 by Forum Nokia
* Implementation notes:
* Initial content was generated by Nokia Series 60 AppWizard.
* Version : 1.0
* Copyright: Nokia
* ============================================================================
*/
// INCLUDE FILES
#include "SystemSoundsAppUi.h"
#include "SystemSoundsView.h"
#include "SystemSoundsView2.h"
#include <SystemSounds.rsg>
#include "systemsounds.hrh"
#include <avkon.hrh>
// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CSystemSoundsAppUi::ConstructL()
// ?implementation_description
// ----------------------------------------------------------
//
void CSystemSoundsAppUi::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();
}
CSystemSoundsView* view1 = new (ELeave) CSystemSoundsView;
CleanupStack::PushL( view1 );
view1->ConstructL();
AddViewL( view1 ); // transfer ownership to CAknViewAppUi
CleanupStack::Pop(); // view1
CSystemSoundsView2* view2 = new (ELeave) CSystemSoundsView2;
CleanupStack::PushL( view2 );
view2->ConstructL();
AddViewL( view2 ); // transfer ownership to CAknViewAppUi
CleanupStack::Pop(); // view2
SetDefaultViewL(*view1);
}
// ----------------------------------------------------
// CSystemSoundsAppUi::~CSystemSoundsAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CSystemSoundsAppUi::~CSystemSoundsAppUi()
{
delete iDecoratedTabGroup;
}
// ------------------------------------------------------------------------------
// CSystemSoundsAppUi::::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 CSystemSoundsAppUi::DynInitMenuPaneL(
TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
{
}
// ----------------------------------------------------
// CSystemSoundsAppUi::HandleKeyEventL(
// const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// ?implementation_description
// ----------------------------------------------------
//
TKeyResponse CSystemSoundsAppUi::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;
}
// ----------------------------------------------------
// CSystemSoundsAppUi::HandleCommandL(TInt aCommand)
// ----------------------------------------------------
//
void CSystemSoundsAppUi::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
case EEikCmdExit:
{
Exit();
break;
}
default:
break;
}
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -