Nokia N97 SDK
Example Applications Guide

CGuiEngineAppUi Class Reference

#include <guiengineappui.h>

Inheritance diagram for CGuiEngineAppUi:

List of all members.

Detailed Description

CGuiEngineAppUi The Application User Interface.

Definition at line 38 of file guiengineappui.h.


Public Member Functions

void  ConstructL ()
  CGuiEngineAppUi (CGuiEngineDocument *aDocument)
virtual  ~CGuiEngineAppUi ()
TStreamId  StoreL (CStreamStore &aStore) const
void  RestoreL (const CStreamStore &aStore, TStreamId aStreamId)
void  HandleModelChangeL ()
void  HandleCommandL (TInt aCommand)

Private Attributes

CGuiEngineAppView *  iAppView
CGuiEngineDocument *  iDocument


Constructor & Destructor Documentation

CGuiEngineAppUi::CGuiEngineAppUi (  CGuiEngineDocument *  aDocument  ) 
 

CGuiEngineAppUi. C++ default constructor.

Parameters:
aDocument  the model

Definition at line 36 of file guiengineappui.cpp.

00037 : iDocument( aDocument )
00038     {
00039     //  No implementation required
00040     }

CGuiEngineAppUi::~CGuiEngineAppUi (   )  [virtual]
 

~CGuiEngineAppUi. Virtual Destructor.

Definition at line 67 of file guiengineappui.cpp.

References iAppView.

00068     {
00069     if ( iAppView )
00070         {
00071         iEikonEnv->RemoveFromStack( iAppView );
00072         delete iAppView;
00073         iAppView = NULL;
00074         }
00075 
00076     }


Member Function Documentation

void CGuiEngineAppUi::ConstructL (   ) 
 

ConstructL. 2nd phase constructor.

Definition at line 47 of file guiengineappui.cpp.

References iAppView, iDocument, and CGuiEngineAppView::NewL().

00048     {
00049 
00050     // Initialise app UI with standard value.
00051     BaseConstructL( EAknEnableSkin );
00052 
00053     iAppView = CGuiEngineAppView::NewL(ClientRect(), iDocument);
00054 
00055     // Enable the virtual cursor
00056     iEikonEnv->VirtualCursor().SetCursorStateL( TEikVirtualCursor::EOn,*iEikonEnv );
00057 
00058     AddToStackL( iAppView );
00059 
00060     }

TStreamId CGuiEngineAppUi::StoreL (  CStreamStore &  aStore  )  const
 

StoreL Store the user interface settings to a store

Parameters:
aStore  the store to save the data to
Returns:
Returns the id of the stream containing the data

Definition at line 131 of file guiengineappui.cpp.

References CGuiEngineAppView::ExternalizeL(), and iAppView.

00132     {
00133     RStoreWriteStream stream;
00134     TStreamId id = stream.CreateLC( aStore );
00135 
00136     // Write the data to the stream
00137     iAppView->ExternalizeL( stream );
00138     stream.CommitL();
00139     CleanupStack::PopAndDestroy();
00140 
00141     // Return the stream ID
00142     return id;
00143     }

void CGuiEngineAppUi::RestoreL (  const CStreamStore &  aStore,
TStreamId  aStreamId
) 
 

RestoreL Restore the user interface settings from a store

Parameters:
aStore  the store to read the data from
aStreamId  the id of the stream containing the data

Definition at line 150 of file guiengineappui.cpp.

References iAppView, and CGuiEngineAppView::InternalizeL().

00152     {
00153     RStoreReadStream stream;
00154     stream.OpenLC( aStore,aStreamId );
00155 
00156     //  Read in the data
00157     iAppView->InternalizeL( stream );
00158 
00159     CleanupStack::PopAndDestroy();
00160     }

void CGuiEngineAppUi::HandleModelChangeL (   ) 
 

HandleModelChangeL Update the system to reflect changes in the model

Definition at line 117 of file guiengineappui.cpp.

References iAppView.

00118     {
00119     // Redraw the application view based on the new model.
00120     iAppView->DrawNow();
00121 
00122     // Update the file name in the task list to show the current file.
00123     iEikonEnv->UpdateTaskNameL();
00124     }

void CGuiEngineAppUi::HandleCommandL (  TInt  aCommand  ) 
 

HandleCommandL From CAknView, takes care of command handling.

Parameters:
aCommand  Command to be handled

Definition at line 83 of file guiengineappui.cpp.

References CGuiEngineAppView::Clear(), iAppView, and CGuiEngineAppView::SetBrushShapeType().

00084     {
00085 
00086     switch ( aCommand )
00087         {
00088         case EEikCmdExit:
00089         case EAknSoftkeyExit:
00090             SaveL();
00091             Exit();
00092             break;
00093 
00094         case KClear:
00095             iAppView->Clear();
00096             break;
00097 
00098         case KSelectBrushCircle:
00099             iAppView->SetBrushShapeType( CGuiEngineAppView::ECircle );
00100             break;
00101 
00102         case KSelectBrushRectangle:
00103             iAppView->SetBrushShapeType( CGuiEngineAppView::ERectangle );
00104             break;
00105 
00106         default:
00107             break;
00108         }
00109 
00110     }


Member Data Documentation

CGuiEngineAppView* CGuiEngineAppUi::iAppView [private]
 

iAppView The application view Owned by CGuiEngineAppUi object.

Definition at line 103 of file guiengineappui.h.

Referenced by ConstructL(), HandleCommandL(), HandleModelChangeL(), RestoreL(), StoreL(), and ~CGuiEngineAppUi().

CGuiEngineDocument* CGuiEngineAppUi::iDocument [private]
 

iDocument, The current document Not owned by CGuiEngineAppUi object.

Definition at line 109 of file guiengineappui.h.

Referenced by ConstructL().


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

© Nokia 2009

Back to top