📄 myxmlparseview.cpp
字号:
/*
* ============================================================================
* Name : CMyXMLParseView from MyXMLParseView.h
* Part of : MyXMLParse
* Created : 19.05.2008 by
* Implementation notes:
* Initial content was generated by Series 60 Application Wizard.
* Version :
* Copyright:
* ============================================================================
*/
// INCLUDE FILES
#include <aknviewappui.h>
#include <avkon.hrh>
#include <MyXMLParse.rsg>
#include "MyXMLParseView.h"
#include "MyXMLParseContainer.h"
#include "MyXMLParseAppui.h"
#include <avkon.hrh>
#include <AknQueryDialog.h>
#include <eikmenup.h>
#include "Myxmlparse.hrh"
#define KEnableSkinFlag 0x1000
#define KLayoutAwareFlag 0x08
// ================= MEMBER FUNCTIONS =======================
class CMyXMLParseContainer;
// ---------------------------------------------------------
// CMyXMLParseView::ConstructL(const TRect& aRect)
// EPOC two-phased constructor
// ---------------------------------------------------------
//
void CMyXMLParseView::ConstructL()
{
BaseConstructL( R_MYXMLPARSE_VIEW1 );
}
// ---------------------------------------------------------
// CMyXMLParseView::~CMyXMLParseView()
// destructor
// ---------------------------------------------------------
//
CMyXMLParseView::~CMyXMLParseView()
{
if ( iContainer )
{
AppUi()->RemoveFromViewStack( *this, iContainer );
}
delete iContainer;
}
// ---------------------------------------------------------
// TUid CMyXMLParseView::Id()
//
// ---------------------------------------------------------
//
TUid CMyXMLParseView::Id() const
{
return KViewId;
}
// ---------------------------------------------------------
// CMyXMLParseView::HandleCommandL(TInt aCommand)
// takes care of view command handling
// ---------------------------------------------------------
//
void CMyXMLParseView::HandleCommandL(TInt aCommand)
{
switch ( aCommand )
{
// case EAknSoftkeyExit:
// case EAknSoftkeyBack:
// case EEikCmdExit:
// {
// Exit();
// break;
// }
case EAknSoftkeyBack:
{
AppUi()->HandleCommandL(EEikCmdExit);
break;
}
case EXMLParseCmdAppNew:
{
TFileName temp;
CAknQueryDialog* dlg = CAknQueryDialog::NewL(temp, CAknQueryDialog::ENoTone );
if(dlg->ExecuteLD(R_AKNEXQUERY_DATA_QUERY))
{
iContainer->CreateFile(temp);
}
break;
}
case EXMLParseCmdAppOpen:
{
AppUi()->ActivateLocalViewL( TUid::Uid( EMultiViewsView3Id ) );
break;
}
case EXMLParseCmdAppSave:
{
break;
}
case EXMLParseCmdAppEdit:
{
iContainer->GetMyName();
AppUi()->ActivateLocalViewL( TUid::Uid( EMultiViewsView2Id ) );
break;
}
// case EAknSoftkeySelect:
// {
// iContainer->LaunchCurrentL();
// break;
// }
default:
{
AppUi()->HandleCommandL( aCommand );
break;
}
}
}
// ---------------------------------------------------------
// CMyXMLParseView::HandleClientRectChange()
// ---------------------------------------------------------
//
void CMyXMLParseView::HandleClientRectChange()
{
if ( iContainer )
{
iContainer->SetRect( ClientRect() );
}
}
// ---------------------------------------------------------
// CMyXMLParseView::DoActivateL(...)
//
// ---------------------------------------------------------
//
void CMyXMLParseView::DoActivateL(
const TVwsViewId& /*aPrevViewId*/,TUid /*aCustomMessageId*/,
const TDesC8& /*aCustomMessage*/)
{
if (!iContainer)
{
iContainer = new (ELeave) CMyXMLParseContainer;
/*iContainer = CMyXMLParseContainer::NewL(*this,ClientRect());*/
iContainer->SetMopParent(this);
iContainer->ConstructL( ClientRect() );
AppUi()->AddToStackL( *this, iContainer );
}
}
// ---------------------------------------------------------
// CMyXMLParseView::DoDeactivate()
//
// ---------------------------------------------------------
//
void CMyXMLParseView::DoDeactivate()
{
if ( iContainer )
{
AppUi()->RemoveFromViewStack( *this, iContainer );
}
delete iContainer;
iContainer = NULL;
}
void CMyXMLParseView::SwitchToViewL(TUid aViewId)
{
AppUi()->ActivateLocalViewL(aViewId);
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -