2 * Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
20 #if !defined(__EIKLBM_H__)
24 #if !defined(__E32BASE_H__)
28 #if !defined(__BAMDESCA_H__)
33 // for some reason, doxygen seems to refuse documenting this...
35 /** @enum TListBoxModelItemArrayOwnership
36 * List box item array ownership flags. These values are used to
37 * describe whether or not a list box model owns an item array.
39 enum TListBoxModelItemArrayOwnership
41 /** The list box model owns the item array, and will delete it in
44 /** The model does not own the item array. You must maintain a
45 * pointer to it and free it explicitly before your program exits. */
46 ELbmDoesNotOwnItemArray
51 * List box data model interface.
53 * This mixin protocol is implemented by all list box models. List box
54 * models provide information needed to display the required data in a
57 * Writing derived classes:
59 * This class should be implemented by anything providing data for
60 * display in a CEikListBox-derived class. The very basic interface
61 * offered by MListBoxModel is usually expanded upon to provide more
62 * information for the specialised subclasses of CEikListBox. It is
63 * usual when deriving specialised list boxes to subclass the list box
64 * class, its view classes and its model together. See also:
73 IMPORT_C virtual ~MListBoxModel();
76 * Gets the number of items in the list box
77 * @return Number of items.
79 virtual TInt NumberOfItems() const = 0;
82 * Gets an array of strings used by the list box for matching
83 * user keypresses incrementally.
85 * @return A pointer to the array.
87 virtual const MDesCArray* MatchableTextArray() const = 0;
90 IMPORT_C virtual TAny* MListBoxModel_Reserved();
94 * Text list box model interface.
96 * Text list box models provide the text of the items which are drawn
97 * by an associated CTextListItemDrawer. This interface is implemented
98 * by CTextListBoxModel.
101 class MTextListBoxModel : public MListBoxModel
107 IMPORT_C ~MTextListBoxModel();
110 * Gets the item text for an item by its index. This text,
111 * rather than the matcher string, is drawn by
112 * CTextListItemDrawers.
114 * @param aItemIndex Index specifying an item.
115 * @return The text for that item.
117 virtual TPtrC ItemText(TInt aItemIndex) const = 0;
119 private: // from MListBoxModel
120 IMPORT_C virtual TAny* MListBoxModel_Reserved();