|
Nokia N97 SDK Example Applications Guide |
00001 /* 00002 * ============================================================================ 00003 * Name : HierarchicalColumnListAppUi.cpp 00004 * Part of : Hierarchical Column List Example Application 00005 * Description : Implementation for HierarchicalColumnListAppUi class. 00006 * Version : %version: 1 % 00007 * 00008 * Copyright © 2007 Nokia. All rights reserved. 00009 * This material, including documentation and any related computer 00010 * programs, is protected by copyright controlled by Nokia 00011 * Corporation. 00012 * ============================================================================ 00013 */ 00014 00015 #include <avkon.hrh> 00016 #include <aknnotewrappers.h> 00017 00018 #include "HierarchicalColumnList.pan" 00019 #include "HierarchicalColumnListAppUi.h" 00020 #include "HierarchicalColumnListAppView.h" 00021 #include "HierarchicalColumnList.hrh" 00022 #include <HierarchicalColumnList.rsg> 00023 00024 // ======== MEMBER FUNCTIONS ======== 00025 00026 // --------------------------------------------------------------------------- 00027 // ConstructL is called by the application framework. 00028 // --------------------------------------------------------------------------- 00029 // 00030 void CHierarchicalColumnListAppUi::ConstructL() 00031 { 00032 BaseConstructL( EAknEnableSkin | EAknEnableMSK ); 00033 00034 iAppView = CHierarchicalColumnListAppView::NewL( ClientRect() ); 00035 iAppView->SetMopParent( this ); 00036 00037 AddToStackL( iAppView ); 00038 } 00039 00040 00041 CHierarchicalColumnListAppUi::CHierarchicalColumnListAppUi() 00042 { 00043 // no implementation required 00044 } 00045 00046 00047 CHierarchicalColumnListAppUi::~CHierarchicalColumnListAppUi() 00048 { 00049 if ( iAppView ) 00050 { 00051 RemoveFromStack( iAppView ); 00052 delete iAppView; 00053 iAppView = NULL; 00054 } 00055 } 00056 00057 00058 // --------------------------------------------------------------------------- 00059 // From class CAknAppUi. 00060 // Dynamically initialises a menu pane. 00061 // --------------------------------------------------------------------------- 00062 // 00063 void CHierarchicalColumnListAppUi::DynInitMenuPaneL( TInt aResourceId, 00064 CEikMenuPane* aMenuPane ) 00065 { 00066 if ( aResourceId == R_HIERARCHICALCOLUMNLIST_MENU ) 00067 { 00068 iAppView->DynInitOptionsMenuPaneL( aMenuPane ); 00069 } 00070 else if ( aResourceId == R_HIERARCHICALCOLUMNLIST_SETTINGS_MENU ) 00071 { 00072 iAppView->DynInitSettingsMenuPaneL( aMenuPane ); 00073 } 00074 else if ( aResourceId == R_AVKON_MENUPANE_MARKABLE_LIST_IMPLEMENTATION ) 00075 { 00076 iAppView->DynInitMarkingMenuPaneL( aMenuPane ); 00077 } 00078 } 00079 00080 00081 // --------------------------------------------------------------------------- 00082 // From class CAknAppUi. 00083 // Handle any menu commands 00084 // --------------------------------------------------------------------------- 00085 // 00086 void CHierarchicalColumnListAppUi::HandleCommandL( TInt aCommand ) 00087 { 00088 switch( aCommand ) 00089 { 00090 case EEikCmdExit: 00091 case EAknSoftkeyExit: 00092 Exit(); 00093 break; 00094 00095 case EHclExampleCmdExpand: 00096 iAppView->ExpandFocusedNode(); 00097 break; 00098 00099 case EHclExampleCmdCollapse: 00100 iAppView->CollapseFocusedNode(); 00101 break; 00102 00103 case EHclExampleCmdOpen: 00104 iAppView->OpenFocusedItem(); 00105 break; 00106 00107 case EHclExampleCmdChangeLooping: 00108 iAppView->ChangeLooping(); 00109 break; 00110 00111 case EHclExampleCmdChangeMarquee: 00112 iAppView->ChangeMarquee(); 00113 break; 00114 00115 case EHclExampleCmdChangeMarkable: 00116 iAppView->ChangeMarkable(); 00117 break; 00118 00119 case EHclExampleCmdChangeIndicators: 00120 iAppView->ChangeFunctionIndicatorsL(); 00121 break; 00122 00123 case EAknCmdMark: 00124 iAppView->Mark(); 00125 break; 00126 00127 case EAknCmdUnmark: 00128 iAppView->Unmark(); 00129 break; 00130 00131 case EAknMarkAll: 00132 iAppView->MarkAll(); 00133 break; 00134 00135 case EAknUnmarkAll: 00136 iAppView->UnmarkAll(); 00137 break; 00138 00139 default: 00140 break; 00141 } 00142 } 00143 00144 00145 // --------------------------------------------------------------------------- 00146 // From class CAknAppUi. 00147 // Handles foreground event. 00148 // --------------------------------------------------------------------------- 00149 // 00150 void CHierarchicalColumnListAppUi::HandleForegroundEventL( TBool aForeground ) 00151 { 00152 if ( aForeground ) 00153 { 00154 AddToStackL( iAppView ); 00155 } 00156 else 00157 { 00158 RemoveFromStack( iAppView ); 00159 } 00160 } 00161 00162 00163 // --------------------------------------------------------------------------- 00164 // From class CAknAppUi. 00165 // Handles resource changes. 00166 // --------------------------------------------------------------------------- 00167 // 00168 void CHierarchicalColumnListAppUi::HandleResourceChangeL( TInt aType ) 00169 { 00170 CAknAppUi::HandleResourceChangeL( aType ); 00171 if ( iAppView ) 00172 { 00173 if ( aType == KEikDynamicLayoutVariantSwitch ) 00174 { 00175 iAppView->SetRect( ClientRect() ); 00176 } 00177 iAppView->HandleResourceChange( aType ); 00178 } 00179 } 00180 00181 00182
|
© Nokia 2009 |