📄 sysinfo60view2.cpp
字号:
/*
* ============================================================================
* Name : CSYSINFO60View2 from SYSINFO60View2.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 <avkon.hrh>
#include <SYSINFO60.rsg>
#include "SYSINFO60.hrh"
#include "SYSINFO60View2.h"
#include "SYSINFO60Container2.h"
#include "GenFuncs.h"
using namespace NGenFuncs;
// ================= MEMBER FUNCTIONS =======================
// ---------------------------------------------------------
// CSYSINFO60View2::ConstructL(const TRect& aRect)
// EPOC two-phased constructor
// ---------------------------------------------------------
//
void CSYSINFO60View2::ConstructL()
{
BaseConstructL( R_SYSINFO60_VIEW2 );
}
// ---------------------------------------------------------
// CSYSINFO60View2::~CSYSINFO60View2()
// ?implementation_description
// ---------------------------------------------------------
//
CSYSINFO60View2::~CSYSINFO60View2()
{
if ( iContainer )
{
AppUi()->RemoveFromViewStack( *this, iContainer );
}
delete iContainer;
}
// ---------------------------------------------------------
// TUid CSYSINFO60View2::Id()
// ?implementation_description
// ---------------------------------------------------------
//
TUid CSYSINFO60View2::Id() const
{
return KView2Id;
}
// ---------------------------------------------------------
// CSYSINFO60View2::HandleCommandL(TInt aCommand)
// ?implementation_description
// ---------------------------------------------------------
//
void CSYSINFO60View2::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
/*case EAknSoftkeyOk:
{
iEikonEnv->InfoMsg( _L("view2 ok") );
break;
}*/
case EAknSoftkeyBack:
{
AppUi()->HandleCommandL(EEikCmdExit);
break;
}
case ESYSINFO60CmdV2IrDiscovery:
{
IrLap(iContainer->EIr);
break;
}
case ESYSINFO60CmdV2IrMux:
{
IrLap(iContainer->EIrMux);
break;
}
case ESYSINFO60CmdV2IrServ:
{
IrLap(iContainer->EIrServ);
break;
}
case ESYSINFO60CmdV2IrIas:
{
IrLap(iContainer->EIrIas);
break;
}
case ESYSINFO60CmdV2IrPrint:
{
IrLap();
break;
}
default:
{
AppUi()->HandleCommandL( aCommand );
break;
}
}
}
// ---------------------------------------------------------
// CSYSINFO60View2::HandleClientRectChange()
// ---------------------------------------------------------
//
void CSYSINFO60View2::HandleClientRectChange()
{
if ( iContainer )
{
iContainer->SetRect( ClientRect() );
}
}
// ---------------------------------------------------------
// CSYSINFO60View2::DoActivateL(...)
// ?implementation_description
// ---------------------------------------------------------
//
void CSYSINFO60View2::DoActivateL(
const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
const TDesC8& /*aCustomMessage*/)
{
if (!iContainer)
{
iContainer = new (ELeave) CSYSINFO60Container2;
iContainer->SetMopParent(this);
iContainer->ConstructL( ClientRect() );
AppUi()->AddToStackL( *this, iContainer );
}
}
// ---------------------------------------------------------
// CSYSINFO60View2::HandleCommandL(TInt aCommand)
// ?implementation_description
// ---------------------------------------------------------
//
void CSYSINFO60View2::DoDeactivate()
{
if ( iContainer )
{
AppUi()->RemoveFromViewStack( *this, iContainer );
}
delete iContainer;
iContainer = NULL;
}
void CSYSINFO60View2::IrLap(const TInt aMode)
{
#ifdef __WINS__
User::InfoPrint(KTinyTP);
#endif
TRAPD(error, iContainer->IrDiscL(aMode));
if (error != KErrNone)
{
NShowErrorMsgL(_L("Discovery failed\nError "), error);
/*TBuf<32> errstr(_L("Discovery failed\nError "));
errstr.AppendNum(error);
CAknErrorNote* dlg = new(ELeave) CAknErrorNote();
dlg->ExecuteLD(errstr);*/
}
}
void CSYSINFO60View2::IrLap(void)
{
#ifdef __WINS__
User::InfoPrint(_L("IrComm"));
#endif
TRAPD(error, iContainer->IrPrintL());
if (error != KErrNone)
{
NShowErrorMsgL(_L("IR printing failed\nError "), error);
}
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -