author | William Roberts <williamr@symbian.org> |
Tue, 16 Mar 2010 16:12:26 +0000 | |
branch | Symbian2 |
changeset 2 | 2fe1408b6811 |
parent 1 | 666f914201fb |
child 4 | 837f303aceeb |
permissions | -rw-r--r-- |
williamr@2 | 1 |
/* |
williamr@2 | 2 |
* Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 3 |
* All rights reserved. |
williamr@2 | 4 |
* This component and the accompanying materials are made available |
williamr@2 | 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 |
williamr@2 | 6 |
* which accompanies this distribution, and is available |
williamr@2 | 7 |
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
williamr@2 | 8 |
* |
williamr@2 | 9 |
* Initial Contributors: |
williamr@2 | 10 |
* Nokia Corporation - initial contribution. |
williamr@2 | 11 |
* |
williamr@2 | 12 |
* Contributors: |
williamr@2 | 13 |
* |
williamr@2 | 14 |
* Description: |
williamr@2 | 15 |
* |
williamr@2 | 16 |
*/ |
williamr@2 | 17 |
|
williamr@2 | 18 |
|
williamr@2 | 19 |
|
williamr@2 | 20 |
#if !defined(__EIKLBM_H__) |
williamr@2 | 21 |
#define __EIKLBM_H__ |
williamr@2 | 22 |
|
williamr@2 | 23 |
|
williamr@2 | 24 |
#if !defined(__E32BASE_H__) |
williamr@2 | 25 |
#include <e32base.h> |
williamr@2 | 26 |
#endif |
williamr@2 | 27 |
|
williamr@2 | 28 |
#if !defined(__BAMDESCA_H__) |
williamr@2 | 29 |
#include <bamdesca.h> |
williamr@2 | 30 |
#endif |
williamr@2 | 31 |
|
williamr@2 | 32 |
|
williamr@2 | 33 |
// for some reason, doxygen seems to refuse documenting this... |
williamr@2 | 34 |
|
williamr@2 | 35 |
/** @enum TListBoxModelItemArrayOwnership |
williamr@2 | 36 |
* List box item array ownership flags. These values are used to |
williamr@2 | 37 |
* describe whether or not a list box model owns an item array. |
williamr@2 | 38 |
*/ |
williamr@2 | 39 |
enum TListBoxModelItemArrayOwnership |
williamr@2 | 40 |
{ |
williamr@2 | 41 |
/** The list box model owns the item array, and will delete it in |
williamr@2 | 42 |
* its destructor.*/ |
williamr@2 | 43 |
ELbmOwnsItemArray, |
williamr@2 | 44 |
/** The model does not own the item array. You must maintain a |
williamr@2 | 45 |
* pointer to it and free it explicitly before your program exits. */ |
williamr@2 | 46 |
ELbmDoesNotOwnItemArray |
williamr@2 | 47 |
}; |
williamr@2 | 48 |
|
williamr@2 | 49 |
/** |
williamr@2 | 50 |
* Description |
williamr@2 | 51 |
* List box data model interface. |
williamr@2 | 52 |
* |
williamr@2 | 53 |
* This mixin protocol is implemented by all list box models. List box |
williamr@2 | 54 |
* models provide information needed to display the required data in a |
williamr@2 | 55 |
* list box. |
williamr@2 | 56 |
* |
williamr@2 | 57 |
* Writing derived classes: |
williamr@2 | 58 |
* |
williamr@2 | 59 |
* This class should be implemented by anything providing data for |
williamr@2 | 60 |
* display in a CEikListBox-derived class. The very basic interface |
williamr@2 | 61 |
* offered by MListBoxModel is usually expanded upon to provide more |
williamr@2 | 62 |
* information for the specialised subclasses of CEikListBox. It is |
williamr@2 | 63 |
* usual when deriving specialised list boxes to subclass the list box |
williamr@2 | 64 |
* class, its view classes and its model together. See also: |
williamr@2 | 65 |
* |
williamr@2 | 66 |
*/ |
williamr@2 | 67 |
class MListBoxModel |
williamr@2 | 68 |
{ |
williamr@2 | 69 |
public: |
williamr@2 | 70 |
/** |
williamr@2 | 71 |
* Destructor. |
williamr@2 | 72 |
*/ |
williamr@2 | 73 |
IMPORT_C virtual ~MListBoxModel(); |
williamr@2 | 74 |
|
williamr@2 | 75 |
/** |
williamr@2 | 76 |
* Gets the number of items in the list box |
williamr@2 | 77 |
* @return Number of items. |
williamr@2 | 78 |
*/ |
williamr@2 | 79 |
virtual TInt NumberOfItems() const = 0; |
williamr@2 | 80 |
|
williamr@2 | 81 |
/** |
williamr@2 | 82 |
* Gets an array of strings used by the list box for matching |
williamr@2 | 83 |
* user keypresses incrementally. |
williamr@2 | 84 |
* |
williamr@2 | 85 |
* @return A pointer to the array. |
williamr@2 | 86 |
*/ |
williamr@2 | 87 |
virtual const MDesCArray* MatchableTextArray() const = 0; |
williamr@2 | 88 |
|
williamr@2 | 89 |
private: |
williamr@2 | 90 |
IMPORT_C virtual TAny* MListBoxModel_Reserved(); |
williamr@2 | 91 |
}; |
williamr@2 | 92 |
|
williamr@2 | 93 |
/** |
williamr@2 | 94 |
* Text list box model interface. |
williamr@2 | 95 |
* |
williamr@2 | 96 |
* Text list box models provide the text of the items which are drawn |
williamr@2 | 97 |
* by an associated CTextListItemDrawer. This interface is implemented |
williamr@2 | 98 |
* by CTextListBoxModel. |
williamr@2 | 99 |
*/ |
williamr@2 | 100 |
|
williamr@2 | 101 |
class MTextListBoxModel : public MListBoxModel |
williamr@2 | 102 |
{ |
williamr@2 | 103 |
public: |
williamr@2 | 104 |
/** |
williamr@2 | 105 |
* Destructor |
williamr@2 | 106 |
*/ |
williamr@2 | 107 |
IMPORT_C ~MTextListBoxModel(); |
williamr@2 | 108 |
|
williamr@2 | 109 |
/** |
williamr@2 | 110 |
* Gets the item text for an item by its index. This text, |
williamr@2 | 111 |
* rather than the matcher string, is drawn by |
williamr@2 | 112 |
* CTextListItemDrawers. |
williamr@2 | 113 |
* |
williamr@2 | 114 |
* @param aItemIndex Index specifying an item. |
williamr@2 | 115 |
* @return The text for that item. |
williamr@2 | 116 |
*/ |
williamr@2 | 117 |
virtual TPtrC ItemText(TInt aItemIndex) const = 0; |
williamr@2 | 118 |
|
williamr@2 | 119 |
private: // from MListBoxModel |
williamr@2 | 120 |
IMPORT_C virtual TAny* MListBoxModel_Reserved(); |
williamr@2 | 121 |
}; |
williamr@2 | 122 |
|
williamr@2 | 123 |
#endif |