📄 oandxdocument.cpp
字号:
// Copyright (c) 2004 - 2006, Symbian Software Ltd. All rights reserved.
#include "OandXApplication.h"
#include "OandXAppUi.h"
#include "OandXDocument.h"
COandXDocument* COandXDocument::NewL(CEikApplication& aApp)
/**
Factory function allocates new initialized document object.
@param aApp The application object, which is used
to initialize the newly-created document object.
@return New initialized document object. The
object is owned by the caller.
*/
{
COandXDocument* self = new(ELeave) COandXDocument(aApp);
return self;
}
COandXDocument::COandXDocument(CEikApplication& aApp)
/**
This constructor is only defined to initialize the
platform-specific superclass with the supplied application object.
@param aApp Application object which is used to
initialize the platform-specific
superclass.
*/
: CAknDocument(aApp)
{
// empty.
}
COandXDocument::~COandXDocument()
/**
This d'tor is empty but defining it here ensures
that only one instance is generated.
*/
{
// empty.
}
CEikAppUi* COandXDocument::CreateAppUiL()
/**
Implement CEikDocument by creating a new app UI object.
@return New app UI object. This is CBase-initialized
and its constructor has been called, but no
secondary initialization has been performed.
*/
{
iAppUi = new (ELeave) COandXAppUi;
return iAppUi;
}
void COandXDocument::StoreL(CStreamStore& aStore,CStreamDictionary& aStreamDic) const
/**
Override CEikDocument by storing the current game state.
@param aStore Stream store whose streams will describe the game.
@param aStreamDic On exit associates stream UIDs with the corresponding
stream IDs.
@see RestoreL
*/
{
TStreamId id = iAppUi->StoreL(aStore);
aStreamDic.AssignL(KUidOandXApp, id);
}
void COandXDocument::RestoreL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic)
/**
Override CEikDocument by restoring a game from the supplied stream store.
@param aStore Stream store which contains the externalized game.
@param aStreamDic Associates stream UIDs with the corresponding stream IDs.
@see StoreL
*/
{
TStreamId id = aStreamDic.At(KUidOandXApp);
iAppUi->RestoreL(aStore, id);
}
CFileStore* COandXDocument::OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs)
/**
Overrides CAknDocument by directly calling CEikDocument::OpenFileL.
This function must be defined for S60 because the CAknDocument implementation
of OpenFileL does not support document-based applications.
@param aDoOpen Whether should open an existing file instead of
creating a new file.
@param aFilename The path and name of the file to open or create.
@param aFs File server session to use.
*/
{
return CEikDocument::OpenFileL(aDoOpen,aFilename,aFs);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -