📄 serviceexplorerappappui.cpp
字号:
// Copyright (c) 2006 Murray Read, All rights reserved
#include <avkon.hrh>
#include <aknnotewrappers.h>
#include "ServiceExplorerApp.pan"
#include "ServiceExplorerAppAppUi.h"
#include "ServiceView.h"
#include "AppsView.h"
#include "ServiceExplorerApp.hrh"
#include <SvexTest.h>
#include <SvexInfo.h>
#include <SvexUtil.h>
// ConstructL is called by the application framework
void CServiceExplorerAppAppUi::ConstructL()
{
BaseConstructL();
// create the full CSvexInfo object
iInfo = CSvexInfo::NewL();
// launch the service view
ShowServiceViewL();
}
CServiceExplorerAppAppUi::CServiceExplorerAppAppUi()
{
// no implementation required
}
CServiceExplorerAppAppUi::~CServiceExplorerAppAppUi()
{
if (iAppView)
{
RemoveFromStack(iAppView);
delete iAppView;
iAppView = NULL;
}
delete iInfo;
}
// handle any menu commands
void CServiceExplorerAppAppUi::HandleCommandL(TInt aCommand)
{
switch(aCommand)
{
case EEikCmdExit:
case EAknSoftkeyExit:
Exit();
break;
case EServiceExplorerAppCommandServiceView:
ShowServiceViewL();
break;
case EServiceExplorerAppCommandAppsView:
ShowAppsViewL();
break;
default:
iAppView->HandleCommandL(aCommand);
break;
}
}
CSvexInfo& CServiceExplorerAppAppUi::Info()
{
return *iInfo;
}
void CServiceExplorerAppAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
{
CAknAppUi::DynInitMenuPaneL(aResourceId, aMenuPane);
iAppView->DynInitMenuPaneL(aResourceId, aMenuPane);
}
void CServiceExplorerAppAppUi::ShowServiceViewL()
{
NewViewLX(CServiceView::NewLC(*iInfo));
_LIT(KTitle, "Services");
SetTitlePaneL(KTitle);
}
void CServiceExplorerAppAppUi::ShowAppsViewL()
{
NewViewLX(CAppsView::NewLC(*iInfo));
_LIT(KTitle, "Apps");
SetTitlePaneL(KTitle);
}
// NewViewLX installs the new view and removes the existing one.
// it assumes the new view is already on the cleanup stack, and
// removes it, hence the LX (== unusual) ending.
void CServiceExplorerAppAppUi::NewViewLX(CSvexListView* aNewView)
{
AddToStackL(aNewView);
CleanupStack::Pop(aNewView);
if (iAppView)
RemoveFromStack(iAppView);
delete iAppView;
iAppView = aNewView;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -