📄 sysinfo60view.cpp
字号:
/*
* ============================================================================
* Name : CSYSINFO60View from SYSINFO60View.h
* Part of : SYSINFO60
* Created : 10.05.2003 by Petri-Veikko Alaj鋜vi OH1GIU
* Implementation notes:
* Initial content was generated by Series 60 AppWizard.
* Version :
* Copyright: (c) 2003, Petri-Veikko Alaj鋜vi OH1GIU
* ============================================================================
*/
// INCLUDE FILES
#include <aknviewappui.h>
#include <aknquerydialog.h>
#include <avkon.hrh>
#include <apacmdln.h>
#include <EikDll.h>
#include <SYSINFO60.rsg>
#include "SYSINFO60.hrh"
#include "SYSINFO60View.h"
#include "SYSINFO60Container.h"
#include "GenFuncs.h"
using namespace NGenFuncs;
// ================= MEMBER FUNCTIONS =======================
// ---------------------------------------------------------
// CSYSINFO60View::ConstructL(const TRect& aRect)
// EPOC two-phased constructor
// ---------------------------------------------------------
//
void CSYSINFO60View::ConstructL()
{
BaseConstructL(R_SYSINFO60_VIEW1);
}
// ---------------------------------------------------------
// CSYSINFO60View::~CSYSINFO60View()
// ?implementation_description
// ---------------------------------------------------------
//
CSYSINFO60View::~CSYSINFO60View()
{
if (iContainer)
{
AppUi()->RemoveFromViewStack(*this, iContainer);
}
delete iContainer;
}
// ---------------------------------------------------------
// TUid CSYSINFO60View::Id()
// ?implementation_description
// ---------------------------------------------------------
//
TUid CSYSINFO60View::Id() const
{
return KViewId;
}
// ---------------------------------------------------------
// CSYSINFO60View::HandleCommandL(TInt aCommand)
// ?implementation_description
// ---------------------------------------------------------
//
void CSYSINFO60View::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
case ESYSINFO60CmdV1Gen:
{
iContainer->GetGenVer();
break;
}
case ESYSINFO60CmdV1CF:
{
iContainer->GetCFVer();
break;
}
case ESYSINFO60CmdV1UserAgent:
{
iContainer->UserStringLC();
break;
}
case ESYSINFO60CmdV1Drv:
{
TRAP(iErrorL, iContainer->GetDrivesL());
if (iErrorL != KErrNone) NShowErrorMsgL(_L("Error "), iErrorL);
break;
}
case ESYSINFO60CmdV1Apa:
{
TRAP(iErrorL, iContainer->ShowAppListLC(KAppList));
if (iErrorL != KErrNone) NShowErrorMsgL(_L("Error "), iErrorL);
break;
}
case ESYSINFO60CmdV1ApaUid:
{
TRAP(iErrorL, iContainer->ShowAppListLC(KAppUid));
if (iErrorL != KErrNone) NShowErrorMsgL(_L("Error "), iErrorL);
break;
}
case ESYSINFO60CmdV1Apps:
{
TRAP(iErrorL, iContainer->ShowAppListLC(KApps));
if (iErrorL != KErrNone) NShowErrorMsgL(_L("Error "), iErrorL);
break;
}
case ESYSINFO60CmdV1C:
{
TRAP(iErrorL, iContainer->GetFileListLC(KFlash));
if (iErrorL != KErrNone) NShowErrorMsgL(_L("Error "), iErrorL);
break;
}
case ESYSINFO60CmdV1Z:
{
TRAP(iErrorL, iContainer->GetFileListLC(KRom));
if (iErrorL != KErrNone) NShowErrorMsgL(_L("Error "), iErrorL);
break;
}
case ESYSINFO60CmdV1Disp:
{
iContainer->DisplayInfo();
break;
}
case ESYSINFO60CmdV1Rom:
{
iContainer->ROMinfo();
break;
}
case ESYSINFO60CmdV1CPU:
{
iContainer->CPUinfo();
break;
}
case ESYSINFO60CmdV1Regs:
{
iContainer->RegInfo();
break;
}
case ESYSINFO60CmdV1Mach:
{
iContainer->MachineInfo();
break;
}
case ESYSINFO60CmdV1MiscInfo:
{
iContainer->MiscInfo();
break;
}
case ESYSINFO60CmdV1CompMem:
{
CompressHeaps();
break;
}
case ESYSINFO60CmdV1Reset:
{
ResetPhoneL();
break;
}
case ESYSINFO60CmdV1bva:
{
StartApplicationL(Kbva);
break;
}
case ESYSINFO60CmdV1IrOn:
{
StartApplicationL(KIrOn);
break;
}
case EAknSoftkeyBack:
{
AppUi()->HandleCommandL(EEikCmdExit);
break;
}
default:
{
AppUi()->HandleCommandL( aCommand );
break;
}
}
}
// ---------------------------------------------------------
// CSYSINFO60View::HandleClientRectChange()
// ---------------------------------------------------------
//
void CSYSINFO60View::HandleClientRectChange()
{
if ( iContainer )
{
iContainer->SetRect( ClientRect() );
}
}
// ---------------------------------------------------------
// CSYSINFO60View::DoActivateL(...)
// ?implementation_description
// ---------------------------------------------------------
//
void CSYSINFO60View::DoActivateL(
const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
const TDesC8& /*aCustomMessage*/)
{
if (!iContainer)
{
iContainer = new (ELeave) CSYSINFO60Container;
iContainer->SetMopParent(this);
iContainer->ConstructL( ClientRect() );
AppUi()->AddToStackL( *this, iContainer );
}
}
// ---------------------------------------------------------
// CSYSINFO60View::HandleCommandL(TInt aCommand)
// ?implementation_description
// ---------------------------------------------------------
//
void CSYSINFO60View::DoDeactivate()
{
if ( iContainer )
{
AppUi()->RemoveFromViewStack( *this, iContainer );
}
delete iContainer;
iContainer = NULL;
}
void CSYSINFO60View::CompressHeaps()
{
if (!User::CompressAllHeaps())
{
NShowInfoMsgL(_L("All heaps compressed"));
}
else
{
NShowErrorMsgL(_L("Error "), iErrorL);
}
}
void CSYSINFO60View::ResetPhoneL(void)
{
CAknQueryDialog* dlg = CAknQueryDialog::NewL();
dlg->SetPromptL(_L("Restart phone"));
if (dlg->ExecuteLD(R_CONFIRMATION_QUERY))
{
UserSvr::ResetMachine(EStartupWarmReset);
}
}
void CSYSINFO60View::StartApplicationL(const TDesC& aAppName)
{
CApaCommandLine* cmd = CApaCommandLine::NewL();
cmd->SetLibraryNameL(aAppName);
cmd->SetCommandL(EApaCommandRun);
EikDll::StartAppL(*cmd);
delete cmd;
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -