1 eiktxlbx.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 #if !defined(__EIKTXLBX_H__) |
|
20 #define __EIKTXLBX_H__ |
|
21 |
|
22 #if !defined(__COECNTRL_H__) |
|
23 #include <coecntrl.h> |
|
24 #endif |
|
25 |
|
26 #if !defined(__EIKLBX_H__) |
|
27 #include <eiklbx.h> |
|
28 #endif |
|
29 |
|
30 #if !defined(__EIKLBM_H__) |
|
31 #include <eiklbm.h> |
|
32 #endif |
|
33 |
|
34 class CTextListBoxModel; |
|
35 |
|
36 /** |
|
37 * List box for displaying text. |
|
38 * |
|
39 * Text list boxes use the standard list box view, @c CListBoxView, and a |
|
40 * customised item drawer and list box model. |
|
41 * |
|
42 * @since Symbian 5.0 |
|
43 */ |
|
44 class CEikTextListBox : public CEikListBox |
|
45 { |
|
46 public: |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 IMPORT_C ~CEikTextListBox(); |
|
52 |
|
53 /** |
|
54 * C++ default constructor. |
|
55 */ |
|
56 IMPORT_C CEikTextListBox(); |
|
57 |
|
58 /** |
|
59 * Second phase construction from a resource. |
|
60 * |
|
61 * This constructor initialises the list box model, flags, required |
|
62 * dimensions etc. from a resource. The function fully constructs the |
|
63 * associated list box model and item drawer for this list box. |
|
64 * |
|
65 * @param aReader A resource reader initialised to point at a list box |
|
66 * resource |
|
67 */ |
|
68 IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aReader); |
|
69 |
|
70 /** |
|
71 * By default Symbian 2nd phase constructor is private |
|
72 * |
|
73 * This initializes the C-classes of a newly-created @c CEikTextListBox |
|
74 * from supplied arguments. This function fully constructs the associated |
|
75 * list box model and item drawer for this list box, and then invokes |
|
76 * @c CEikListBox::ConstructL(). |
|
77 * |
|
78 * @param aParent Parent control for this control. |
|
79 * @param aFlags Flags for the list box. |
|
80 */ |
|
81 IMPORT_C void ConstructL(const CCoeControl* aParent, TInt aFlags = 0); |
|
82 |
|
83 /** |
|
84 * Gets the text list box model. |
|
85 * |
|
86 * @return The text list box model used by this list box. |
|
87 */ |
|
88 IMPORT_C CTextListBoxModel* Model() const; |
|
89 |
|
90 public: // from CCoeControl |
|
91 |
|
92 /** |
|
93 * From @c CCoeControl. |
|
94 * |
|
95 * Gets the list of logical colours employed in the drawing of the control, |
|
96 * paired with an explanation of how they are used. Appends the list to |
|
97 * @c aColorUseList. |
|
98 * |
|
99 * @deprecated |
|
100 * @param aColorUseList List of logical colours. |
|
101 */ |
|
102 IMPORT_C virtual void GetColorUseListL( |
|
103 CArrayFix<TCoeColorUse>& aColorUseList) const; |
|
104 // not available before Release 005u |
|
105 |
|
106 /** |
|
107 * From @c CCoeControl. |
|
108 * |
|
109 * Handles a change to the control's resources. These resources are of |
|
110 * type aType, which are shared across the environment, for example |
|
111 * colours or fonts. |
|
112 * |
|
113 * @param aType The type of resource that has changed. |
|
114 */ |
|
115 IMPORT_C virtual void HandleResourceChange(TInt aType); |
|
116 // not available before Release 005u |
|
117 /** |
|
118 * From @c CCoeControl. |
|
119 * |
|
120 * Handles pointer events. |
|
121 * |
|
122 * @param aPointerEvent The pointer event. |
|
123 */ |
|
124 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
125 protected: //from CCoeControl |
|
126 |
|
127 /** |
|
128 * From @c CCoeControl |
|
129 * |
|
130 * Write internal state of the @c CEikTextListBox to the given stream. |
|
131 * NOTE: Only operational in debug mode. |
|
132 * |
|
133 * @param aWriteStream Target stream. |
|
134 */ |
|
135 IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const; |
|
136 |
|
137 protected: |
|
138 |
|
139 /** |
|
140 * Creates @c CTextListItemDrawer for @c CListBoxView for drawing |
|
141 * individual list box items . |
|
142 */ |
|
143 IMPORT_C virtual void CreateItemDrawerL(); |
|
144 |
|
145 private: |
|
146 /** |
|
147 * From CAknControl |
|
148 */ |
|
149 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
150 private: |
|
151 IMPORT_C virtual void CEikListBox_Reserved(); // listbox use only |
|
152 protected: |
|
153 TInt iRequiredCellCharWidth; |
|
154 private: |
|
155 |
|
156 TInt iSpare; // Unused |
|
157 }; |
|
158 |
|
159 /** |
|
160 * Horizontal snaking text list box. |
|
161 * |
|
162 * This snaking list box is intended for displaying text. The list box lays its |
|
163 * items out using the @c CEikSnakingListBox algorithms, and uses a |
|
164 * @c CTextListItemDrawer to draw its items. |
|
165 * |
|
166 * @since Symbian 5.0 |
|
167 */ |
|
168 class CEikSnakingTextListBox : public CEikSnakingListBox |
|
169 { |
|
170 public: |
|
171 |
|
172 /** |
|
173 * Destructor. |
|
174 */ |
|
175 IMPORT_C ~CEikSnakingTextListBox(); |
|
176 |
|
177 /** |
|
178 * C++ default constructor. |
|
179 */ |
|
180 IMPORT_C CEikSnakingTextListBox(); |
|
181 |
|
182 /** |
|
183 * By default Symbian 2nd phase constructor is private. |
|
184 * |
|
185 * Completes the construction of a default-constructed snaking text list |
|
186 * box, initialising its heap-stored members from the supplied arguments. |
|
187 * This function will leave if any of the pointer members being |
|
188 * constructed leave. |
|
189 * |
|
190 * @param aParent Parent control. |
|
191 * @param aFlags Flags for the control. |
|
192 * @see @c CEikListBox::TFlags |
|
193 */ |
|
194 IMPORT_C void ConstructL(const CCoeControl* aParent, TInt aFlags = 0); |
|
195 |
|
196 /** |
|
197 * Gets a pointer to the model used by this list box. |
|
198 * |
|
199 * @return This list box model. |
|
200 */ |
|
201 IMPORT_C CTextListBoxModel* Model() const; |
|
202 |
|
203 public: // from CCoeControl |
|
204 |
|
205 /** |
|
206 * From @c CCoeControl. |
|
207 * |
|
208 * Not implemented or used in S60. |
|
209 * |
|
210 * @param aColorUseList On return, a list of logical colours. |
|
211 */ |
|
212 IMPORT_C virtual void GetColorUseListL( |
|
213 CArrayFix<TCoeColorUse>& aColorUseList) const; |
|
214 // not available before Release 005u |
|
215 |
|
216 /** |
|
217 * From @c CCoeControl. |
|
218 * |
|
219 * Handles a change in a resource. |
|
220 * |
|
221 * The types (@c aType) of list box resources handled are those which |
|
222 * are shared across the environment, for example, colours or fonts. |
|
223 * |
|
224 * @param aType The type of resource that has changed. |
|
225 */ |
|
226 IMPORT_C virtual void HandleResourceChange(TInt aType); |
|
227 // not available before Release 005u |
|
228 |
|
229 /** |
|
230 * From @c CCoeControl. |
|
231 * |
|
232 * Handles pointer events. |
|
233 * |
|
234 * @param aPointerEvent The pointer event. |
|
235 */ |
|
236 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
237 private: |
|
238 /** |
|
239 * From CAknControl |
|
240 */ |
|
241 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
242 }; |
|
243 |
|
244 |
|
245 #endif // __EIKTXLBX_H__ |