epoc32/include/mw/eiktxlbm.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
     1 /*
     2 * Copyright (c) 1997-1999 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 #if !defined(__EIKTXLBM_H__)
    21 #define __EIKTXLBM_H__  
    22 
    23 #if !defined(__EIKLBM_H__)
    24 #include <eiklbm.h>
    25 #endif
    26 
    27 /**
    28 * Text list box model.
    29 */
    30 class CTextListBoxModel : public CBase, public MTextListBoxModel
    31     {
    32     public:
    33         /**
    34         * Default constructor.
    35         */
    36         IMPORT_C CTextListBoxModel();
    37 
    38         /**
    39         * destructor
    40         */
    41         IMPORT_C virtual ~CTextListBoxModel();
    42 
    43         /**
    44         * Gets the number of text items in this list box model.
    45         * @return The number of text items.
    46         */
    47         IMPORT_C virtual TInt NumberOfItems() const;
    48 
    49         /**
    50         * Gets an array of strings for incremental matching of
    51         * typed characters. For the text list box model, these
    52         * strings are those that are displayed (see ItemText()).
    53         *
    54         * @return A text array for matching.
    55         */
    56         IMPORT_C virtual const MDesCArray* MatchableTextArray() const;
    57 
    58         /**
    59         * Gets the text to be displayed in the list box control
    60         * for the specified item.
    61         *
    62         * @param aItemIndex Index of an item. 
    63         * @return Text string to be displayed. 
    64         */
    65         IMPORT_C virtual TPtrC ItemText( TInt aItemIndex ) const;
    66 
    67         /**
    68         * Second-phase constructor.
    69         *
    70         * This function completes construction of a
    71         * default-constructed CTextListBoxModel, initialising any
    72         * members which are stored on the heap. Whether ownership of
    73         * the array is taken depends on the value of the
    74         * TListBoxModelItemArrayOwnership enum.
    75         *
    76         * @param aItemTextArray The item array. 
    77         * @param aOwnershipType Whether or not to take ownership of the array. 
    78         */
    79         IMPORT_C virtual void ConstructL( MDesCArray* aItemTextArray = NULL,
    80                                           TListBoxModelItemArrayOwnership aOwnershipType = ELbmOwnsItemArray );
    81 
    82         /**
    83         * Sets a new text item array. Panics if aItemTextArray is NULL.
    84         *
    85         * @param aItemTextArray New item text array. 
    86         */
    87         IMPORT_C void SetItemTextArray( MDesCArray* aItemTextArray );
    88 
    89         /**
    90         * Sets the item array ownership type.
    91         *
    92         * @param aOwnershipType Item array ownership. 
    93         */
    94         IMPORT_C void SetOwnershipType( TListBoxModelItemArrayOwnership aOwnershipType );
    95 
    96         /**
    97         * The array of text items modelled by this text list box model.
    98         *
    99         * @return A pointer to the array.
   100         */
   101         IMPORT_C MDesCArray* ItemTextArray() const;
   102 
   103     protected:
   104         /**
   105         * Gets the item array ownership type.
   106         *
   107         * @return Item array ownership. 
   108         */
   109         IMPORT_C TListBoxModelItemArrayOwnership ItemArrayOwnershipType() const;
   110         
   111     private: // from MListBoxModel
   112         IMPORT_C virtual TAny* MListBoxModel_Reserved();
   113         
   114     protected:
   115         /**
   116         * The array of text items modelled by this text list box model.
   117         */
   118         MDesCArray* iItemTextArray;
   119         
   120     private:
   121         TListBoxModelItemArrayOwnership iItemArrayOwnershipType;
   122     }; 
   123 
   124 
   125 #endif