williamr@2: /* williamr@2: * Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: #if !defined(__EIKLBM_H__) williamr@2: #define __EIKLBM_H__ williamr@2: williamr@2: williamr@2: #if !defined(__E32BASE_H__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: #if !defined(__BAMDESCA_H__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: williamr@2: // for some reason, doxygen seems to refuse documenting this... williamr@2: williamr@2: /** @enum TListBoxModelItemArrayOwnership williamr@2: * List box item array ownership flags. These values are used to williamr@2: * describe whether or not a list box model owns an item array. williamr@2: */ williamr@2: enum TListBoxModelItemArrayOwnership williamr@2: { williamr@2: /** The list box model owns the item array, and will delete it in williamr@2: * its destructor.*/ williamr@2: ELbmOwnsItemArray, williamr@2: /** The model does not own the item array. You must maintain a williamr@2: * pointer to it and free it explicitly before your program exits. */ williamr@2: ELbmDoesNotOwnItemArray williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Description williamr@2: * List box data model interface. williamr@2: * williamr@2: * This mixin protocol is implemented by all list box models. List box williamr@2: * models provide information needed to display the required data in a williamr@2: * list box. williamr@2: * williamr@2: * Writing derived classes: williamr@2: * williamr@2: * This class should be implemented by anything providing data for williamr@2: * display in a CEikListBox-derived class. The very basic interface williamr@2: * offered by MListBoxModel is usually expanded upon to provide more williamr@2: * information for the specialised subclasses of CEikListBox. It is williamr@2: * usual when deriving specialised list boxes to subclass the list box williamr@2: * class, its view classes and its model together. See also: williamr@2: * williamr@2: */ williamr@2: class MListBoxModel williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C virtual ~MListBoxModel(); williamr@2: williamr@2: /** williamr@2: * Gets the number of items in the list box williamr@2: * @return Number of items. williamr@2: */ williamr@2: virtual TInt NumberOfItems() const = 0; williamr@2: williamr@2: /** williamr@2: * Gets an array of strings used by the list box for matching williamr@2: * user keypresses incrementally. williamr@2: * williamr@2: * @return A pointer to the array. williamr@2: */ williamr@2: virtual const MDesCArray* MatchableTextArray() const = 0; williamr@2: williamr@2: private: williamr@2: IMPORT_C virtual TAny* MListBoxModel_Reserved(); williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Text list box model interface. williamr@2: * williamr@2: * Text list box models provide the text of the items which are drawn williamr@2: * by an associated CTextListItemDrawer. This interface is implemented williamr@2: * by CTextListBoxModel. williamr@2: */ williamr@2: williamr@2: class MTextListBoxModel : public MListBoxModel williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C ~MTextListBoxModel(); williamr@2: williamr@2: /** williamr@2: * Gets the item text for an item by its index. This text, williamr@2: * rather than the matcher string, is drawn by williamr@2: * CTextListItemDrawers. williamr@2: * williamr@2: * @param aItemIndex Index specifying an item. williamr@2: * @return The text for that item. williamr@2: */ williamr@2: virtual TPtrC ItemText(TInt aItemIndex) const = 0; williamr@2: williamr@2: private: // from MListBoxModel williamr@2: IMPORT_C virtual TAny* MListBoxModel_Reserved(); williamr@2: }; williamr@2: williamr@2: #endif