|
Nokia N97 SDK Example Applications Guide |
#include <SimpleLightAppUi.h>
Inheritance diagram for CSimpleLightAppUi:

Definition at line 33 of file SimpleLightAppUi.h.
Public Member Functions |
|
| void | ConstructL () |
| virtual | ~CSimpleLightAppUi () |
Private Member Functions |
|
| void | DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane) |
| void | HandleCommandL (TInt aCommand) |
| virtual TKeyResponse | HandleKeyEventL (const TKeyEvent &aKeyEvent, TEventCode aType) |
Private Attributes |
|
| CSimpleLightContainer * | iAppContainer |
|
|
Destructor. Removes CSimpleLightContainer from the control stack and destroys it. Definition at line 39 of file SimpleLightAppUi.cpp. References iAppContainer. 00040 { 00041 if ( iAppContainer ) 00042 { 00043 RemoveFromStack( iAppContainer ); 00044 delete iAppContainer; 00045 } 00046 }
|
|
|
Second phase constructor. Creates the CSimpleLightContainer and adds it to the control stack. Definition at line 29 of file SimpleLightAppUi.cpp. References CSimpleLightContainer::ConstructL(), and iAppContainer. 00030 { 00031 BaseConstructL(); 00032 iAppContainer = new (ELeave) CSimpleLightContainer; 00033 iAppContainer->SetMopParent(this); 00034 iAppContainer->ConstructL( ClientRect(), this ); 00035 AddToStackL( iAppContainer ); 00036 }
|
|
||||||||||||
|
This method is called by the EIKON framework just before it displays a menu pane. Builds the dynamic menuitems for toggling the lights on and off in the example. Definition at line 56 of file SimpleLightAppUi.cpp. References iAppContainer, CSimpleLight::iLampEnabled, CSimpleLight::iLightingEnabled, CSimpleLightContainer::iSimpleLight, and CSimpleLight::iSpotEnabled. 00058 { 00059 // Item texts for the lighting menu. 00060 if ( aResourceId == R_SIMPLELIGHT_LIGHTING_MENU ) 00061 { 00062 // Text for switching the lights on/off. 00063 if ( iAppContainer->iSimpleLight->iLightingEnabled ) 00064 { 00065 aMenuPane->SetItemTextL( ESimpleLightLights, R_LIGHTS_OFF ); 00066 } 00067 else 00068 { 00069 aMenuPane->SetItemTextL( ESimpleLightLights, R_LIGHTS_ON ); 00070 } 00071 00072 // Text for switching the lamp on/off. 00073 if ( iAppContainer->iSimpleLight->iLampEnabled ) 00074 { 00075 aMenuPane->SetItemTextL( ESimpleLightLamp, R_LAMP_OFF ); 00076 } 00077 else 00078 { 00079 aMenuPane->SetItemTextL( ESimpleLightLamp, R_LAMP_ON ); 00080 } 00081 00082 // Text for switching the spot on/off. 00083 if ( iAppContainer->iSimpleLight->iSpotEnabled ) 00084 { 00085 aMenuPane->SetItemTextL( ESimpleLightSpot, R_SPOT_OFF ); 00086 } 00087 else 00088 { 00089 aMenuPane->SetItemTextL( ESimpleLightSpot, R_SPOT_ON ); 00090 } 00091 } 00092 }
|
|
|
CEikAppUi method that is used to handle user commands. Handles menu commands and application exit request.
Definition at line 110 of file SimpleLightAppUi.cpp. References CSimpleLight::DuckModel(), CSimpleLight::HeadModel(), iAppContainer, CSimpleLightContainer::iSimpleLight, CSimpleLight::ToggleLamp(), CSimpleLight::ToggleLighting(), and CSimpleLight::ToggleSpot(). 00111 { 00112 switch ( aCommand ) 00113 { 00114 case EAknSoftkeyBack: 00115 case EEikCmdExit: 00116 { 00117 Exit(); 00118 break; 00119 } 00120 case ESimpleLightLights: 00121 iAppContainer->iSimpleLight->ToggleLighting(); 00122 break; 00123 case ESimpleLightLamp: 00124 iAppContainer->iSimpleLight->ToggleLamp(); 00125 break; 00126 case ESimpleLightSpot: 00127 iAppContainer->iSimpleLight->ToggleSpot(); 00128 break; 00129 case ESimpleLightDuck: 00130 iAppContainer->iSimpleLight->DuckModel(); 00131 break; 00132 case ESimpleLightHead: 00133 iAppContainer->iSimpleLight->HeadModel(); 00134 break; 00135 default: 00136 break; 00137 } 00138 }
|
|
||||||||||||
|
CEikAppUi method that is used to handle key events. Does nothing in this implemenation.
Definition at line 99 of file SimpleLightAppUi.cpp.
|
|
|
GUI container that resides in this application UI. Definition at line 78 of file SimpleLightAppUi.h. Referenced by ConstructL(), DynInitMenuPaneL(), HandleCommandL(), and ~CSimpleLightAppUi(). |
|
© Nokia 2009 |