S60 3rd Edition SDK for Symbian OS
Example Applications Guide

CHierarchyAppUi Class Reference

#include <HierarchyAppUi.h>

List of all members.

Public Member Functions

void ConstructL ()
virtual ~CHierarchyAppUi ()

Private Member Functions

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

Private Attributes

CHierarchyContainer * iAppContainer


Detailed Description

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

Definition at line 35 of file HierarchyAppUi.h.


Constructor & Destructor Documentation

CHierarchyAppUi::~CHierarchyAppUi (   )  [virtual]
 

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

Definition at line 61 of file HierarchyAppUi.cpp.

References iAppContainer.

00062     {
00063     if ( iAppContainer )
00064         {
00065         RemoveFromStack( iAppContainer );
00066         delete iAppContainer;
00067         }
00068    }


Member Function Documentation

void CHierarchyAppUi::ConstructL (   ) 
 

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

Definition at line 47 of file HierarchyAppUi.cpp.

References CHierarchyContainer::ConstructL(), and iAppContainer.

00048     {
00049     BaseConstructL();
00050     iAppContainer = new (ELeave) CHierarchyContainer;
00051     iAppContainer->SetMopParent(this);
00052     iAppContainer->ConstructL( ClientRect() );
00053     AddToStackL( iAppContainer );
00054     }

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

This method is called by the EIKON framework just before it displays a menu pane. Does nothing in this implemenation.

Definition at line 78 of file HierarchyAppUi.cpp.

00080     {
00081     }

void CHierarchyAppUi::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 137 of file HierarchyAppUi.cpp.

00138     {
00139     switch ( aCommand )
00140         {
00141         case EAknSoftkeyBack:
00142         case EEikCmdExit:
00143             {
00144             Exit();
00145             break;
00146             }
00147         default:
00148             break;      
00149         }
00150     }

TKeyResponse CHierarchyAppUi::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 88 of file HierarchyAppUi.cpp.

References iAppContainer, CHierarchyContainer::iHierarchy, CHierarchy::RotateObjectDown(), CHierarchy::RotateObjectUp(), and CHierarchy::SwitchRotateMode().

00090     {
00091     if ( aType == EEventKeyDown )
00092         {
00093         TUint scan = aKeyEvent.iScanCode;
00094         
00095         switch ( scan )
00096             {
00097             case(EStdKeyUpArrow):
00098                 iAppContainer->iHierarchy->RotateObjectUp(ETrue);
00099                 return EKeyWasConsumed;
00100             case(EStdKeyDownArrow):
00101                 iAppContainer->iHierarchy->RotateObjectDown(ETrue);
00102                 return EKeyWasConsumed;
00103             case(EStdKeyDevice3):
00104                 iAppContainer->iHierarchy->SwitchRotateMode();
00105                 return EKeyWasConsumed;
00106             default:
00107                 return EKeyWasNotConsumed;
00108             }
00109         }
00110     else if ( aType == EEventKeyUp )
00111         {
00112         TUint scan = aKeyEvent.iScanCode;
00113         
00114         switch ( scan )
00115             {
00116             case(EStdKeyUpArrow):
00117                 iAppContainer->iHierarchy->RotateObjectUp(EFalse);
00118                 return EKeyWasConsumed;
00119             case(EStdKeyDownArrow):
00120                 iAppContainer->iHierarchy->RotateObjectDown(EFalse);
00121                 return EKeyWasConsumed;
00122             default:
00123                 return EKeyWasNotConsumed;
00124             }
00125         }
00126     else
00127         {
00128         return EKeyWasNotConsumed;
00129         }
00130     }


Member Data Documentation

CHierarchyContainer* CHierarchyAppUi::iAppContainer [private]
 

GUI container that resides in this application UI.

Definition at line 79 of file HierarchyAppUi.h.


© Nokia 2006

Back to top