00001 /* 00002 * ============================================================================ 00003 * Name : AknMultilineQueryControl.h 00004 * Part of : Avkon 00005 * 00006 * Description: 00007 * Implementation of the query control for multiline queries 00008 * Version: 00009 * 00010 * Copyright © 2002 Nokia Corporation. 00011 * This material, including documentation and any related 00012 * computer programs, is protected by copyright controlled by 00013 * Nokia Corporation. All rights are reserved. Copying, 00014 * including reproducing, storing, adapting or translating, any 00015 * or all of this material requires the prior written consent of 00016 * Nokia Corporation. This material also contains confidential 00017 * information which may not be disclosed to others without the 00018 * prior written consent of Nokia Corporation. 00019 * ============================================================================ 00020 */ 00021 00022 00023 #ifndef __AKN_MULTILINE_QUERY_CONTROL_H 00024 #define __AKN_MULTILINE_QUERY_CONTROL_H 00025 00026 // INCLUDES 00027 #include <coecntrl.h> 00028 #include <aknquerycontrol.h> 00029 00030 enum TLinePosition 00031 { 00032 EFirstLine = 0, 00033 ESecondLine 00034 }; 00035 00036 class TAknWindowLineLayout; 00037 00041 class CAknMultilineQueryControl : public CAknQueryControl 00042 { 00043 public: // Constructors and destructor 00047 IMPORT_C CAknMultilineQueryControl(); 00048 00052 IMPORT_C virtual ~CAknMultilineQueryControl(); 00053 00054 public://new API functions 00062 IMPORT_C void SetNbrOfPromptLines(TInt aNbrOfPromptLinesFirstLine, TInt aNbrOfPromptLinesSecondLine); 00063 00067 IMPORT_C TBool IsFirst() const; 00068 00072 IMPORT_C TBool IsSecond() const; 00073 00074 public: //Functions from CAknQueryControl 00075 00083 IMPORT_C virtual CCoeControl* ControlByLayoutOrNull(TInt aLayout); 00084 00085 public: // Functions from CCoeControl 00086 00092 IMPORT_C TSize MinimumSize(); 00093 00099 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); 00100 00101 #start_since SINCE_3_1_SDK 00102 00105 IMPORT_C void HandleResourceChange(TInt aType); 00106 #end_since SINCE_3_1_SDK 00107 public: 00113 class TIndex 00114 { 00115 public: 00116 TIndex(const TLinePosition& aLinePos, TInt aFirstQueryPromptLines,TInt aSecondQueryPromptLines); 00117 00118 public: 00119 TInt MainPanePQDCWindow() const; 00120 TInt CDCQPWindowLine1() const; 00121 TInt CDCQPWindowLine2() const; 00122 TInt CDCQPWindowLine3() const; 00123 TInt CDCQPWindowRectangles() const; 00124 TInt CDCQPWindowLine5() const; 00125 00126 TInt CDCQPWindowTextsLine1(TInt aLineNum) const; 00127 TInt CDCQPWindowTextsLine2() const; 00128 TInt CDCQPWindowTextsLine3(TInt aLineNum) const; 00129 TInt CDCQPWindowTextsLine4() const; 00130 00131 TInt CDCPQWindowGraphicsLine5() const; 00132 00133 public: 00134 const TInt LinePos() const { return iLinePos; } 00135 00136 private: 00137 TInt FirstQueryPromptLines() const; 00138 TInt SecondQueryPromptLines() const; 00139 00140 void SelfTest() const; 00141 00142 private: 00143 TLinePosition iLinePos; 00144 TInt iFirstQueryPromptLines; 00145 TInt iSecondQueryPromptLines; 00146 }; 00147 00148 protected: // From CAknQueryControl 00152 void SetLineWidthsL(); 00153 00157 void ConstructQueryL(TResourceReader& aRes); 00158 00162 TRect LayoutRect(); 00163 00164 private://From CCoeControl 00165 void SizeChanged(); 00166 void Draw(const TRect& aRect) const; 00167 private: 00171 IMPORT_C void* ExtensionInterface( TUid aInterface ); 00172 00173 private: //Layout methods 00174 void LayoutPrompt(const TLayoutMethod& aLayoutM); 00175 void LayoutSeparator(const TLayoutMethod& aLayoutM); 00176 00177 void LayoutEditor(const TLayoutMethod& aLayoutM); 00178 void LayoutEditorFrame(const TLayoutMethod& aLayoutM); 00179 void LayoutEditorIndicator(const TLayoutMethod& aLayoutM); 00180 00185 void WindowLayout( TAknWindowLineLayout& aLayout ) const; 00186 00187 private: //Implementation methods 00188 void SetLinePosition(); 00189 TInt16 FirstLineHeight() const; 00190 TInt16 SecondLineHeight() const; 00191 00192 private: 00193 TAknLayoutRect iLayoutLineBetweenEntryFields; 00194 TLinePosition iLinePos; 00195 TInt iFirstQueryPromptLines; 00196 TInt iSecondQueryPromptLines; 00197 }; 00198 00199 00200 00206 class CAknExtMultilineQueryControl : public CAknExtQueryControl 00207 { 00208 public: // Constructors and destructor 00212 IMPORT_C CAknExtMultilineQueryControl(); 00213 00217 IMPORT_C virtual ~CAknExtMultilineQueryControl(); 00218 00219 public://new API functions 00227 IMPORT_C void SetNbrOfPromptLines(TInt aNbrOfPromptLinesFirstLine, TInt aNbrOfPromptLinesSecondLine); 00228 00232 IMPORT_C TBool IsFirst() const; 00233 00237 IMPORT_C TBool IsSecond() const; 00238 00239 public: //Functions from CAknQueryControl 00240 00248 IMPORT_C virtual CCoeControl* ControlByLayoutOrNull(TInt aLayout); 00249 00250 public: // Functions from CCoeControl 00251 00257 IMPORT_C TSize MinimumSize(); 00258 00264 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); 00265 00266 #start_since SINCE_3_1_SDK 00267 00270 IMPORT_C void HandleResourceChange(TInt aType); 00271 #end_since SINCE_3_1_SDK 00272 public: 00278 class TIndex 00279 { 00280 public: 00281 TIndex(const TLinePosition& aLinePos, TInt aFirstQueryPromptLines,TInt aSecondQueryPromptLines); 00282 00283 public: 00284 TInt MainPanePQDCWindow() const; 00285 TInt CDCQPWindowLine1() const; 00286 TInt CDCQPWindowLine2() const; 00287 TInt CDCQPWindowLine3() const; 00288 TInt CDCQPWindowRectangles() const; 00289 TInt CDCQPWindowLine5() const; 00290 00291 TInt CDCQPWindowTextsLine1(TInt aLineNum) const; 00292 TInt CDCQPWindowTextsLine2() const; 00293 TInt CDCQPWindowTextsLine3(TInt aLineNum) const; 00294 TInt CDCQPWindowTextsLine4() const; 00295 00296 TInt CDCPQWindowGraphicsLine5() const; 00297 00298 public: 00299 const TInt LinePos() const { return iLinePos; } 00300 00301 private: 00302 TInt FirstQueryPromptLines() const; 00303 TInt SecondQueryPromptLines() const; 00304 00305 void SelfTest() const; 00306 00307 private: 00308 TLinePosition iLinePos; 00309 TInt iFirstQueryPromptLines; 00310 TInt iSecondQueryPromptLines; 00311 }; 00312 00313 protected: // From CAknQueryControl 00317 void SetLineWidthsL(); 00318 00322 void ConstructQueryL(TResourceReader& aRes); 00323 00327 TRect LayoutRect(); 00328 00329 private://From CCoeControl 00330 void SizeChanged(); 00331 void Draw(const TRect& aRect) const; 00332 private: 00336 IMPORT_C void* ExtensionInterface( TUid aInterface ); 00337 00338 private: //Layout methods 00339 void LayoutPrompt(const TLayoutMethod& aLayoutM); 00340 void LayoutSeparator(const TLayoutMethod& aLayoutM); 00341 00342 void LayoutEditor(const TLayoutMethod& aLayoutM); 00343 void LayoutEditorFrame(const TLayoutMethod& aLayoutM); 00344 void LayoutEditorIndicator(const TLayoutMethod& aLayoutM); 00345 00350 void WindowLayout( TAknWindowLineLayout& aLayout ) const; 00351 00352 private: //Implementation methods 00353 void SetLinePosition(); 00354 TInt16 FirstLineHeight() const; 00355 TInt16 SecondLineHeight() const; 00356 private: 00357 TAknLayoutRect iLayoutLineBetweenEntryFields; 00358 TLinePosition iLinePos; 00359 TInt iFirstQueryPromptLines; 00360 TInt iSecondQueryPromptLines; 00361 TAny* iSpare_1; 00362 00363 00364 }; 00365 00366 #endif