Nokia N97 SDK
Example Applications Guide

CGuiEngineDocument Class Reference

#include <guienginedocument.h>

Inheritance diagram for CGuiEngineDocument:

List of all members.

Detailed Description

CGuiEngineDocument, An instance of class CGuiEngineDocument is the Document part of the CKON application framework for the GuiEngine example application

Definition at line 37 of file guienginedocument.h.


Public Member Functions

virtual  ~CGuiEngineDocument ()
CShapeListManager *  Model ()
void  StoreL (CStreamStore &aStore, CStreamDictionary &aStreamDict) const
void  RestoreL (const CStreamStore &aStore, const CStreamDictionary &aStreamDict)

Static Public Member Functions

static CGuiEngineDocument *  NewL (CEikApplication &aApp)
static CGuiEngineDocument *  NewLC (CEikApplication &aApp)

Private Member Functions

  CGuiEngineDocument (CEikApplication &aApp)
void  ConstructL ()
CEikAppUi *  CreateAppUiL ()

Private Attributes

CShapeListManager *  iModel


Constructor & Destructor Documentation

CGuiEngineDocument::~CGuiEngineDocument (   )  [virtual]
 

~CGuiEngineDocument Virtual Destructor.

Definition at line 77 of file guienginedocument.cpp.

References iModel.

00078     {
00079     delete iModel;
00080     iModel = NULL;
00081     }

CGuiEngineDocument::CGuiEngineDocument (  CEikApplication &  aApp  )  [private]
 

CGuiEngineDocument. C++ default constructor.

Parameters:
aApp  Reference to Application class object

Definition at line 31 of file guienginedocument.cpp.

Referenced by NewLC().

00032 : CEikDocument( aApp )
00033     {
00034     //  No implementation required
00035     }


Member Function Documentation

CGuiEngineDocument * CGuiEngineDocument::NewL (  CEikApplication &  aApp  )  [static]
 

NewL Two-phased constructor. Construct a CGuiEngineDocument for the AVKON application aApp. Using two phase construction, and return a pointer to the created object.

Parameters:
aApp  Application creating this document.
Returns:
Returns a pointer to the instance which is also on the cleanup stack

Definition at line 42 of file guienginedocument.cpp.

References NewLC().

Referenced by CGuiEngineApplication::CreateDocumentL().

00043     {
00044     CGuiEngineDocument* self = NewLC( aApp );
00045     CleanupStack::Pop( self );
00046     return self;
00047     }

CGuiEngineDocument * CGuiEngineDocument::NewLC (  CEikApplication &  aApp  )  [static]
 

NewLC Two-phased constructor. Construct a CGuiEngineDocument for the AVKON application aApp. Using two phase construction, and return a pointer to the created object.

Parameters:
aApp  Application creating this document.
Returns:
Returns a pointer to the instance which is also on the cleanup stack

Definition at line 54 of file guienginedocument.cpp.

References CGuiEngineDocument().

Referenced by NewL().

00055     {
00056     CGuiEngineDocument* self = new ( ELeave ) CGuiEngineDocument( aApp );
00057     CleanupStack::PushL( self );
00058     self->ConstructL();
00059     return self;
00060     }

CShapeListManager * CGuiEngineDocument::Model (   ) 
 

Model Get the model associated with the document

Returns:
a pointer

Definition at line 166 of file guienginedocument.cpp.

References iModel.

Referenced by CGuiEngineAppView::Clear(), CGuiEngineAppView::Draw(), and CGuiEngineAppView::OfferKeyEventL().

00167     {
00168     return iModel;
00169     }

void CGuiEngineDocument::StoreL (  CStreamStore &  aStore,
CStreamDictionary &  aStreamDict
)  const
 

StoreL Store the document to the store

Parameters:
aStore  the store to save the data to
aStreamDict  the dictionary to hold the stream id of the data stream

Definition at line 99 of file guienginedocument.cpp.

References iModel, and CShapeListManager::StoreL().

00101     {
00102 
00103     //  Get the model to save itself to the store
00104     TStreamId modelStreamId = iModel->StoreL( aStore );
00105 
00106     //  Add an entry into the dictionary for the model data
00107     aStreamDic.AssignL( static_cast<CGuiEngineApplication*>
00108                                                 ( Application() )->EngineDllUid(), modelStreamId );
00109 
00110     // Now get the Ui to store itself to the store
00111     TStreamId uiStreamId = static_cast<CGuiEngineAppUi*>
00112                            ( iAppUi )->StoreL( aStore );
00113 
00114     //  Add an entry for it to the dictionary
00115     aStreamDic.AssignL( static_cast<CGuiEngineApplication*>
00116                             ( Application() )->AppDllUid(), uiStreamId );
00117     }

void CGuiEngineDocument::RestoreL (  const CStreamStore &  aStore,
const CStreamDictionary &  aStreamDict
) 
 

RestoreL Restore the document from the store

Parameters:
aStore  the store to containing the data to
aStreamDict  the dictionary that holds the stream id of the data stream

Definition at line 125 of file guienginedocument.cpp.

References iModel, CShapeListManager::NewL(), and CShapeListManager::RestoreL().

00127     {
00128 
00129     // Do not set this as the document's model yet.
00130     // That way, if the restore fails, we have still
00131     // got the old model.
00132 
00133     CShapeListManager* newModel = CShapeListManager::NewL();
00134     CleanupStack::PushL( newModel );
00135 
00136     //  Find the stream id for the model's data
00137     TStreamId modelStreamId = aStreamDic.At( static_cast<CGuiEngineApplication*>
00138                                                         ( Application() )->EngineDllUid() );
00139 
00140     //  Restore the model from that stream
00141     newModel->RestoreL( aStore, modelStreamId );
00142 
00143     //  Now get rid of the old model and set the new one as current
00144     delete iModel;
00145 
00146     iModel = newModel;
00147     CleanupStack::Pop( newModel );
00148 
00149     //  Just restored so can't have changed
00150     SetChanged( EFalse );
00151 
00152     // Now restore UI data
00153     TStreamId uiStreamId;
00154 
00155     uiStreamId = aStreamDic.At( static_cast<CGuiEngineApplication*>
00156                                 ( Application() )->AppDllUid() );
00157 
00158     ( static_cast<CGuiEngineAppUi*>( iAppUi ) )->RestoreL( aStore, uiStreamId );
00159     }

void CGuiEngineDocument::ConstructL (   )  [private]
 

ConstructL 2nd phase constructor.

Definition at line 67 of file guienginedocument.cpp.

References iModel, and CShapeListManager::NewL().

00068     {
00069     iModel = CShapeListManager::NewL();
00070     }

CEikAppUi * CGuiEngineDocument::CreateAppUiL (   )  [private]
 

CreateAppUiL Create a CGuiEngineAppUi object and return a pointer to it. The object returned is owned by the Uikon framework.

Returns:
Pointer to created instance of AppUi.

Definition at line 89 of file guienginedocument.cpp.

00090     {
00091     return ( static_cast<CEikAppUi*>( new ( ELeave ) CGuiEngineAppUi( this ) ) );
00092     }


Member Data Documentation

CShapeListManager* CGuiEngineDocument::iModel [private]
 

iModel, The model Owned by CGuiEngineDocument object.

Definition at line 134 of file guienginedocument.h.

Referenced by ConstructL(), Model(), RestoreL(), StoreL(), and ~CGuiEngineDocument().


The documentation for this class was generated from the following files:

© Nokia 2009

Back to top