|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : LandmarksInfoContainer.h 00004 * Part of : Landmark Reference Application 00005 * Interface : - 00006 * Description : See class description below 00007 * Version : 1.0 00008 * 00009 * Copyright (c) 2004-2006 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. 00013 * ============================================================================== 00014 */ 00015 00016 #ifndef __LANDMARKS_INFOCONTAINER_H__ 00017 #define __LANDMARKS_INFOCONTAINER_H__ 00018 00019 // INCLUDES 00020 #include <coecntrl.h> 00021 #include <EPos_Landmarks.h> 00022 #include "LandmarksInfoContainer.h" 00023 00024 // FORWARD DECLARATIONS 00025 class CEikTextListBox; 00026 class CAknNavigationDecorator; 00027 class CAknTitlePane; 00028 class CAknView; 00029 class CLandmarksApplicationEngine; 00030 class CLandmarksInfoModel; 00031 class CPosLandmark; 00032 00033 // CLASS DECLARATION 00034 00035 /** 00036 * This is the landmarks container that contains a listbox with landmark's 00037 * fields listed. 00038 */ 00039 class CLandmarksInfoContainer : public CCoeControl 00040 { 00041 public: // Constructors and destructor 00042 00043 /** 00044 * C++ constructor. 00045 * 00046 * @param aView parent view 00047 * @param aEngine the landmark engine 00048 * @param aNaviDecorator the tab group to hide when editing landmarks 00049 */ 00050 CLandmarksInfoContainer( 00051 CAknView& aView, 00052 CLandmarksApplicationEngine& aEngine, 00053 CAknNavigationDecorator* aNaviDecorator); 00054 00055 /** 00056 * Symbian 2nd phase constructor. Should be called after constructor to 00057 * fully construct the object. 00058 * 00059 * @param aRect the rectangle this Container will be drawn to 00060 */ 00061 void ConstructL(const TRect& aRect); 00062 00063 /** 00064 * Destructor. 00065 */ 00066 ~CLandmarksInfoContainer(); 00067 00068 public: // New functions 00069 00070 /** 00071 * Enables/disables the navi pane. 00072 * 00073 * @param aVisible ETrue enables navipane, EFalse disables navipane 00074 */ 00075 void MakeNaviPaneVisibleL(TBool aVisible); 00076 00077 /** Stores title pane */ 00078 void StoreTitlePaneL(); 00079 00080 /** Retores title pane */ 00081 void RestoreTitlePane(); 00082 00083 /** 00084 * Loads specified landmark into the container 00085 * @param aLandmarkId The ID of the landmark to be viewed. 00086 */ 00087 void LoadLandmarkL(TPosLmItemId aLandmarkId); 00088 00089 /** 00090 * Launches a dialog for editing the current landmark. 00091 * Removes tabs on the navi pane before launching the dialog. Restores 00092 * the navi pane after the dialog is dismissed. 00093 */ 00094 void EditLandmarkL(); 00095 00096 public: // from CoeControl 00097 00098 /** 00099 * Gets the number of controls contained in a compound control 00100 * 00101 * @return Number of component controls 00102 */ 00103 TInt CountComponentControls() const; 00104 00105 /** 00106 * Gets the specified component 00107 * 00108 * @param aIndex specification for component pointer 00109 * @return Pointer to component control 00110 */ 00111 CCoeControl* ComponentControl(TInt aIndex) const; 00112 00113 /** 00114 * Called by framework when the view size is changed. 00115 */ 00116 void SizeChanged(); 00117 00118 /** 00119 * Handles key events. 00120 * 00121 * @param aKeyEvent the key event 00122 * @param aType the type of key event 00123 * @return EKeyWasConsumed if keyevent was handled, EKeyWasNotConsumed 00124 * otherwise 00125 */ 00126 TKeyResponse OfferKeyEventL( 00127 const TKeyEvent& aKeyEvent, TEventCode aType); 00128 00129 /** Reacts to screen size change */ 00130 void HandleResourceChange(TInt aType); 00131 00132 private: 00133 00134 /** 00135 * Creates the listbox. 00136 */ 00137 void CreateListBoxL(); 00138 00139 /** 00140 * Updates the title bar from landmark name. 00141 */ 00142 void UpdateTitleBarL(); 00143 00144 /** 00145 * Updates the view. 00146 */ 00147 void UpdateL(); 00148 00149 private: // Data 00150 00151 //! The control used to display landmark info. 00152 CEikTextListBox* iListBox; 00153 00154 //! The parent view 00155 CAknView& iView; 00156 00157 //! iEngine the application engine used for accessing landmarks 00158 CLandmarksApplicationEngine& iEngine; 00159 00160 //! Decorates the navi pane (with navigation arrows etc) 00161 CAknNavigationDecorator* iNaviDecorator; 00162 00163 //! The data model for the listbox 00164 CLandmarksInfoModel* iModel; 00165 00166 //! The landmark being viewed 00167 CPosLandmark* iLandmark; 00168 00169 //! The title pane that is dynamically updated 00170 CAknTitlePane* iTitlePane; 00171 00172 //! The original title that the title pane displayed before modified 00173 HBufC* iOriginalTitle; 00174 00175 //! Fields used in the list 00176 RArray<TInt> iFields; 00177 }; 00178 00179 #endif // __LANDMARKS_INFOCONTAINER_H__ 00180
|
© Nokia 2006 |