📄 svexopenappappui.cpp
字号:
// Copyright (c) 2006 Murray Read, All rights reserved
#include <avkon.hrh>
#include <aknnotewrappers.h>
#include "SvexOpenApp.pan"
#include "SvexOpenAppAppUi.h"
#include "SvexOpenAppAppView.h"
#include "SvexOpenApp.hrh"
#include <SvexInfo.h>
#include "SvexOpenAppServer.h"
// ConstructL is called by the application framework
void CSvexOpenAppAppUi::ConstructL()
{
BaseConstructL();
iInfo = CSvexInfoBase::NewL();
// Show the apps list as the initial main view
ShowAllL();
}
CSvexOpenAppAppUi::CSvexOpenAppAppUi()
{
// no implementation required
}
CSvexOpenAppAppUi::~CSvexOpenAppAppUi()
{
delete iCallBack;
RemoveView((CCoeControl*&)iAppView);
RemoveView((CCoeControl*&)iMimeView);
delete iInfo;
}
// handle any menu commands
void CSvexOpenAppAppUi::HandleCommandL(TInt aCommand)
{
switch(aCommand)
{
case EEikCmdExit:
case EAknSoftkeyExit:
Exit();
break;
case ESvexOpenAppOpen:
// Broadcast the open message - only one view will exist
if (iAppView)
iAppView->OpenL();
if (iMimeView)
iMimeView->OpenL();
break;
case ESvexOpenAppAppsView:
ShowAllL();
break;
case ESvexOpenAppMimeView:
ShowMimeL();
break;
default:
Panic(ESvexOpenAppBasicUi);
break;
}
}
void CSvexOpenAppAppUi::ShowAllL()
{
// make sure the apps view is shown
if (!iAppView)
{
iAppView = CSvexOpenAppAppView::NewL(*iInfo);
AddToStackL(iAppView);
}
RemoveView((CCoeControl*&)iMimeView);
}
void CSvexOpenAppAppUi::ShowAppL(TUid aAppUid)
{
// get the app view to show the app detail
if (iAppView)
iAppView->ShowAppL(aAppUid);
}
void CSvexOpenAppAppUi::ShowAppAndExitL(TUid aAppUid)
{
// This is called by the server. We must not block server
// messages, so use a callback to launch the dialog.
iAppUid = aAppUid;
iCallBack = new(ELeave) CAsyncCallBack(TCallBack(ShowAppAndExitCallBackL, this), CActive::EPriorityStandard);
iCallBack->CallBack();
}
void CSvexOpenAppAppUi::ShowAppAndExitNowL(TUid aAppUid)
{
ShowAppL(aAppUid);
iEikonEnv->AppServer()->NotifyServerExit(EEikCmdExit);
RunAppShutter();
}
TInt CSvexOpenAppAppUi::ShowAppAndExitCallBackL(TAny* aThis)
{
CSvexOpenAppAppUi* self = ((CSvexOpenAppAppUi*)aThis);
self->ShowAppAndExitNowL(self->iAppUid);
delete self->iCallBack;
self->iCallBack = 0;
return 0;
}
void CSvexOpenAppAppUi::ShowMimeL()
{
// create the mime-type view and remove the apps view.
if (!iMimeView)
{
iMimeView = CSvexOpenAppMimeView::NewL(*iInfo);
AddToStackL(iMimeView);
}
RemoveView((CCoeControl*&)iAppView);
}
void CSvexOpenAppAppUi::RemoveView(CCoeControl*& aView)
{
if (aView)
{
RemoveFromStack(aView);
delete aView;
aView = NULL;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -