|
S60 3rd Edition SDK for Symbian OS Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : LandmarksCategoriesContainer.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_CATEGORIES_CONTAINER_H__ 00017 #define __LANDMARKS_CATEGORIES_CONTAINER_H__ 00018 00019 // INCLUDES 00020 #include "LandmarksContainerBase.h" 00021 #include <coecobs.h> 00022 00023 // FORWARD DECLARATIONS 00024 class CLandmarksCategoriesModel; 00025 class CLandmarksDbEventHandler; 00026 class CLandmarksApplicationEngine; 00027 class CPosLandmarkCategory; 00028 class CEikMenuBar; 00029 00030 // CLASS DECLARATION 00031 00032 /** 00033 * This is the categories container that contains a listbox and a search field 00034 * for listing categories. 00035 */ 00036 class CLandmarksCategoriesContainer : public CLandmarksContainerBase, 00037 public MCoeControlObserver 00038 { 00039 public: // Constructors and destructor 00040 00041 /** 00042 * C++ constructor. 00043 * 00044 * @param aView the parent view 00045 * @param aEngine the landmark engine 00046 * @param aMenuBar the categories menubar 00047 */ 00048 CLandmarksCategoriesContainer( 00049 CAknView& aView, 00050 CLandmarksApplicationEngine& aEngine, 00051 CEikMenuBar& aMenuBar); 00052 00053 /** 00054 * Symbian 2nd phase constructor. Should be called after constructor to 00055 * fully construct the object. 00056 * 00057 * @param aRect the rectangle this Container will be drawn to 00058 */ 00059 void ConstructL(const TRect& aRect); 00060 00061 /** 00062 * Destructor. 00063 */ 00064 ~CLandmarksCategoriesContainer(); 00065 00066 public: // New functions 00067 00068 /** 00069 * Displays a onfirmation dialog and deletes the current category if 00070 * positive response. 00071 */ 00072 void DeleteCategoryL(); 00073 00074 /** 00075 * Returns the current category id. 00076 * 00077 * @return the current category id 00078 */ 00079 TPosLmItemId CurrentCategoryId(); 00080 00081 /** 00082 * Indicates whether a category is global or not. 00083 * 00084 * @return ETrue if global, EFalse otherwise. 00085 */ 00086 TBool IsGlobalL(); 00087 00088 public: // from CoeControl 00089 00090 /** 00091 * OfferKeyEventL handles key events. 00092 * 00093 * @param aKeyEvent the key event 00094 * @param aType the type of key event 00095 * @return EKeyWasConsumed if keyevent was handled, EKeyWasNotConsumed 00096 * otherwise 00097 */ 00098 TKeyResponse OfferKeyEventL( 00099 const TKeyEvent& aKeyEvent, TEventCode aType); 00100 00101 public: // From MLandmarksOperationObserver 00102 00103 /** 00104 * NotifyOperationProgressL notifies the progress and status of an 00105 * asynchronous operation. 00106 * 00107 * @param aOperation the type of operation that is reported. 00108 * @param aProgress the progress of the operation. 00109 * @param aErrorCode the status of the operation. 00110 */ 00111 void NotifyOperationProgressL( 00112 TOperation aOperation, 00113 TInt aProgress, 00114 TInt aErrorCode); 00115 00116 public: // From MLandmarksDbObserver 00117 00118 /** 00119 * NotifyDbEventL notifies that an event has occurred in the default 00120 * landmark database. 00121 * 00122 * @param aEvent contains info about the event. 00123 * @param aErrorCode possible error codes if reporting the event was 00124 * not successful. 00125 */ 00126 void NotifyDbEventL(TPosLmEvent& aEvent, TInt aErrorCode); 00127 00128 public: // From MCoeControlObserver 00129 00130 /** 00131 * HandleControlEventL handles an event from an observed control. 00132 * 00133 * @param aControl the control that reported the event 00134 * @param aEventType contains info about the event 00135 */ 00136 void HandleControlEventL(CCoeControl* aControl, TCoeEvent aEventType); 00137 00138 private: 00139 00140 /** 00141 * StartUpdateListBoxL initiates an asynchronous refresh of the listbox. 00142 */ 00143 void StartUpdateListBoxL(); 00144 00145 /** 00146 * HandleSearchReadyL updates the state of this class when a search 00147 * operation has completed. 00148 * 00149 * @param aErrorCode the error code of the search operation 00150 */ 00151 void HandleSearchReadyL(TInt aErrorCode); 00152 00153 /** 00154 * HandleReadReadyL updates the state of this class when a read 00155 * operation has completed. 00156 * 00157 * @param aErrorCode the error code of the search operation 00158 */ 00159 void HandleReadReadyL(TInt aErrorCode); 00160 00161 private: // Data 00162 00163 //! The menubar displayed for this vew 00164 CEikMenuBar& iMenuBar; 00165 00166 //! Contains the data model for the listbox 00167 CLandmarksCategoriesModel* iModel; 00168 00169 //! Indicates if the first page of landmarks has been read. 00170 TBool iReadingFirstPage; 00171 }; 00172 00173 00174 #endif // __LANDMARKS_CATEGORIES_CONTAINER_H__ 00175 00176 // End of File 00177
|
© Nokia 2006 |