S60 3rd Edition SDK for Symbian OS
Example Applications Guide

CLensFlareAppUi Class Reference

#include <LensFlareAppUi.h>

List of all members.

Public Member Functions

void ConstructL ()
virtual ~CLensFlareAppUi ()

Private Member Functions

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

Private Attributes

CLensFlareContainer * iAppContainer


Detailed Description

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

Definition at line 35 of file LensFlareAppUi.h.


Constructor & Destructor Documentation

CLensFlareAppUi::~CLensFlareAppUi (   )  [virtual]
 

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

Definition at line 62 of file LensFlareAppUi.cpp.

References iAppContainer.

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


Member Function Documentation

void CLensFlareAppUi::ConstructL (   ) 
 

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

Definition at line 47 of file LensFlareAppUi.cpp.

References CLensFlareContainer::ConstructL(), and iAppContainer.

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

void CLensFlareAppUi::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 79 of file LensFlareAppUi.cpp.

00081     {
00082     }

void CLensFlareAppUi::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 146 of file LensFlareAppUi.cpp.

00147     {
00148     switch ( aCommand )
00149         {
00150         case EAknSoftkeyBack:
00151         case EEikCmdExit:
00152             {
00153             Exit();
00154             break;
00155             }
00156         default:
00157             break;      
00158         }
00159     }

TKeyResponse CLensFlareAppUi::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 90 of file LensFlareAppUi.cpp.

References iAppContainer, CLensflare::iDirection, CLensFlareContainer::iLensflare, and CLensflare::TurnCameraElevation().

00092         {
00093         if ( iAppContainer->iLensflare->GetState() == CLensflare::ERunning )
00094                 {
00095                 if ( aType == EEventKeyDown )
00096                         {
00097                         switch ( aKeyEvent.iScanCode )
00098                                 {
00099                                 case EStdKeyLeftArrow:
00100                                         {
00101                                         GLbyte & direction = iAppContainer->iLensflare->iDirection;
00102               
00103                                         if ( direction != 0 )
00104                                                 {
00105                                                 direction = 0;
00106                                                 }
00107                                         else
00108                                                 {
00109                                                 direction = -1;
00110                                                 }
00111                                         }
00112                         return EKeyWasConsumed;
00113                                 case EStdKeyRightArrow:
00114                                         {
00115                                         GLbyte & direction = iAppContainer->iLensflare->iDirection;
00116               
00117                                         if ( direction != 0 )
00118                                                 {
00119                                                 direction = 0;
00120                                                 }
00121                                         else 
00122                                                 {
00123                                                 direction = +1;
00124                                                 }
00125                                         }
00126                         return EKeyWasConsumed;
00127                                 case EStdKeyUpArrow:
00128                                         iAppContainer->iLensflare->TurnCameraElevation(-1, 1.0f);
00129                                         return EKeyWasConsumed;
00130                                 case EStdKeyDownArrow:
00131                                         iAppContainer->iLensflare->TurnCameraElevation(+1, 1.0f);
00132                                         return EKeyWasConsumed;
00133                                 default:
00134                                         return EKeyWasNotConsumed;
00135                                 }
00136                         }
00137                 }
00138                 return EKeyWasNotConsumed;
00139         }


Member Data Documentation

CLensFlareContainer* CLensFlareAppUi::iAppContainer [private]
 

GUI container that resides in this application UI.

Definition at line 82 of file LensFlareAppUi.h.


© Nokia 2006

Back to top