aknmultilinequerycontrol.h

Go to the documentation of this file.
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             
00102             IMPORT_C void HandleResourceChange(TInt aType); 
00103 
00104     public:
00110         class TIndex 
00111         {   
00112         public: 
00113             TIndex(const TLinePosition& aLinePos, TInt aFirstQueryPromptLines,TInt aSecondQueryPromptLines);
00114         
00115         public: 
00116             TInt MainPanePQDCWindow() const;    
00117             TInt CDCQPWindowLine1() const;  
00118             TInt CDCQPWindowLine2() const;  
00119             TInt CDCQPWindowLine3() const;  
00120             TInt CDCQPWindowRectangles() const; 
00121             TInt CDCQPWindowLine5() const;  
00122 
00123             TInt CDCQPWindowTextsLine1(TInt aLineNum) const;
00124             TInt CDCQPWindowTextsLine2() const; 
00125             TInt CDCQPWindowTextsLine3(TInt aLineNum) const;
00126             TInt CDCQPWindowTextsLine4() const; 
00127 
00128             TInt CDCPQWindowGraphicsLine5() const;  
00129 
00130         public:
00131             const TInt LinePos() const { return iLinePos; }
00132         
00133         private:    
00134             TInt FirstQueryPromptLines() const;
00135             TInt SecondQueryPromptLines() const;
00136 
00137             void SelfTest() const;
00138     
00139         private:
00140             TLinePosition  iLinePos;    
00141             TInt           iFirstQueryPromptLines;  
00142             TInt           iSecondQueryPromptLines;
00143         };
00144         
00145     protected: // From CAknQueryControl
00149         void SetLineWidthsL();
00150 
00154         void ConstructQueryL(TResourceReader& aRes);
00155 
00159         TRect LayoutRect();
00160 
00161     private://From CCoeControl
00162         void SizeChanged();
00163         void Draw(const TRect& aRect) const;
00164     private:
00168         IMPORT_C void* ExtensionInterface( TUid aInterface );
00169 
00170     private:    //Layout methods
00171         void LayoutPrompt(const TLayoutMethod& aLayoutM);
00172         void LayoutSeparator(const TLayoutMethod& aLayoutM);
00173         
00174         void LayoutEditor(const TLayoutMethod& aLayoutM);
00175         void LayoutEditorFrame(const TLayoutMethod& aLayoutM);
00176         void LayoutEditorIndicator(const TLayoutMethod& aLayoutM);
00177 
00182         void WindowLayout( TAknWindowLineLayout& aLayout ) const;
00183 
00184     private: //Implementation methods
00185         void   SetLinePosition();
00186         TInt16 FirstLineHeight() const;
00187         TInt16 SecondLineHeight() const;
00188 
00189     private:
00190         TAknLayoutRect iLayoutLineBetweenEntryFields; 
00191         TLinePosition  iLinePos;    
00192         TInt           iFirstQueryPromptLines;  
00193         TInt           iSecondQueryPromptLines; 
00194     };
00195 
00196 
00197 
00203  class CAknExtMultilineQueryControl : public CAknExtQueryControl
00204     {
00205     public: // Constructors and destructor
00209         IMPORT_C CAknExtMultilineQueryControl();
00210 
00214         IMPORT_C virtual ~CAknExtMultilineQueryControl();
00215 
00216     public://new API functions
00224         IMPORT_C void SetNbrOfPromptLines(TInt aNbrOfPromptLinesFirstLine, TInt aNbrOfPromptLinesSecondLine);
00225     
00229         IMPORT_C TBool IsFirst() const;
00230 
00234         IMPORT_C TBool IsSecond() const;
00235 
00236     public: //Functions from CAknQueryControl
00237 
00245         IMPORT_C virtual CCoeControl* ControlByLayoutOrNull(TInt aLayout);
00246 
00247     public: // Functions from CCoeControl
00248 
00254         IMPORT_C TSize MinimumSize();
00255 
00261             IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
00262             
00263             IMPORT_C void HandleResourceChange(TInt aType);   
00264 
00265     public:
00271         class TIndex 
00272         {   
00273         public: 
00274             TIndex(const TLinePosition& aLinePos, TInt aFirstQueryPromptLines,TInt aSecondQueryPromptLines);
00275         
00276         public: 
00277             TInt MainPanePQDCWindow() const;    
00278             TInt CDCQPWindowLine1() const;  
00279             TInt CDCQPWindowLine2() const;  
00280             TInt CDCQPWindowLine3() const;  
00281             TInt CDCQPWindowRectangles() const; 
00282             TInt CDCQPWindowLine5() const;  
00283 
00284             TInt CDCQPWindowTextsLine1(TInt aLineNum) const;
00285             TInt CDCQPWindowTextsLine2() const; 
00286             TInt CDCQPWindowTextsLine3(TInt aLineNum) const;
00287             TInt CDCQPWindowTextsLine4() const; 
00288 
00289             TInt CDCPQWindowGraphicsLine5() const;  
00290 
00291         public:
00292             const TInt LinePos() const { return iLinePos; }
00293         
00294         private:    
00295             TInt FirstQueryPromptLines() const;
00296             TInt SecondQueryPromptLines() const;
00297 
00298             void SelfTest() const;
00299     
00300         private:
00301             TLinePosition  iLinePos;    
00302             TInt           iFirstQueryPromptLines;  
00303             TInt           iSecondQueryPromptLines;
00304         };
00305         
00306     protected: // From CAknQueryControl
00310         void SetLineWidthsL();
00311 
00315         void ConstructQueryL(TResourceReader& aRes);
00316 
00320         TRect LayoutRect();
00321 
00322     private://From CCoeControl
00323         void SizeChanged();
00324         void Draw(const TRect& aRect) const;
00325     private:
00329         IMPORT_C void* ExtensionInterface( TUid aInterface );
00330 
00331     private:    //Layout methods
00332         void LayoutPrompt(const TLayoutMethod& aLayoutM);
00333         void LayoutSeparator(const TLayoutMethod& aLayoutM);
00334         
00335         void LayoutEditor(const TLayoutMethod& aLayoutM);
00336         void LayoutEditorFrame(const TLayoutMethod& aLayoutM);
00337         void LayoutEditorIndicator(const TLayoutMethod& aLayoutM);
00338 
00343         void WindowLayout( TAknWindowLineLayout& aLayout ) const;
00344 
00345     private: //Implementation methods
00346         void   SetLinePosition();
00347         TInt16 FirstLineHeight() const;
00348                 TInt16 SecondLineHeight() const;
00349     private:
00350         TAknLayoutRect iLayoutLineBetweenEntryFields; 
00351         TLinePosition  iLinePos;    
00352         TInt           iFirstQueryPromptLines;  
00353         TInt           iSecondQueryPromptLines;
00354         TAny*          iSpare_1;
00355 
00356 
00357     };
00358 
00359 #endif

Copyright © Nokia Corporation 2001-2008
Back to top