/*
============================================================================
Name : CMainViewAppUi from MainViewAppui.cpp
Author :
Version :
Copyright : Your copyright notice
Description : CMainViewAppUi implementation
============================================================================
*/
// INCLUDE FILES
#include "MainViewAppui.h"
#include "MainViewView.h"
#include "MainViewView2.h"
#include <MainView.rsg>
#include "MainView.hrh"
#include <avkon.hrh>
// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CMainViewAppUi::ConstructL()
//
// ----------------------------------------------------------
//
void CMainViewAppUi::ConstructL()
{
BaseConstructL();
// Show tabs for main views from resources
CMainViewView* view1 = new (ELeave) CMainViewView;
CleanupStack::PushL( view1 );
view1->ConstructL();
AddViewL( view1 ); // transfer ownership to CAknViewAppUi
CleanupStack::Pop(); // view1
CMainViewView2* view2 = new (ELeave) CMainViewView2;
CleanupStack::PushL( view2 );
view2->ConstructL();
AddViewL( view2 ); // transfer ownership to CAknViewAppUi
CleanupStack::Pop(); // view2
SetDefaultViewL(*view1);
}
// ----------------------------------------------------
// CMainViewAppUi::~CMainViewAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CMainViewAppUi::~CMainViewAppUi()
{
delete iDecoratedTabGroup;
}
// ------------------------------------------------------------------------------
// CMainViewAppUi::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 CMainViewAppUi::DynInitMenuPaneL(
TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
{
}
// ----------------------------------------------------
// CMainViewAppUi::HandleKeyEventL(
// const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// takes care of key event handling
// ----------------------------------------------------
//
TKeyResponse CMainViewAppUi::HandleKeyEventL(
const TKeyEvent& aKeyEvent,TEventCode aType)
{
return EKeyWasNotConsumed;
}
// ----------------------------------------------------
// CMainViewAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CMainViewAppUi::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
case EEikCmdExit:
{
Exit();
break;
}
case EMainViewCmdAppTest:
{
iEikonEnv->InfoMsg(_L("test"));
break;
}
// TODO: Add Your command handling code here
default:
break;
}
}
// ----------------------------------------------------
// CMainViewAppUi::TabChangedL(TInt aIndex)
// This method gets called when CAknTabGroup active
// tab has changed.
// ----------------------------------------------------
//
void CMainViewAppUi::TabChangedL(TInt aIndex)
{
ActivateLocalViewL(TUid::Uid(iTabGroup->TabIdFromIndex(aIndex)));
}