📄 logexampleappui.cpp
字号:
/*
* ============================================================================
* Name : CLogExampleAppUi from LogExampleAppui.cpp
* Part of : LogExample
* Created : 26.05.2005 by Forum Nokia
* Implementation notes:
* Initial content was generated by Series 60 Application Wizard.
* Version : 1.0
* Copyright: Nokia Corporation
* ============================================================================
*/
// INCLUDE FILES
#include "LogExampleAppui.h"
#include "LogExampleView.h"
#include "LogExampleLogDatabaseObserver.h"
#include "LogExEngine.h"
#include "LogExample.hrh"
#include <akntitle.h>
#include <eikmenup.h>
#include <AknGlobalNote.h> //CAknGlobalNote
#include <LogExample.rsg>
#include <avkon.hrh>
// ================= MEMBER FUNCTIONS =======================
//
// ----------------------------------------------------------
// CLogExampleAppUi::ConstructL()
// Two phased constructor
// ----------------------------------------------------------
//
void CLogExampleAppUi::ConstructL()
{
BaseConstructL(EAknEnableSkin);
iLogEngine = CLogExEngine::NewL();
CLogExampleView* view = new (ELeave) CLogExampleView;
CleanupStack::PushL(view);
view->ConstructL();
AddViewL(view); // transfer ownership to CAknViewAppUi
CleanupStack::Pop(view);
iLogDatabaseObserver = CLogExampleLogDatabaseObserver::NewL(*this);
iLogDatabaseObserver->NotifyChange();
iLogEngine->SetObserver(view->GetObserver());
iLogEngine->SetRecentObserver(view->GetObserver());
SetDefaultViewL(*view);
_LIT(KTitle, "Log Engine Example");
SetTitleL(KTitle);
}
// ----------------------------------------------------
// CLogExampleAppUi::~CLogExampleAppUi()
// Destructor
// Frees reserved resources
// ----------------------------------------------------
//
CLogExampleAppUi::~CLogExampleAppUi()
{
delete iLogDatabaseObserver;
delete iLogEngine;
}
//
// ----------------------------------------------------
// CLogExampleAppUi::Model()
// Returns model
// ----------------------------------------------------
//
CLogExEngine* CLogExampleAppUi::Model()
{
return iLogEngine;
}
//
// ----------------------------------------------------
// CLogExampleAppUi::NotifyChangeL()
// Shows notify of change in database
// ----------------------------------------------------
//
void CLogExampleAppUi::NotifyChangeL()
{
}
// ------------------------------------------------------------------------------
// CLogExampleAppUi::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 CLogExampleAppUi::DynInitMenuPaneL(TInt /*aResourceId*/,
CEikMenuPane* /*aMenuPane*/)
{
}
// ----------------------------------------------------
// CLogExampleAppUi::HandleKeyEventL(
// const TKeyEvent& aKeyEvent,TEventCode aType)
// takes care of key event handling
// ----------------------------------------------------
//
TKeyResponse CLogExampleAppUi::HandleKeyEventL(const TKeyEvent& aKeyEvent,
TEventCode aType)
{
return EKeyWasNotConsumed;
}
// ----------------------------------------------------
// CLogExampleAppUi::SetTitleL(const TDesC& aTitle)
// Sets the title of the title pane
// ----------------------------------------------------
//
void CLogExampleAppUi::SetTitleL(const TDesC& aTitle)
{
TUid tPaneUid;
tPaneUid.iUid = EEikStatusPaneUidTitle;
CEikStatusPane* sPane = StatusPane();
CEikStatusPaneBase::TPaneCapabilities
subPane = sPane->PaneCapabilities(tPaneUid);
// Check if title pane can be accessed
if (subPane.IsPresent() && subPane.IsAppOwned())
{
CAknTitlePane* tPane = (CAknTitlePane*) sPane->ControlL(tPaneUid);
tPane->SetTextL(aTitle);
}
}
// ----------------------------------------------------
// CLogExampleAppUi::HandleCommandL(TInt aCommand)
// takes care of command handling
// ----------------------------------------------------
//
void CLogExampleAppUi::HandleCommandL(TInt aCommand)
{
switch (aCommand)
{
case EEikCmdExit:
case EAknSoftkeyExit:
{
Exit();
break;
}
default:
break;
}
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -