📄 mementoappui.cpp
字号:
/* Copyright (c) 2008, Nokia. All rights reserved */
#include <avkon.hrh>
#include <aknnotewrappers.h>
#include "Memento.pan"
#include "MementoAppUi.h"
#include "Memento.hrh"
#include "LoginView.h"
#include "DirView.h"
#include "MementoMainView.h"
#include "MementoEditView.h"
#include <Memento.mbg> //for mbm
#include "MementoApplication.h"
#define MEM_FREE(p) if (NULL != p){delete p; p = NULL;}
void CMementoAppUi::ConstructL()
{
BaseConstructL(EAknEnableSkin);
iDataManage = CDataManage::NewL();
iLoginView = CLoginView::NewL();
AddViewL(iLoginView);
iDirView = CDirView::NewL();
AddViewL(iDirView);
iMain = CMementoMainView::NewL();
AddViewL(iMain);
iEdit = CMementoEditView::NewL();
AddViewL(iEdit);
SetDefaultViewL(*iLoginView);
}
CMementoAppUi::CMementoAppUi()
{
// add any construction that cannot leave here
}
CMementoAppUi::~CMementoAppUi()
{
MEM_FREE(iDataManage);
}
void CMementoAppUi::HandleCommandL(TInt aCommand)
{
switch(aCommand)
{
case EEikCmdExit:
case EAknSoftkeyExit:
Exit();
break;
case EMementoCommand1:
{
_LIT(message,"Command 1");
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
informationNote->ExecuteLD(message);
}
break;
default:
Panic(EMementoBasicUi);
break;
}
}
void CMementoAppUi::ExitApp()
{
Exit();
}
CDataManage* CMementoAppUi::GetDataManage()
{
return iDataManage;
}
CMementoEditView* CMementoAppUi::GetEditPtr()
{
return iEdit;
}
CGulIcon* CMementoAppUi::LoadGraphicsL(TInt aType)
{
TBuf<KMaxPath> pathAppMbm;
#ifdef __WINS__
pathAppMbm.Copy(_L("z:\\system\\apps\\Memento\\memento.mbm"));
#else
GetAppPath(pathAppMbm);
pathAppMbm.Append(_L("memento.mbm"));
#endif
switch(aType)
{
case 0:
return iEikonEnv->CreateIconL(pathAppMbm, EMbmMementoSnoopy_1_icon);
case 1:
//return iEikonEnv->CreateIconL(pathAppMbm, EMbmMementoSnoopy_2_icon);
return iEikonEnv->CreateIconL(pathAppMbm, EMbmMementoSnoopy_2_icon, EMbmMementoSnoopy_2_mask);
case 2:
return iEikonEnv->CreateIconL(pathAppMbm, EMbmMementoSnoopy_3_icon, EMbmMementoSnoopy_3_mask);
case 3:
return iEikonEnv->CreateIconL(pathAppMbm, EMbmMementoSnoopy_4_icon, EMbmMementoSnoopy_4_mask);
case 4:
return iEikonEnv->CreateIconL(pathAppMbm, EMbmMementoSnoopy_5_icon, EMbmMementoSnoopy_5_mask);
case 5:
return iEikonEnv->CreateIconL(pathAppMbm, EMbmMementoSnoopy_6_icon, EMbmMementoSnoopy_6_mask);
case 6:
return iEikonEnv->CreateIconL(pathAppMbm, EMbmMementoSnoopy_7_icon, EMbmMementoSnoopy_7_mask);
case 7:
return iEikonEnv->CreateIconL(pathAppMbm, EMbmMementoSnoopy_8_icon, EMbmMementoSnoopy_8_mask);
case 8:
return iEikonEnv->CreateIconL(pathAppMbm, EMbmMementoSnoopy_9_icon, EMbmMementoSnoopy_9_mask);
default:
return NULL;
}
}
void CMementoAppUi::GetAppPath(TDes& aPath)
{
TFileName appFullName;
appFullName = Application()->AppFullName();
TParsePtr parse(appFullName);
aPath.Copy(parse.DriveAndPath());
}
CDirView* CMementoAppUi::GetDirPtr()
{
return iDirView;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -