S60 3rd Edition SDK for Symbian OS
Example Applications Guide

CEnvMappingAppUi Class Reference

#include <EnvMappingAppUi.h>

List of all members.

Public Member Functions

void ConstructL ()
virtual ~CEnvMappingAppUi ()

Private Member Functions

void DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane)
void HandleCommandL (TInt aCommand)
virtual TKeyResponse HandleKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType)

Private Attributes

CEnvMappingContainer * iAppContainer


Detailed Description

Application UI class that contains the CEnvMappingContainer (as required by the Symbian UI application architecture).

Definition at line 39 of file EnvMappingAppUi.h.


Constructor & Destructor Documentation

CEnvMappingAppUi::~CEnvMappingAppUi (   )  [virtual]
 

Destructor. Removes CTextureContainer from the control stack and destroys it.

Definition at line 49 of file EnvMappingAppUi.cpp.

References iAppContainer.

00050 {
00051     if ( iAppContainer )
00052     {
00053         RemoveFromStack( iAppContainer );
00054         delete iAppContainer;
00055     }
00056 }


Member Function Documentation

void CEnvMappingAppUi::ConstructL (   ) 
 

Second phase constructor. Creates the CTextureContainer and adds it to the control stack.

Definition at line 32 of file EnvMappingAppUi.cpp.

References CEnvMappingContainer::ConstructL(), and iAppContainer.

00033 {
00034     BaseConstructL(CAknAppUi::EAknEnableSkin);
00035 
00036     iAppContainer = new (ELeave) CEnvMappingContainer;
00037     iAppContainer->SetMopParent(this);
00038 
00039     iAppContainer->ConstructL( ClientRect() );
00040     AddToStackL( iAppContainer );
00041 }

void CEnvMappingAppUi::DynInitMenuPaneL (  TInt  aResourceId,
CEikMenuPane *  aMenuPane
)  [private]
 

This method is called by the EIKON framework just before it displays a menu pane. Builds the dynamic menuitems for toggling the various options in the example.

Definition at line 66 of file EnvMappingAppUi.cpp.

00068     {
00069     }

void CEnvMappingAppUi::HandleCommandL (  TInt  aCommand  )  [private]
 

CEikAppUi method that is used to handle user commands. Handles menu commands and application exit request.

Parameters:
aCommand Command to be handled.

Definition at line 124 of file EnvMappingAppUi.cpp.

References CEnvMapping::DuckModel(), CEnvMapping::HeadModel(), iAppContainer, and CEnvMappingContainer::iEnvMapping.

00125 {
00126   switch ( aCommand )
00127   {
00128       case EAknSoftkeyBack:
00129       case EEikCmdExit:
00130       {
00131           Exit();
00132           break;
00133       }
00134       case EEnvMappingDuckObject:
00135       {
00136           iAppContainer->iEnvMapping->DuckModel();
00137           break;
00138       }
00139       case EEnvMappingHeadObject:
00140       {
00141           iAppContainer->iEnvMapping->HeadModel();
00142           break;
00143       }
00144       default:
00145           break;      
00146   }
00147 }

TKeyResponse CEnvMappingAppUi::HandleKeyEventL (  const TKeyEvent &  aKeyEvent,
TEventCode  aType
)  [private, virtual]
 

CEikAppUi method that is used to handle key events. Does nothing in this implemenation.

Parameters:
aKeyEvent Event to handled (ignored by this implementation).
aType Type of the key event (ignored by this implementation).
Returns:
Response code. Always EKeyWasNotConsumed in this implementation.

Definition at line 77 of file EnvMappingAppUi.cpp.

References iAppContainer, CEnvMappingContainer::iEnvMapping, CEnvMapping::RotateObjectLeft(), and CEnvMapping::RotateObjectRight().

00079 {
00080     if ( iAppContainer->iEnvMapping->GetState() == CEnvMapping::ERunning )
00081     {
00082         if( aType == EEventKeyDown )
00083         {
00084             TUint scan = aKeyEvent.iScanCode;
00085             
00086             switch(scan)
00087             {
00088             case(14):
00089                 iAppContainer->iEnvMapping->RotateObjectLeft();
00090                 return EKeyWasConsumed;
00091             case(15):
00092                 iAppContainer->iEnvMapping->RotateObjectRight();
00093                 return EKeyWasConsumed;
00094             default:
00095                 return EKeyWasNotConsumed;
00096             }
00097         }
00098         else if( aType == EEventKeyUp )
00099         {
00100             TUint scan = aKeyEvent.iScanCode;
00101             
00102             switch(scan)
00103             {
00104             case(14):
00105                 iAppContainer->iEnvMapping->RotateObjectLeft();
00106                 return EKeyWasConsumed;
00107             case(15):
00108                 iAppContainer->iEnvMapping->RotateObjectRight();
00109                 return EKeyWasConsumed;
00110             default:
00111                 return EKeyWasNotConsumed;
00112             }
00113         }
00114     }
00115         
00116     return EKeyWasNotConsumed;
00117 }


Member Data Documentation

CEnvMappingContainer* CEnvMappingAppUi::iAppContainer [private]
 

GUI container that resides in this application UI.

Definition at line 86 of file EnvMappingAppUi.h.


© Nokia 2006

Back to top