eventsui/eventsmgmtui/inc/evtmgmtuilistboxmodel.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2007 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 "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:  List box model class for Events Management UI.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_EVTMGMTUILISTBOXMODEL_H
       
    19 #define C_EVTMGMTUILISTBOXMODEL_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <AknUtils.h>
       
    23 
       
    24 // FORWARD DECLARATIONS
       
    25 class CEvtMgmtUiFilterModel;
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 /**
       
    30 *  CEvtMgmtUiListBoxModel bypasses the default filtering algorithm provided by 
       
    31 *  CAknFilteredTextListBoxModel. The filtering responsibility is forwarded to 
       
    32 *  the CCoeControl instance owning the list box. That instance must update the
       
    33 *  model when the filter has been modified.
       
    34 */
       
    35 class CEvtMgmtUiListBoxModel : public CAknFilteredTextListBoxModel
       
    36     {
       
    37     public:
       
    38 	    /**
       
    39 	     * Constructs a new instance of List box Model.
       
    40 	     *
       
    41 	     * @return The new instance of List box Model.
       
    42 	     * @leave System wide error code if the object creation fails.         
       
    43 	     */
       
    44 	    static CEvtMgmtUiListBoxModel* NewL( );
       
    45     
       
    46 		/**
       
    47 		 * Constructs a new instance of List box Model.
       
    48 		 * Leaves the created instance on the cleanup stack.
       
    49 		 *
       
    50 		 * @return The new instance of List box Model.
       
    51 		 * @leave System wide error code if the object creation fails.         
       
    52 		 */
       
    53 		static CEvtMgmtUiListBoxModel* NewLC( );  
       
    54 		
       
    55     public: // from CAknFilteredTextListBoxModel
       
    56 
       
    57         /**
       
    58         * Gets an array of strings to be displayed in the listbox for 
       
    59         * incremental matching of typed characters. This array always contains 
       
    60         * the total number of items rather than a subset filtered out from the 
       
    61         * model.
       
    62         *
       
    63         * @return A text array for matching.
       
    64         */
       
    65         const MDesCArray* MatchableTextArray() const;
       
    66 
       
    67         /**
       
    68         * Gets the number of text items in this list box model. This number is 
       
    69         * always the total number of items in the model rather than a subset 
       
    70         * filtered out from the model
       
    71         *
       
    72         * @return The number of text items in this list box model
       
    73         */
       
    74         TInt NumberOfItems() const;
       
    75 
       
    76         /**
       
    77         * Gets the text to be displayed in the list box control for a specific 
       
    78         * item.
       
    79         *
       
    80         * @param aItemIndex Index of an item
       
    81         * @return Text string to be displayed
       
    82         */
       
    83         TPtrC ItemText(TInt aItemIndex) const;
       
    84 
       
    85         /**
       
    86         * Set the Zero Row String.
       
    87         *
       
    88         * @param aZeroIndexString Zero Index String
       
    89         */
       
    90         void SetItemTextArrayToFilterModel();
       
    91         
       
    92         /**
       
    93          * Set the FindBox to Filter model.
       
    94          */
       
    95         void SetFindToFilterModel(CAknSearchField* aSearchField);
       
    96     public:
       
    97         /**
       
    98          * Inherited from MDesCArray
       
    99          */
       
   100         TInt    MdcaCount() const;
       
   101         
       
   102         /**
       
   103          * Inherited from MDesCArray
       
   104          */    
       
   105         TPtrC16 MdcaPoint( TInt aIndex ) const;
       
   106 
       
   107         /**
       
   108          * Destructor
       
   109          */    
       
   110         ~CEvtMgmtUiListBoxModel();
       
   111 
       
   112     private:
       
   113         /**
       
   114          * 2nd phase constructor
       
   115          */ 
       
   116         void ConstructL();
       
   117 
       
   118         /**
       
   119          * Default constructor
       
   120          */ 
       
   121         CEvtMgmtUiListBoxModel();
       
   122         
       
   123     private:
       
   124 
       
   125         /**
       
   126          * FilterModel Instance
       
   127 		 * Own:
       
   128          */    
       
   129         CEvtMgmtUiFilterModel* iEvtMgmtUiFilterModel;
       
   130 
       
   131     };
       
   132 
       
   133 #endif // C_EVTMGMTUILISTBOXMODEL_H
       
   134 
       
   135 // End of File