browserutilities/browserdialogsprovider/Inc/BrowserSelectElementDlg.h
changeset 0 dd21522fd290
child 17 c8a366e56285
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Popuplist for select element.
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef BROWSERSELECTELEMENTDLG_H
       
    21 #define BROWSERSELECTELEMENTDLG_H
       
    22 
       
    23 //  INCLUDES
       
    24 
       
    25 // User includes
       
    26 
       
    27 // System includes
       
    28 #include <BrCtlDialogsProvider.h>
       
    29 
       
    30 #include <aknpopup.h>
       
    31 #include <aknlists.h>
       
    32 
       
    33 // FORWARD DECLARATIONS
       
    34 class CBrowserSelectElementListBox;
       
    35 class CBrowserDialogsProviderAsyncExit;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 *   The dialog, that pops up the selection list
       
    41 *   for the select element.
       
    42 */
       
    43 class CBrowserSelectElementDlg : public CAknPopupList
       
    44     {
       
    45     public:  // Constructors and destructor
       
    46         
       
    47         /**
       
    48         * Two-phased constructor.
       
    49         * @param aTitle title of the listbox
       
    50         * @param aBrCtlSelectOptionType
       
    51         * @param aOptions listbox elements array
       
    52         */
       
    53         static CBrowserSelectElementDlg* NewL( 
       
    54                         const TDesC& aTitle,
       
    55                         const TBrCtlSelectOptionType aBrCtlSelectOptionType,
       
    56                         CArrayFix<TBrCtlSelectOptionData>& aOptions );
       
    57 
       
    58         /**
       
    59         * Destructor.
       
    60         */
       
    61         virtual ~CBrowserSelectElementDlg();
       
    62 
       
    63     protected:  // Constructors and destructor
       
    64     
       
    65         /**
       
    66         * C++ default constructor.
       
    67         * @param aElement The select element
       
    68         */
       
    69         CBrowserSelectElementDlg( 
       
    70             const TBrCtlSelectOptionType aBrCtlSelectOptionType,
       
    71             CArrayFix<TBrCtlSelectOptionData>& aOptionsOrg );
       
    72 
       
    73         /**
       
    74         * EPOC constructor that can leave.
       
    75         * @param aTitle
       
    76         */
       
    77         void ConstructL( const TDesC& aTitle );
       
    78         
       
    79     public: // From MEikListBoxObserver
       
    80 
       
    81         /**
       
    82         * Handles listbox events.
       
    83         * Closes popup when item is selected in a singleselect list.
       
    84         * @since Series60 1.2
       
    85         * @param aListBox Source of event
       
    86         * @param aEventType Event type
       
    87         */
       
    88         void HandleListBoxEventL( CEikListBox* aListBox,
       
    89                                   TListBoxEvent aEventType );
       
    90 
       
    91         /**
       
    92         * Handles listbox events.
       
    93         * Closes popup when item is selected in a singleselect list.
       
    94         * @since Series60 1.2
       
    95         * @param aListBox Source of event
       
    96         * @param aEventType Event type
       
    97         */
       
    98         void HandleControlEventL
       
    99             ( CCoeControl* aControl, TCoeEvent aEventType );
       
   100 
       
   101     protected:  // From CAknPopupList
       
   102 
       
   103         void AttemptExitL( TBool aAccept );
       
   104 
       
   105     public:
       
   106 
       
   107         /**
       
   108         * Force the dialog to destroy itself
       
   109         */
       
   110         void DestroyPopupL();
       
   111  
       
   112     protected:
       
   113 
       
   114         /**
       
   115         * Store selection in the original options array
       
   116         */
       
   117         void StoreSelections();
       
   118 
       
   119     private:    // Data
       
   120 
       
   121         TBool                               iContentValid;
       
   122 
       
   123         TBrCtlSelectOptionType              iBrCtlSelectOptionType;
       
   124 
       
   125         CBrowserSelectElementListBox*       iListBox;       // owned
       
   126         CAknSinglePopupMenuStyleListBox*    iHistoryList;   // owned
       
   127 
       
   128         CArrayFix<TBrCtlSelectOptionData>&  iOptionsOrg;    // not owned
       
   129 
       
   130         CBrowserDialogsProviderAsyncExit*   iAsyncExit;      // owned
       
   131     };
       
   132 
       
   133 #endif  //BROWSERSELECTELEMENTDLG_H
       
   134             
       
   135 // End of File