📄 calendarapiexampleappui.cpp
字号:
/*
* ============================================================================
* Name : CCalendarAPIexampleAppUi from CalendarAPIexampleAppUi.cpp
* Part of : CalendarAPIexample
* Created : 12/06/2006 by Forum Nokia
* Version : 2.0
* Copyright: Nokia Corporation
* ============================================================================
*/
// INCLUDE FILES
#include "CalendarAPIexampleAppUi.h"
#include "CalendarAPIexampleSearchView.h"
#include "CalendarAPIexampleEntryView.h"
#include "CalendarAPIexampleEntriesView.h"
#include "CalendarAPIexampleEngine.h"
#include "CalendarAPIexampleDocument.h"
#include "CalendarAPIexample.pan"
#include <avkon.hrh>
// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CCalendarAPIexampleAppUi::ConstructL()
//
// ----------------------------------------------------------
//
void CCalendarAPIexampleAppUi::ConstructL()
{
BaseConstructL(EAknEnableSkin);
iEngine = CCalendarAPIexampleEngine::NewL(*this);
iSearchView = CCalendarAPIexampleSearchView::NewL(*iEngine);
AddViewL( iSearchView ); // transfer ownership to AppUi
iEntryView = CCalendarAPIexampleEntryView::NewL(*iEngine);
AddViewL( iEntryView ); // transfer ownership to AppUi
iEntriesView = CCalendarAPIexampleEntriesView::NewL(*iEngine);
AddViewL( iEntriesView ); // transfer ownership to AppUi
ActivateLocalViewL(iSearchView->Id());
}
// ----------------------------------------------------
// CCalendarAPIexampleAppUi::~CCalendarAPIexampleAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CCalendarAPIexampleAppUi::~CCalendarAPIexampleAppUi()
{
delete iEngine;
iEngine=NULL;
}
// ----------------------------------------------------------------------------
// CCalendarAPIexampleAppUi::DynInitMenuPaneL()
// 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 CCalendarAPIexampleAppUi::DynInitMenuPaneL(
TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/)
{
}
// ----------------------------------------------------
// CCalendarAPIexampleAppUi::HandleKeyEventL(
// const TKeyEvent& aKeyEvent,TEventCode /*aType*/)
// takes care of key event handling
// ----------------------------------------------------
//
TKeyResponse CCalendarAPIexampleAppUi::HandleKeyEventL(
const TKeyEvent& /*aKeyEvent*/,TEventCode /*aType*/)
{
return EKeyWasNotConsumed;
}
// ----------------------------------------------------
// CCalendarAPIexampleAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CCalendarAPIexampleAppUi::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
case EAknSoftkeyBack:
case EEikCmdExit:
{
Exit();
break;
}
default:
break;
}
}
void CCalendarAPIexampleAppUi::ActivateView(TUid aViewId)
{
TRAPD(err,ActivateLocalViewL(aViewId) );
if( err )
{
Panic(EViewError);
}
}
void CCalendarAPIexampleAppUi::HandleResourceChangeL(TInt aType)
{
CAknAppUi::HandleResourceChangeL(aType); //call to upper class
// ADDED FOR SCALABLE UI SUPPORT
// *****************************
if ( aType == KEikDynamicLayoutVariantSwitch )
{
//do re-layout
if( iSearchView && iSearchView->IsForeground())
{
iSearchView->HandleResourceChange(aType);
}
else if( iEntriesView && iEntriesView->IsForeground())
{
iEntriesView->HandleResourceChange(aType);
}
}
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -