1 eiklbm.h |
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(__EIKLBM_H__) |
|
21 #define __EIKLBM_H__ |
|
22 |
|
23 |
|
24 #if !defined(__E32BASE_H__) |
|
25 #include <e32base.h> |
|
26 #endif |
|
27 |
|
28 #if !defined(__BAMDESCA_H__) |
|
29 #include <bamdesca.h> |
|
30 #endif |
|
31 |
|
32 |
|
33 // for some reason, doxygen seems to refuse documenting this... |
|
34 |
|
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. |
|
38 */ |
|
39 enum TListBoxModelItemArrayOwnership |
|
40 { |
|
41 /** The list box model owns the item array, and will delete it in |
|
42 * its destructor.*/ |
|
43 ELbmOwnsItemArray, |
|
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 |
|
47 }; |
|
48 |
|
49 /** |
|
50 * Description |
|
51 * List box data model interface. |
|
52 * |
|
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 |
|
55 * list box. |
|
56 * |
|
57 * Writing derived classes: |
|
58 * |
|
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: |
|
65 * |
|
66 */ |
|
67 class MListBoxModel |
|
68 { |
|
69 public: |
|
70 /** |
|
71 * Destructor. |
|
72 */ |
|
73 IMPORT_C virtual ~MListBoxModel(); |
|
74 |
|
75 /** |
|
76 * Gets the number of items in the list box |
|
77 * @return Number of items. |
|
78 */ |
|
79 virtual TInt NumberOfItems() const = 0; |
|
80 |
|
81 /** |
|
82 * Gets an array of strings used by the list box for matching |
|
83 * user keypresses incrementally. |
|
84 * |
|
85 * @return A pointer to the array. |
|
86 */ |
|
87 virtual const MDesCArray* MatchableTextArray() const = 0; |
|
88 |
|
89 private: |
|
90 IMPORT_C virtual TAny* MListBoxModel_Reserved(); |
|
91 }; |
|
92 |
|
93 /** |
|
94 * Text list box model interface. |
|
95 * |
|
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. |
|
99 */ |
|
100 |
|
101 class MTextListBoxModel : public MListBoxModel |
|
102 { |
|
103 public: |
|
104 /** |
|
105 * Destructor |
|
106 */ |
|
107 IMPORT_C ~MTextListBoxModel(); |
|
108 |
|
109 /** |
|
110 * Gets the item text for an item by its index. This text, |
|
111 * rather than the matcher string, is drawn by |
|
112 * CTextListItemDrawers. |
|
113 * |
|
114 * @param aItemIndex Index specifying an item. |
|
115 * @return The text for that item. |
|
116 */ |
|
117 virtual TPtrC ItemText(TInt aItemIndex) const = 0; |
|
118 |
|
119 private: // from MListBoxModel |
|
120 IMPORT_C virtual TAny* MListBoxModel_Reserved(); |
|
121 }; |
|
122 |
|
123 #endif |