|
Nokia N97 SDK Example Applications Guide |
00001 /* 00002 * ============================================================================== 00003 * Name : aknexquerycontainer.h 00004 * Part of : Query example 00005 * Interface : 00006 * Description : 00007 * Version : 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 __AKNEXQUERYCONTAINER_H__ 00017 #define __AKNEXQUERYCONTAINER_H__ 00018 00019 // INCLUDES 00020 #include <coecntrl.h> 00021 #include <coecobs.h> 00022 #include <AknGlobalListQuery.h> 00023 #include <AknQueryDialog.h> 00024 #include <aknglobalmsgquery.h> // for global message query 00025 #include <AknPopup.h> 00026 #include "AknExQueryGlobalListObserver.h" 00027 00028 // CONSTANTS 00029 const TInt KAknExQueryTextBufLength = 128; 00030 00031 #define KAknExQueryGray TRgb( 0xaaaaaa ) 00032 #define AKNEXQUERY_LABEL_ORIGIN TPoint( 0, 0 ) 00033 #define AKNEXQUERY_LABEL2_POSITION TPoint( 0, 20 ) 00034 00035 const TInt KAknExQueryCountComponentControls = 1; 00036 const TInt KAknExQueryNameColumnIndex = 0; 00037 const TInt KAknExQueryNameGapColumnIndex = 1; 00038 const TInt KAknExQueryListBoxRectPointX = 30; 00039 const TInt KAknExQueryListBoxRectPointY = 15; 00040 const TInt KAknExQueryListBoxRectWidth = 120; 00041 const TInt KAknExQueryListBoxRectHeight = 120; 00042 00043 _LIT( KAknExQueryMbmFilePath, "\\private\\A0000232\\aknexquery.mbm" ); 00044 00045 // FORWARD DECLARATIONS 00046 class CEikLabel; 00047 class CEikColumnListBox; 00048 class CAknExQueryView; 00049 class CAknExQueryBaseListEventHandler; 00050 00051 // CLASS DECLARATION 00052 00053 /** 00054 * CAknExQueryContainer container control class. 00055 */ 00056 class CAknExQueryContainer : public CCoeControl 00057 { 00058 public: 00059 00060 private: // Enumerations 00061 00062 enum TAknExQueryComponentControls 00063 { 00064 EAknExQueryComponentLabel, //0 00065 EAknExQueryComponentLabel2, //1 00066 EAknExQueryComponentListBox //2 00067 }; 00068 00069 public: // Constructors and destructor 00070 00071 /** 00072 * CAknExQueryContainer 00073 * Constructor. 00074 * @param aView Pointer to View class object. 00075 */ 00076 CAknExQueryContainer( CAknExQueryView* aView ); 00077 00078 /** 00079 * ConstructL 00080 * Symbian default constructor. 00081 * @param aRect Frame rectangle for container. 00082 */ 00083 void ConstructL( const TRect& aRect ); 00084 00085 /** 00086 * ~CAknExQueryContainer 00087 * Destructor. 00088 */ 00089 virtual ~CAknExQueryContainer(); 00090 00091 public: // New functions 00092 00093 /** 00094 * ShowConfirmationQueryL 00095 * Shows confirmation query. 00096 * @param aResourceId for dialog. 00097 * @param aTextResourceId for prompt. 00098 * @param aToneFlag is flag for adding tone to argument of constructor. 00099 * @param aPromptFlag is flag for displaying prompt dynamically. 00100 * @param aHeaderTextAndImageFlag 00101 * @param aTone 00102 */ 00103 void ShowConfirmationQueryL( 00104 const TInt aResourceId, 00105 const TInt aTextResourceId = 0, 00106 const TBool aPromptFlag = EFalse, 00107 const TBool aToneFlag = EFalse, 00108 const TBool aHeaderTextAndImageFlag = EFalse, 00109 const CAknQueryDialog::TTone aTone = CAknQueryDialog::ENoTone ); 00110 00111 00112 /** 00113 * ShowDataQueryL 00114 * Shows data query. 00115 * @param aQueryResourceId for dialog. 00116 * @param aTextResourceId for inial value. 00117 * @param aPromptResourceId for ptompt 00118 * @param aMaxLength sets up the length of the character. 00119 * @param aDisplayFlag 00120 */ 00121 void ShowDataQueryL( 00122 const TInt aQueryResourceId, 00123 const TInt aTextResourceId = 0, 00124 const TInt aPromptResourceId = 0, 00125 const TInt aMaxLength = 0, 00126 const TInt aDisplayFlag = ETrue ); 00127 00128 /** 00129 * ShowListQueryL 00130 * Show list query. 00131 * @param aResourceId 00132 */ 00133 void ShowListQueryL( const TInt aResourceId ); 00134 00135 /** 00136 * PopoutListBoxL 00137 * Create handler. 00138 */ 00139 void PopoutListBoxL(); 00140 00141 /** 00142 * CreateListBoxL 00143 * Creates listbox object. 00144 */ 00145 void CreateListBoxL(); 00146 00147 /** 00148 * DeleteListBoxL 00149 * Deletes listbox object. 00150 */ 00151 void DeleteListBoxL(); 00152 00153 /** 00154 * CreateLabelL 00155 * Creates label object. 00156 * @param aResourceId 00157 */ 00158 void CreateLabelL( TInt aResourceId ); 00159 00160 /** 00161 * DeleteLabelL 00162 * Deletes label object. 00163 */ 00164 void DeleteLabelL(); 00165 00166 /** 00167 * SetTextToLabelL 00168 * Set Label text. 00169 * @param aResourceId 00170 */ 00171 void SetTextToLabelL( TInt aResourceId ); 00172 00173 /** 00174 * ShowMessageL 00175 * Show Message Text. 00176 * @param aMessage 00177 */ 00178 void ShowMessageL( const TDesC& aMessage ); 00179 00180 /** 00181 * ShowMultiLineTimeAndDurationLayoutL 00182 * Show multi line time and duration layout. 00183 * @param aResourceId for dialog 00184 * @param aTopResourceId for top of multi line. 00185 */ 00186 void ShowMultiLineTimeAndDurationLayoutL( 00187 const TInt aResourceId, 00188 const TInt aTopResourceId ); 00189 00190 /** 00191 * ShowGlobalListQueryL 00192 * The function for the test of the following three APIs. 00193 * MoveSelectionUp, MoveSelectionDown, SelectItem. 00194 */ 00195 void ShowGlobalListQueryL(); 00196 00197 public: // From CCoeControl 00198 00199 /** 00200 * From CCoeControl, OfferKeyEventL. 00201 * Handles the key events. 00202 * @return if key-event is consumed, EKeyWasConsumed. 00203 * Else EKeyWasNotConsumed 00204 * @param aKeyEvent Key event 00205 * @param aType Type of key event ( EEventKey, EEventKeyUp or 00206 * EEventKeyDown ) 00207 */ 00208 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, 00209 TEventCode aType ); 00210 00211 private: // From CCoeControl 00212 00213 /** 00214 * From CCoeControl, SizeChanged. 00215 * 00216 */ 00217 void SizeChanged(); 00218 00219 /** 00220 * From CCoeControl, CountComponentControls. 00221 * Returns number of component. 00222 * @return Number of controls 00223 */ 00224 TInt CountComponentControls() const; 00225 00226 /** 00227 * From CCoeControl, ComponentControl. 00228 * Returns pointer to particular component. 00229 * @return Pointer to Control's component control, identified by index 00230 * @param aIndex Index of the control 00231 */ 00232 CCoeControl* ComponentControl( TInt aIndex ) const; 00233 00234 /** 00235 * From CCoeControl, Draw. 00236 * @param aRect Region of the control to be ( re )drawn. 00237 */ 00238 void Draw( const TRect& aRect ) const; 00239 00240 private: //New Function 00241 00242 /** 00243 * ShowResultMessageL 00244 * Show Result Message. 00245 * @param aResult 00246 */ 00247 void ShowResultMessageL( TBool aResult ); 00248 00249 /** 00250 * SetIconL 00251 * @param aDlg 00252 * @param aBitmap 00253 * @param aMask 00254 */ 00255 void SetIconL( CAknQueryDialog* aDlg, TInt32 aBitmap, TInt32 aMask ); 00256 00257 private: // Data 00258 00259 /** 00260 * iLabel 00261 * Owned by CAknExQueryContainer object. 00262 */ 00263 CEikLabel* iLabel; 00264 00265 /** 00266 * iLabelResultMessage 00267 * Owned by CAknExQueryContainer object. 00268 */ 00269 CEikLabel* iLabelResultMessage; 00270 00271 /** 00272 * iView 00273 * Does not own 00274 */ 00275 CAknExQueryView* iView; 00276 00277 /** 00278 * iListBox 00279 * Owned by CAknExQueryContainer object. 00280 */ 00281 CEikColumnListBox* iListBox; 00282 00283 /** 00284 * iHandler 00285 * Owned by CAknExQueryContainer object. 00286 */ 00287 CAknExQueryBaseListEventHandler* iHandler; 00288 00289 /** 00290 * iDisplayDialog, boolean for Display Dialog 00291 */ 00292 TBool iDisplayDialog; 00293 00294 /** 00295 * iGlobalListQuery 00296 * Owned by CAknExQueryContainer object. 00297 */ 00298 CAknGlobalListQuery* iGlobalListQuery; 00299 00300 /** 00301 * iGlobalListObserver 00302 * Owned by CAknExQueryContainer object. 00303 */ 00304 CAknExQueryGlobalListObserver* iGlobalListObserver; 00305 00306 }; 00307 00308 #endif // __AKNEXQUERYCONTAINER_H__ 00309 00310 // End of File
|
© Nokia 2009 |