📄 svexserviceappappui.cpp
字号:
// Copyright (c) 2006 Murray Read, All rights reserved
#include <avkon.hrh>
#include <aknnotewrappers.h>
#include "SvexServiceApp.pan"
#include "SvexServiceAppAppUi.h"
#include "SvexServiceAppAppView.h"
#include "SvexServiceApp.hrh"
#include <SvexInfo.h>
#include "SvexServiceAppServer.h"
// ConstructL is called by the application framework
void CSvexServiceAppAppUi::ConstructL()
{
BaseConstructL();
iInfo = CSvexInfoBase::NewL();
// Create the app list view at startup
iAppView = CSvexServiceAppAppView::NewL(this, *iInfo);
AddToStackL(iAppView);
}
CSvexServiceAppAppUi::CSvexServiceAppAppUi()
{
// no implementation required
}
CSvexServiceAppAppUi::~CSvexServiceAppAppUi()
{
delete iCallBack;
delete iDialog;
if (iAppView)
{
RemoveFromStack(iAppView);
delete iAppView;
iAppView = NULL;
}
delete iInfo;
}
// handle any menu commands
void CSvexServiceAppAppUi::HandleCommandL(TInt aCommand)
{
switch(aCommand)
{
case EEikCmdExit:
case EAknSoftkeyExit:
Exit();
break;
case ESvexServiceAppOpen:
iAppView->OpenL();
break;
default:
Panic(ESvexServiceAppBasicUi);
break;
}
}
void CSvexServiceAppAppUi::ShowAllL()
{
// do nothing, view already shown
}
void CSvexServiceAppAppUi::ShowAppL(TUid aAppUid)
{
// launch a dialog to show an app's registration info
const CSvexServiceInfo& serviceInfo = iInfo->ServiceInfoServiceL();
TInt count = serviceInfo.MsasiCount();
for (TInt ii=0; ii<count; ii++)
{
TSvexAppServiceInfo reg = serviceInfo.MsasiAt(ii);
if (aAppUid == reg.iAppUid)
{
iDialog = CSvexServiceDialog::NewL(reg, *iInfo);
iDialog->ExecuteLD();
iDialog = 0;
break;
}
}
}
// ShowAppAndExitL() is called from the session's ServiceL()
// it must not block the server, so it uses a callback to launch
// the dialog
void CSvexServiceAppAppUi::ShowAppAndExitL(TUid aAppUid)
{
iAppUid = aAppUid;
iCallBack = new(ELeave) CAsyncCallBack(TCallBack(ShowAppAndExitCallBackL, this), CActive::EPriorityStandard);
iCallBack->CallBack();
}
void CSvexServiceAppAppUi::ShowAppAndExitNowL(TUid aAppUid)
{
ShowAppL(aAppUid);
iEikonEnv->AppServer()->NotifyServerExit(EEikCmdExit);
RunAppShutter();
}
TInt CSvexServiceAppAppUi::ShowAppAndExitCallBackL(TAny* aThis)
{
CSvexServiceAppAppUi* self = ((CSvexServiceAppAppUi*)aThis);
self->ShowAppAndExitNowL(self->iAppUid);
delete self->iCallBack;
self->iCallBack = 0;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -