epoc32/include/mw/aknlistquerycontrol.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 aknlistquerycontrol.h
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef     __AKN_LIST_QUERY_CONTROL_H
       
    21 #define     __AKN_LIST_QUERY_CONTROL_H
       
    22 
       
    23 #include <AknControl.h>
       
    24 
       
    25 #include <aknpopupheadingpane.h>
       
    26 #include <aknmessagequerycontrol.h>
       
    27 
       
    28 class CEikFormattedCellListBox;
       
    29 struct TAknPopupWindowLayoutDef;
       
    30 
       
    31 /**
       
    32  * List query control class.
       
    33  */
       
    34 class CAknListQueryControl : public CAknControl
       
    35     {
       
    36     public:
       
    37         /**
       
    38         * Constructor
       
    39         */
       
    40         IMPORT_C CAknListQueryControl();
       
    41     
       
    42         /**
       
    43         * Constructs control from resources
       
    44         */
       
    45         IMPORT_C void ConstructFromResourceL(TResourceReader& aRes);
       
    46 
       
    47         /**
       
    48         * Destructor
       
    49         */
       
    50         IMPORT_C virtual ~CAknListQueryControl();
       
    51 
       
    52         /**
       
    53         * From CCoeControl
       
    54         *
       
    55         * @return   Minimum size of the control
       
    56         */
       
    57         IMPORT_C TSize MinimumSize();
       
    58 
       
    59         /**
       
    60         * From CCoeControl
       
    61         *   Returns number of controls inside the query control
       
    62         * @return   Number of component controls
       
    63         */
       
    64         IMPORT_C TInt CountComponentControls() const;
       
    65 
       
    66         /**
       
    67         * From CCoeControl
       
    68         *   Returns a control determined by control id
       
    69         * @param    anIndex     Index of a control to be returned
       
    70         * @return   CCoeControl Pointer to control
       
    71         */
       
    72         IMPORT_C CCoeControl* ComponentControl(TInt anIndex) const;
       
    73 
       
    74         /**
       
    75         * From CCoeControl
       
    76         *   Handles key events - Gets called by CONE
       
    77         * @param    aKeyEvent   The key event
       
    78         * @param    aType       The type of the event
       
    79         * @return   Indicates whether or not the key event was
       
    80         *               used by this control
       
    81         */
       
    82         IMPORT_C TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType);
       
    83 
       
    84         /**
       
    85         * From CCoeControl
       
    86         *   Draws the control
       
    87         * @param    aRect   The region of the control to be redrawn
       
    88         */
       
    89         IMPORT_C void Draw(const TRect& aRect) const;
       
    90 
       
    91         /**
       
    92         * Sets layout for list query control
       
    93         * @param aLayout    Layout to be set
       
    94         */
       
    95         IMPORT_C void SetLayout(TAknPopupWindowLayoutDef* aLayout);
       
    96 
       
    97         IMPORT_C void FocusChanged(TDrawNow aDrawNow);
       
    98 
       
    99         /**
       
   100         * Returns pointer to listbox
       
   101         * @return   Pointer to CEikFormattedCellListBox
       
   102 		*/
       
   103         inline CEikFormattedCellListBox* Listbox() const;
       
   104 
       
   105         /**
       
   106         * Returns pointer to heading
       
   107         * @return   Pointer to CAknPopupHeadingPane
       
   108 		*/
       
   109         inline CAknPopupHeadingPane* Heading() const;
       
   110 
       
   111         /**
       
   112         * Return type of the list
       
   113         * @return Type of the list
       
   114         */
       
   115         inline TInt Listtype() const;
       
   116 
       
   117         /**
       
   118         * From CCoeControl.     
       
   119         * Handles pointer events
       
   120         */
       
   121     	IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
       
   122     	
       
   123     	/**
       
   124         * Get pointer to messageControl if such exists.
       
   125         * @since 3.0
       
   126         */
       
   127         CAknMessageQueryControl* MessageBox() const;
       
   128 
       
   129     private:
       
   130         /**
       
   131         * From CAknControl
       
   132         */
       
   133         IMPORT_C void* ExtensionInterface( TUid aInterface );
       
   134 
       
   135     private:
       
   136         CEikFormattedCellListBox* iListBox;
       
   137         CAknPopupHeadingPane*     iHeading;
       
   138         TInt                      iListType;
       
   139         TAknPopupWindowLayoutDef* iLayout;
       
   140         CAknMessageQueryControl*  iMessageBox;        
       
   141 
       
   142         TInt iSpare[1];
       
   143 
       
   144 	public:
       
   145 
       
   146 		/**
       
   147 		 * Deprecated - do not use
       
   148 		 */
       
   149         inline CEikFormattedCellListBox* listbox() const;
       
   150     };
       
   151 
       
   152 inline CEikFormattedCellListBox *CAknListQueryControl::Listbox() const 
       
   153 	{ 
       
   154 	return iListBox; 
       
   155 	}
       
   156 
       
   157 inline CAknPopupHeadingPane *CAknListQueryControl::Heading() const 
       
   158     {
       
   159     if ( iHeading && iHeading->Prompt() )
       
   160         return iHeading;
       
   161     return 0;
       
   162     }
       
   163 
       
   164 inline TInt CAknListQueryControl::Listtype() const 
       
   165 	{ 
       
   166 	return iListType; 
       
   167 	}
       
   168 
       
   169 /**
       
   170  * Deprecated methods
       
   171  */
       
   172 inline CEikFormattedCellListBox* CAknListQueryControl::listbox() const 
       
   173 	{ 
       
   174 	return Listbox();
       
   175 	}
       
   176 
       
   177 #endif