browserutilities/browserdialogsprovider/Inc/BrowserSelectElementModel.h
changeset 0 dd21522fd290
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:  Listbox for select element.
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef CBROWSERSELECTELEMENTMODEL_H
       
    20 #define CBROWSERSELECTELEMENTMODEL_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <AknUtils.h>
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class TBrCtlSelectElementFilterTextArray;
       
    27 class TBrCtlSelectElementItemTextArray;
       
    28 class TBrCtlSelectOptionData;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 * Model for the WML selection list.
       
    34 */
       
    35 class CBrowserSelectElementModel : public CAknFilteredTextListBoxModel
       
    36     {
       
    37     protected:  // Constructors and destructor
       
    38         
       
    39         /**
       
    40         * C++ default constructor.
       
    41         * @param aElement The select element.
       
    42         */
       
    43         CBrowserSelectElementModel( const CArrayFix<TBrCtlSelectOptionData>& aOptions );
       
    44     
       
    45     public: // Constructors and destructor
       
    46 
       
    47         /**
       
    48         * Two-phased constructor.
       
    49         * It leaves a pointer on the cleanup stack.
       
    50         * @param aElement The select element.
       
    51         */
       
    52         static CBrowserSelectElementModel* NewLC( const CArrayFix<TBrCtlSelectOptionData>& aOptions );
       
    53 
       
    54         /**
       
    55         * Two-phased constructor.
       
    56         * @param aElement The select element.
       
    57         */
       
    58         static CBrowserSelectElementModel* NewL( const CArrayFix<TBrCtlSelectOptionData>& aOptions );
       
    59 
       
    60         /**
       
    61         * Destructor.
       
    62         */
       
    63         ~CBrowserSelectElementModel();
       
    64 
       
    65 
       
    66         /**
       
    67         * Get matchable text array (for filtering).
       
    68         * @return The matchable text array.
       
    69         */
       
    70         const MDesCArray* MatchableTextArray() const;
       
    71 
       
    72         
       
    73     public: // new function
       
    74 
       
    75         void SetItemArray();
       
    76 
       
    77     private:
       
    78 
       
    79         /**
       
    80         * By default EPOC constructor is private.
       
    81         */
       
    82         void ConstructL();
       
    83 
       
    84     private:    // New functions
       
    85 
       
    86         /**
       
    87         * Adds a prefix to the given string needed by the listbox.
       
    88         * @param aText Zeroterminated string without prefix.
       
    89         * @param aIsOptionGroup Optiongroups need different prefix.
       
    90         * @return Zeroterminated string with prefix.
       
    91         */
       
    92         TText* AddPrefixLC( TText* aText, TBool aIsOptionGroup ) const;
       
    93 
       
    94         /**
       
    95         * Stores text depending on the node's attributes.
       
    96         * @param aNode The node.
       
    97         */
       
    98         void FormatTextL( const TBrCtlSelectOptionData& optionData );
       
    99 
       
   100     private:    // Data
       
   101         
       
   102         TBrCtlSelectElementFilterTextArray* iFilterTexts;
       
   103         TBrCtlSelectElementItemTextArray*   iItemTexts;
       
   104 
       
   105         const CArrayFix<TBrCtlSelectOptionData>& iOptions;  // not owned
       
   106     };
       
   107 
       
   108 #endif            
       
   109 // End of File