📄 smallservappui.cpp
字号:
// SmallServAppUI.cpp
//
// Copyright 05/03/2001
//
#include <SmallServ.rsg>
#include "SmallServ.hrh"
#include "SmallServAppUI.h"
#include "SmallServView.h"
#include "SmallServDoc.h"
#include <eikenv.h>
#include <eikon.hrh>
#include <eikfnlab.h>
#include <eiktbar.h>
#include <eikdialg.h>
#include <eikapp.h>
#include <eikmenup.h>
#include <eikon.rsg>
#include <eikcfdlg.h>
#include <eikproc.h>
#include <coeutils.h>
#include <ServerConfig.h>
//
// ConstructL
//
// Initial object setup chores.
void CSmallServAppUi::ConstructL()
{
BaseConstructL();
iAppView = new (ELeave) CSmallServView;
iAppView->ConstructL(ClientRect(), iSmallServDocument);
AddToStackL(iAppView); // app view should go onto control stack
}
//
// ~CSmallServAppUi
//
CSmallServAppUi::~CSmallServAppUi()
{
RemoveFromStack(iAppView);
delete iAppView;
}
//
// HandleCommandL
//
// Handle command requests.
void CSmallServAppUi::HandleCommandL(TInt aCommand)
{
switch (aCommand)
{
case ESmallServCmdConnect: CmdConnectL(); break;
case ESmallServCmdClose: CmdCloseL(); break;
case ESmallServCmdStart: CmdStartL(); break;
case ESmallServCmdStop: CmdStopL(); break;
case EEikCmdHelpAbout: CmdHelpAboutL(); break;
case EEikCmdExit: CmdExitL(); break;
}
}
//
// ProcessCommandParametersL
//
// Call the base class ProcessCommandParametersL to
// get default system policy.
TBool CSmallServAppUi::ProcessCommandParametersL( TApaCommand /* aCommand */
, TFileName& /* aDocumentName */
, const TDesC& /* aTail */
)
{
return EFalse; // file not found - we are not document based.
}
//
// CmdExitL
//
void CSmallServAppUi::CmdExitL()
{
CmdCloseL();
Exit();
}
//
// CmdHelpAboutL
//
void CSmallServAppUi::CmdHelpAboutL()
{
CEikDialog* dialog = new (ELeave) CEikDialog();
dialog->ExecuteLD(R_SMALLSERV_ABOUT);
}
void CSmallServAppUi::CmdConnectL()
{
iServer.ConnectL();
}
void CSmallServAppUi::CmdCloseL()
{
// currently does not leave. CmdCloseL remains xxL to allow for future development
iServer.Close();
}
void CSmallServAppUi::CmdStartL()
{
TRequestStatus stat;
iServer.StartServer(stat);
User::WaitForRequest(stat);
User::LeaveIfError(stat.Int());
}
void CSmallServAppUi::CmdStopL()
{
User::LeaveIfError(iServer.StopServer());
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -