author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:29:17 +0300 | |
branch | RCL_3 |
changeset 64 | 85902f042028 |
parent 56 | d48ab3b357f1 |
child 72 | a5e7a4f63858 |
permissions | -rw-r--r-- |
56 | 1 |
/* |
2 |
* Copyright (c) 2006, 2007 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 "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". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Abstract base class for hierarchical lists. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef C_AKNTREELIST_H |
|
20 |
#define C_AKNTREELIST_H |
|
21 |
||
22 |
||
23 |
#include <AknControl.h> |
|
24 |
#include <w32std.h> |
|
25 |
#include <akntreelistobserver.h> |
|
26 |
#include <AknIconUtils.h> // TScaleMode |
|
27 |
||
28 |
class CAknTree; |
|
29 |
class CAknTreeListView; |
|
30 |
class MAknCustomTreeOrdering; |
|
31 |
class TAknsItemID; |
|
32 |
class MAknMarkingModeObserver; |
|
33 |
||
34 |
/** Flag to indicate that hierarchical list is looping. */ |
|
35 |
const TUint32 KAknTreeListLooping = 0x0001; |
|
36 |
||
37 |
/** Flag to indicate that hierarchical list structure lines are not visible. */ |
|
38 |
const TUint32 KAknTreeListNoStructureLines = 0x0002; |
|
39 |
||
40 |
/** Flag to set marquee scrolling on. */ |
|
41 |
const TUint32 KAknTreeListMarqueeScrolling = 0x0004; |
|
42 |
||
43 |
/** Flag to disable indention of hierarchical list items. Setting this flag |
|
44 |
also forces the tree structure lines invisible. */ |
|
45 |
const TUint32 KAknTreeListNoIndention = 0x0008; |
|
46 |
||
47 |
/** Flag to set hierarchical list markable. The list items can always be |
|
48 |
marked by list client with API methods, but when list is set markable, |
|
49 |
it responds to specified pointer and key event by marking/unmarking |
|
50 |
items as required. */ |
|
51 |
const TUint32 KAknTreeListMarkable = 0x0010; |
|
52 |
||
53 |
/** Flag to enalbe smiley in tree list. */ |
|
54 |
const TUint32 KAknTreeListSmiley = 0x0020; |
|
55 |
||
56 |
/** |
|
57 |
* Abstract base class for hierarchical lists. |
|
58 |
* |
|
59 |
* This class functions as a base class for hierarchical lists. It contains |
|
60 |
* the APIs common to all hierarchical lists. The internal structure of the |
|
61 |
* list is not exposed directly to the list clients, instead the structure |
|
62 |
* can be accessed through the APIs in this class. The items in the list are |
|
63 |
* referred with item IDs, which are returned to the client when the items |
|
64 |
* are added to the list. |
|
65 |
* |
|
66 |
* List items are divided into leaves and nodes, the difference being that |
|
67 |
* nodes have expand and collapse functionality and can contain other tree |
|
68 |
* items as child items, whereas leaves cannot contain other list items. |
|
69 |
* Methods @c IsLeaf() and @c IsNode() can be used for checking if items |
|
70 |
* belong into these groups. |
|
71 |
* |
|
72 |
* The expand and collapse events, among other list events, are send to list |
|
73 |
* observers through @c MAknTreeListObserver interface. This enables that |
|
74 |
* the whole list does not have to be populated at once, as the content of |
|
75 |
* each node can be added when the node is expanded. To avoid unnecessary |
|
76 |
* memory consumption, the content of each node is removed from the list |
|
77 |
* when the node is collapsed. However, list items can be set persistent, |
|
78 |
* in which case they are not removed from nodes on collapse events. |
|
79 |
* |
|
80 |
* As the hierarchical list items are list specialisation specific, the |
|
81 |
* specialisations of this class have to provide APIs for constructing and |
|
82 |
* adding new items to the list, and getting and setting specialisation |
|
83 |
* specific properties of the list items. |
|
84 |
* |
|
85 |
* All the methods that might affect the appearance of the list view have an |
|
86 |
* additional @c aDrawNow parameter, which can be used to indicate whether |
|
87 |
* the list view should be redrawn to correspond to the modified list |
|
88 |
* structure. This allows consecutive calls to be made without the list view |
|
89 |
* being updated between every call by setting the @c aDrawNow parameter to |
|
90 |
* @c EFalse in all of the calls but the last. The normal draw methods |
|
91 |
* inherited from @c CCoeControl can also be used to draw the updated view. |
|
92 |
* |
|
93 |
* @see MAknTreeListObserver |
|
94 |
* |
|
95 |
* @lib aknhlist.lib |
|
96 |
* @since S60 v3.2 |
|
97 |
*/ |
|
98 |
NONSHARABLE_CLASS( CAknTreeList ) : public CAknControl |
|
99 |
{ |
|
100 |
||
101 |
public: |
|
102 |
||
103 |
||
104 |
// for focus handling after Sort |
|
105 |
enum TFocusBehaviour |
|
106 |
{ |
|
107 |
ESaveFocus, |
|
108 |
EMoveFocusToFirstItem |
|
109 |
}; |
|
110 |
||
111 |
/** |
|
112 |
* Destructor. |
|
113 |
*/ |
|
114 |
virtual ~CAknTreeList(); |
|
115 |
||
116 |
/** |
|
117 |
* Sets the flags for the hierarchical list. |
|
118 |
* |
|
119 |
* Flags @c KAknTreeListLooping, @c KAknTreeListNoStructureLines, |
|
120 |
* @c KAknTreeListMarqueeScrolling, @c KAknTreeListNoIndention, and |
|
121 |
* @c KAknTreeListMarkable can be used to change the behaviour |
|
122 |
* of the list. |
|
123 |
* |
|
124 |
* Note: Specialisations may override this method in order to restrict the |
|
125 |
* use of some of the flags in specialised list or to handle specialisation |
|
126 |
* specific flags. |
|
127 |
* |
|
128 |
* @param aFlags Flags. |
|
129 |
*/ |
|
130 |
IMPORT_C virtual void SetFlags( TUint32 aFlags ); |
|
131 |
||
132 |
/** |
|
133 |
* Returns the flags set for the list. |
|
134 |
* |
|
135 |
* @return Flags. |
|
136 |
*/ |
|
137 |
IMPORT_C TUint32 Flags() const; |
|
138 |
||
139 |
/** |
|
140 |
* Moves an existing list item to specified target node. The moved item |
|
141 |
* and the target node have to be specified with the item IDs returned |
|
142 |
* when the items were added to the hierarchical list. The target node |
|
143 |
* cannot be a descendant of the moved node. Otherwise, the moving would |
|
144 |
* break the hierarchical structure. Constant @c KAknTreeIIDRoot can be |
|
145 |
* used as an ID for the target node when the item is to be moved to the |
|
146 |
* top-most level of the list. |
|
147 |
* |
|
148 |
* @param aItem Item ID of the item to be moved. |
|
149 |
* |
|
150 |
* @param aTargetNode ID of the node, where the item is to be moved. |
|
151 |
* |
|
152 |
* @param aDrawNow @c ETrue to redraw the list after the item has been |
|
153 |
* moved, otherwise @c EFalse. |
|
154 |
* |
|
155 |
* @leave KErrArgument The specified item is the same as the target node |
|
156 |
* or one of the ancestors of target node. |
|
157 |
* |
|
158 |
* @leave KErrNoMemory Not enough memory is available for adding the |
|
159 |
* specified item to the target node. |
|
160 |
* |
|
161 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
162 |
* |
|
163 |
* @panic EAknHListPanicInvalidItemType Specified target item is not a node. |
|
164 |
* |
|
165 |
* @pre The moved item and the target node exist in the list, and the |
|
166 |
* target node is not a descendant of the moved item. |
|
167 |
* |
|
168 |
* @post The item is moved to the specified target node and into a such |
|
169 |
* position that the children of the target node remain in sorted |
|
170 |
* order. The updated list is redrawn, if it is requested with the |
|
171 |
* aDrawNow parameter. |
|
172 |
*/ |
|
173 |
IMPORT_C void MoveItemL( TAknTreeItemID aItem, TAknTreeItemID aTargetNode, |
|
174 |
TBool aDrawNow ); |
|
175 |
||
176 |
/** |
|
177 |
* Removes an item from the hierarchical list. The item to be removed has |
|
178 |
* to be specified with the ID value returned when the item was added to |
|
179 |
* the hierarchical list. If the removed item is a node containing other |
|
180 |
* list items, those items are removed from the list as well. Constant |
|
181 |
* @c KAknTreeIIDRoot can be used to remove every item from the list. |
|
182 |
* |
|
183 |
* @param aItem Item ID of the item to be removed. |
|
184 |
* |
|
185 |
* @param aDrawNow @c ETrue to redraw the list after the item has been |
|
186 |
* removed, othewise @c EFalse. |
|
187 |
* |
|
188 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
189 |
* |
|
190 |
* @pre The specified item exists in the hierarchical list. |
|
191 |
* |
|
192 |
* @post The specified item and all of its descendants are removed from |
|
193 |
* the list. The updated list is drawn, when it is requested with |
|
194 |
* the aDrawNow parameter. |
|
195 |
*/ |
|
196 |
IMPORT_C void RemoveItem( TAknTreeItemID aItem, TBool aDrawNow ); |
|
197 |
||
198 |
/** |
|
199 |
* Expands a node in hierarchical list. When a node in the hierarchical |
|
200 |
* list is expanded, either with this method, or with pointer or key |
|
201 |
* event, the observer of the list is notified with respective event. |
|
202 |
* The client of the list can then update the content of the expanded |
|
203 |
* node. Constant @c KAknTreeIIDRoot can be used to expand every node |
|
204 |
* in the tree structure. |
|
205 |
* |
|
206 |
* @param aNode Item ID of the node to be expanded. |
|
207 |
* |
|
208 |
* @param aDrawNow @c ETrue to redraw the list after the node has been |
|
209 |
* expanded, otherwise @c EFalse. |
|
210 |
* |
|
211 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
212 |
* |
|
213 |
* @panic EAknHListPanicInvalidItemType Specified item is not a node. |
|
214 |
* |
|
215 |
* @pre The specified item exists in the hierarchical list and it is a |
|
216 |
* node. |
|
217 |
* |
|
218 |
* @post The specified node is expanded. The updated list is drawn, when |
|
219 |
* it is requested with the aDrawNow parameter. |
|
220 |
*/ |
|
221 |
IMPORT_C void ExpandNode( TAknTreeItemID aNode, TBool aDrawNow ); |
|
222 |
||
223 |
/** |
|
224 |
* Collapses a node in hierarchical list. When a node in the hierarchical |
|
225 |
* list is collapsed, either with this method, or with pointer or key |
|
226 |
* event, all its content that is not set persistent is removed from the |
|
227 |
* list to reduce memory consumption. The observer of the hierarchical |
|
228 |
* list is nofied with the respective event. Constant @c KAknTreeIIDRoot |
|
229 |
* can be used to collapse every node in the tree structure. |
|
230 |
* |
|
231 |
* @param aNode Item ID of the node to be collapsed. |
|
232 |
* |
|
233 |
* @param aDrawNow @c ETrue to redraw the list after the node has been |
|
234 |
* collapsed, otherwise @c EFalse. |
|
235 |
* |
|
236 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
237 |
* |
|
238 |
* @panic EAknHListPanicInvalidItemType Specified item is not a node. |
|
239 |
* |
|
240 |
* @pre The specified item exists in the hierarchical list and it is a |
|
241 |
* node. |
|
242 |
* |
|
243 |
* @post The specified item is collapsed and all of its children, which are |
|
244 |
* not set persistent, are removed from the list. |
|
245 |
*/ |
|
246 |
IMPORT_C void CollapseNode( TAknTreeItemID aNode, TBool aDrawNow ); |
|
247 |
||
248 |
/** |
|
249 |
* Checks whether the specified node is expanded. |
|
250 |
* |
|
251 |
* @param aNode Item ID of a node. |
|
252 |
* |
|
253 |
* @return @c ETrue if the node is expanded. |
|
254 |
* |
|
255 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
256 |
* |
|
257 |
* @panic EAknHListPanicInvalidItemType Specified item is not a node. |
|
258 |
*/ |
|
259 |
IMPORT_C TBool IsExpanded( TAknTreeItemID aNode ) const; |
|
260 |
||
261 |
/** |
|
262 |
* Gets the item ID of the focused item. |
|
263 |
* |
|
264 |
* @return Item ID of the focused item. Value @c KAknTreeIIDNone is |
|
265 |
* returned if no item is focused. |
|
266 |
*/ |
|
267 |
IMPORT_C TAknTreeItemID FocusedItem() const; |
|
268 |
||
269 |
/** |
|
270 |
* Sets the focused item and its position on the list view. When the |
|
271 |
* focused item is changed, the vertical position of the view is changed |
|
272 |
* so that the position of the focused item on the view matches the given |
|
273 |
* index. The horizontal position of the view is changed so that the |
|
274 |
* the beginning of the focused item is visible. |
|
275 |
* |
|
276 |
* @param aItem Item ID of the item to be focused. |
|
277 |
* |
|
278 |
* @param aIndex The position of the focused item on the list view. If the |
|
279 |
* index does not refer to any visible view location, that is, the |
|
280 |
* index is less than zero or greater than or equal to the number of |
|
281 |
* items in the view, the focused item is changed to specified item, |
|
282 |
* but the position of the view is not changed. |
|
283 |
* |
|
284 |
* @param aDrawNow @c ETrue to redraw the list after the focused item |
|
285 |
* has been changed, otherwise @c EFalse. |
|
286 |
* |
|
287 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
288 |
*/ |
|
289 |
IMPORT_C void SetFocusedItem( TAknTreeItemID aItem, TInt aIndex, |
|
290 |
TBool aDrawNow ); |
|
291 |
||
292 |
/** |
|
293 |
* Highlight rectangle for the focused item. The returned rectangle is |
|
294 |
* screen relative and it can be used, for example, when positioning |
|
295 |
* pop-up for focused item. If the focused item is not visible, the |
|
296 |
* method returns an empty rectangle. |
|
297 |
* |
|
298 |
* @return Highlight rectangle of focused list item. |
|
299 |
*/ |
|
300 |
IMPORT_C TRect HighlightRect() const; |
|
301 |
||
302 |
/** |
|
303 |
* Adds a new icon to the list to be used by all list items. The same |
|
304 |
* icon can be used by multiple tree items and its referenced by the |
|
305 |
* ID returned by this function. The given parameters are also stored |
|
306 |
* in the tree list, which enables the tree list to reconstruct the |
|
307 |
* bitmaps on skin change events. If this behaviour is insufficient for |
|
308 |
* the client, it can always replace the existing icons by itself with |
|
309 |
* @c AssignIconL or @c AssignColorIconL method. |
|
310 |
* |
|
311 |
* @param aId Item ID of the icon to be added. |
|
312 |
* |
|
313 |
* @param aFilename Filename to be used to construct the item, |
|
314 |
* if no matching item was found in the currently active skin. |
|
315 |
* |
|
316 |
* @param aBitmapId ID of the bitmap in the file. |
|
317 |
* Used only if no matching item was found in the currently |
|
318 |
* active skin. |
|
319 |
* |
|
320 |
* @param aMaskId ID of the mask in the file. |
|
321 |
* Used only if no matching item was found in the currently |
|
322 |
* active skin. |
|
323 |
* |
|
324 |
* @param aScaleMode Scale mode used when icon's bitmap is resized. |
|
325 |
* |
|
326 |
* @return ID assigned for the added icon. |
|
327 |
* |
|
328 |
* @leave KErrNoMemory Not enough memory. |
|
329 |
*/ |
|
330 |
IMPORT_C TInt AddIconL( const TAknsItemID& aId, const TDesC& aFilename, |
|
331 |
TInt aBitmapId, TInt aMaskId, TScaleMode aScaleMode ); |
|
332 |
||
333 |
/** |
|
334 |
* Adds a new icon to the list. The ownership of given bitmaps is |
|
335 |
* transferred to the list only if specified with @c aTransferOwnership |
|
336 |
* parameter. Note that icons added to the list with this method cannot |
|
337 |
* be reconstructed on skin change events by the list. If necessary, |
|
338 |
* previously added icons can be replaced with @c AssignIconL method. |
|
339 |
* |
|
340 |
* @param aIcon Pointer to the bitmap. |
|
341 |
* |
|
342 |
* @param aMask Pointer to the mask bitmap. |
|
343 |
* |
|
344 |
* @param aTransferOwnership @c ETrue, if ownership of bitmaps is |
|
345 |
* transferred to the list. If the method leaves, it is always on the |
|
346 |
* responsibility of the client code to take care of deleting the bitmaps. |
|
347 |
* |
|
348 |
* @param aScaleMode The scale mode used when the icon is resized. |
|
349 |
* |
|
350 |
* @return ID assigned for the added icon. |
|
351 |
* |
|
352 |
* @leave KErrNoMemory Not enough memory. |
|
353 |
*/ |
|
354 |
IMPORT_C TInt AddIconL( CFbsBitmap* aIcon, CFbsBitmap* aMask, |
|
355 |
TBool aTransferOwnership, TScaleMode aScaleMode ); |
|
356 |
||
357 |
/** |
|
358 |
* Adds a new icon to the list to be used by all list items. The same |
|
359 |
* icon can be used by multiple tree items and it is referenced by the |
|
360 |
* icon ID returned by this function. The given parameters are stored |
|
361 |
* in the tree list, and they are used in reconstructing the bitmaps on |
|
362 |
* skin change events. |
|
363 |
* |
|
364 |
* @param aId Item ID of the icon to be added. |
|
365 |
* |
|
366 |
* @param aColorId Item ID of the color table. |
|
367 |
* |
|
368 |
* @param aColorIndex Index in the color table. |
|
369 |
* |
|
370 |
* @param aFilename Filename to be used to construct the item, |
|
371 |
* if no matching item was found in the currently active skin. |
|
372 |
* |
|
373 |
* @param aBitmapId ID of the bitmap in the file. |
|
374 |
* Used only if no matching item was found in the currently |
|
375 |
* active skin. |
|
376 |
* |
|
377 |
* @param aMaskId ID of the mask in the file. |
|
378 |
* Used only if no matching item was found in the currently |
|
379 |
* active skin. |
|
380 |
* |
|
381 |
* @param aDefaultColor Color RGB value to be used, if no color |
|
382 |
* is found in the currently active skin. |
|
383 |
* |
|
384 |
* @param aScaleMode Scale mode used when icon's bitmap is resized. |
|
385 |
* |
|
386 |
* @return ID assigned for the added icon. |
|
387 |
* |
|
388 |
* @leave KErrNoMemory Not enough memory. |
|
389 |
*/ |
|
390 |
IMPORT_C TInt AddColorIconL( const TAknsItemID& aId, |
|
391 |
const TAknsItemID& aColorId, TInt aColorIndex, const TDesC& aFilename, |
|
392 |
TInt aBitmapId, TInt aMaskId, TRgb aDefaultColor, |
|
393 |
TScaleMode aScaleMode ); |
|
394 |
||
395 |
/** |
|
396 |
* Assigns an icon to the tree list with the specified ID. If an icon |
|
397 |
* with specified ID already exists in the list, the existing icon is |
|
398 |
* replaced with the new one. The given parameters are stored in the |
|
399 |
* tree list, and they are used in reconstructing the bitmaps on skin |
|
400 |
* change events. |
|
401 |
* |
|
402 |
* @param aIconId Icon ID assigned for the icon. |
|
403 |
* |
|
404 |
* @param aId Item ID of the icon to be added. |
|
405 |
* |
|
406 |
* @param aFilename Filename to be used to construct the item, |
|
407 |
* if no matching item was found in the currently active skin. |
|
408 |
* |
|
409 |
* @param aBitmapId ID of the bitmap in the file. |
|
410 |
* Used only if no matching item was found in the currently |
|
411 |
* active skin. |
|
412 |
* |
|
413 |
* @param aMaskId ID of the mask in the file. |
|
414 |
* Used only if no matching item was found in the currently |
|
415 |
* active skin. |
|
416 |
* |
|
417 |
* @param aScaleMode Scale mode used when icon's bitmap is resized. |
|
418 |
* |
|
419 |
* @leave KErrNoMemory Not enough memory. |
|
420 |
* |
|
421 |
* @leave KErrArgument Specified icon ID is out of allowed range. |
|
422 |
*/ |
|
423 |
IMPORT_C void AssignIconL( TInt aIconId, const TAknsItemID& aId, |
|
424 |
const TDesC& aFilename, TInt aBitmapId, TInt aMaskId, |
|
425 |
TScaleMode aScaleMode ); |
|
426 |
||
427 |
/** |
|
428 |
* Assigns an icon to the tree list with the specified ID. If an icon |
|
429 |
* with specified ID already exists in the list, the existing icon is |
|
430 |
* replaced with the new one. The ownership of bitmaps is transferred to |
|
431 |
* the list only if so specifed with @c aTransferOnwership parameter. |
|
432 |
* Note that icons added with this method cannot be reconstructed on |
|
433 |
* skin change events by list. |
|
434 |
* |
|
435 |
* @param aIconId Icon ID assigned for the icon. |
|
436 |
* |
|
437 |
* @param aIcon Pointer to the bitmap. |
|
438 |
* |
|
439 |
* @param aMask Pointer to the mask bitmap. |
|
440 |
* |
|
441 |
* @param aTransferOwnership @c ETrue, if ownership of bitmaps is |
|
442 |
* transferred to the list. If the method leaves, it is always on |
|
443 |
* the responsibility of the client code to take care of deleting |
|
444 |
* the bitmaps. |
|
445 |
* |
|
446 |
* @param aScaleMode Scale mode used when icon's bitmap is resized. |
|
447 |
* |
|
448 |
* @leave KErrNoMemory Not enough memory. |
|
449 |
* |
|
450 |
* @leave KErrArgument Specified icon ID is out of allowed range. |
|
451 |
*/ |
|
452 |
IMPORT_C void AssignIconL( TInt aIconId, CFbsBitmap* aIcon, |
|
453 |
CFbsBitmap* aMask, TBool aTransferOwnership, TScaleMode aScaleMode ); |
|
454 |
||
455 |
/** |
|
456 |
* Assigns a color icon to the list with the specified ID. If an icon |
|
457 |
* with specified ID already exists in the list, the existing icon is |
|
458 |
* replaced with the new one. The given parameters are stored in the |
|
459 |
* tree list, and they are used in reconstructing the bitmaps on skin |
|
460 |
* change events. |
|
461 |
* |
|
462 |
* @param aIconId Icon ID assigned for the icon. |
|
463 |
* |
|
464 |
* @param aId Item ID of the icon to be added. |
|
465 |
* |
|
466 |
* @param aColorId Item ID of the color table. |
|
467 |
* |
|
468 |
* @param aColorIndex Index in the color table. |
|
469 |
* |
|
470 |
* @param aFilename Filename to be used to construct the item, |
|
471 |
* if no matching item was found in the currently active skin. |
|
472 |
* |
|
473 |
* @param aBitmapId ID of the bitmap in the file. |
|
474 |
* Used only if no matching item was found in the currently |
|
475 |
* active skin. |
|
476 |
* |
|
477 |
* @param aMaskId ID of the mask in the file. |
|
478 |
* Used only if no matching item was found in the currently |
|
479 |
* active skin. |
|
480 |
* |
|
481 |
* @param aDefaultColor Color RGB value to be used, if no color |
|
482 |
* is found in the currently active skin. |
|
483 |
* |
|
484 |
* @param aScaleMode Scale mode used when icon's bitmap is resized. |
|
485 |
* |
|
486 |
* @leave KErrNoMemory Not enough memory. |
|
487 |
* |
|
488 |
* @leave KErrArgument Specified icon ID is out of allowed range. |
|
489 |
*/ |
|
490 |
IMPORT_C void AssignColorIconL( TInt aIconId, const TAknsItemID& aId, |
|
491 |
const TAknsItemID& aColorId, TInt aColorIndex, const TDesC& aFilename, |
|
492 |
TInt aBitmapId, TInt aMaskId, TRgb aDefaultColor, |
|
493 |
TScaleMode aScaleMode ); |
|
494 |
||
495 |
/** |
|
496 |
* Removes the specified icon from the tree list. The specified icon cannot |
|
497 |
* be any of the default tree list icon, in which case the leaves with |
|
498 |
* value @c KErrArgument. If the specified icon is not found, the function |
|
499 |
* does nothing. |
|
500 |
* |
|
501 |
* @param aIconId Icon ID of the removed icon. |
|
502 |
* |
|
503 |
* @leave KErrArgument if specified icon is one of the default icons. |
|
504 |
*/ |
|
505 |
IMPORT_C void RemoveIconL( TInt aIconId ); |
|
506 |
||
507 |
/** |
|
508 |
* Returns the number of children of a hierarchical list node. This method, |
|
509 |
* along with @c Child() method, can be used for enquiring information of |
|
510 |
* the list structure. Constant @c KAknTreeIIDRoot can be used to get the |
|
511 |
* item count on the top-most level of the list. |
|
512 |
* |
|
513 |
* @param aNode Item ID of a node. |
|
514 |
* |
|
515 |
* @return Number of children of specified node. |
|
516 |
* |
|
517 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
518 |
* |
|
519 |
* @panic EAknHListPanicInvalidItemType Specified item is not a node. |
|
520 |
*/ |
|
521 |
IMPORT_C TInt ChildCount( TAknTreeItemID aNode ) const; |
|
522 |
||
523 |
/** |
|
524 |
* Gets the item ID of a child of a hierarcical list node. The specific |
|
525 |
* child is specified with an index. The child count for any hierarchical |
|
526 |
* list node can be get with @c ChildCount() method. |
|
527 |
* |
|
528 |
* @param aNode Item ID of the node, whose child is enquiried. |
|
529 |
* |
|
530 |
* @param aIndex Index of the enquiried child. |
|
531 |
* |
|
532 |
* @return Item ID of the specified child. Value @c KAknTreeIIDNone is |
|
533 |
* returned, if the child with specified index does not exist. |
|
534 |
* |
|
535 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
536 |
* |
|
537 |
* @panic EAknHListPanicInvalidItemType Specified item is not a node. |
|
538 |
*/ |
|
539 |
IMPORT_C TAknTreeItemID Child( TAknTreeItemID aNode, TInt aIndex ) const; |
|
540 |
||
541 |
/** |
|
542 |
* Returns the item ID of the parent of a hierarchical list item. The |
|
543 |
* constant @c KAknTreeIIDRoot is returned for all the items on the |
|
544 |
* top-most level of the tree, and constant @c KaknTereIIDNone for the |
|
545 |
* items that have no parent, that is, the root node. |
|
546 |
* |
|
547 |
* @param aItem Item ID of the item, whose parent is enquiried. |
|
548 |
* |
|
549 |
* @return Item ID of the parent node. |
|
550 |
* |
|
551 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
552 |
*/ |
|
553 |
IMPORT_C TAknTreeItemID Parent( TAknTreeItemID aItem ) const; |
|
554 |
||
555 |
/** |
|
556 |
* Checks whether the hierarchical list contains the list item with |
|
557 |
* specified item ID. The returned value for constant @c KAknTreeIIDRoot |
|
558 |
* will always be @c ETrue, and for constant @c KAknTreeIIDNone @c EFalse. |
|
559 |
* |
|
560 |
* @param aItem Item ID. |
|
561 |
* |
|
562 |
* @return @c ETrue, if the list contains the specified item. |
|
563 |
*/ |
|
564 |
IMPORT_C TBool Contains( TAknTreeItemID aItem ) const; |
|
565 |
||
566 |
/** |
|
567 |
* Checks whether a hierarchical list item is a node. |
|
568 |
* |
|
569 |
* @param aItem Item ID of checked item. |
|
570 |
* |
|
571 |
* @return @c ETrue, if the specified item is a node. |
|
572 |
* |
|
573 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
574 |
*/ |
|
575 |
IMPORT_C TBool IsNode( TAknTreeItemID aItem ) const; |
|
576 |
||
577 |
/** |
|
578 |
* Checks whether a hierarchical list item is a leaf. |
|
579 |
* |
|
580 |
* @param aItem Item ID of checked item. |
|
581 |
* |
|
582 |
* @return @c ETrue, if the specified item is a leaf. |
|
583 |
* |
|
584 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
585 |
*/ |
|
586 |
IMPORT_C TBool IsLeaf( TAknTreeItemID aItem ) const; |
|
587 |
||
588 |
/** |
|
589 |
* Checks whether a hierarchical list item is marked. |
|
590 |
* |
|
591 |
* @param aItem Item ID of checked item. |
|
592 |
* |
|
593 |
* @return @c ETrue for marked item. |
|
594 |
* |
|
595 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
596 |
*/ |
|
597 |
IMPORT_C TBool IsMarked( TAknTreeItemID aItem ) const; |
|
598 |
||
599 |
/** |
|
600 |
* Sets an item marked. If the marked item is a node, all of its |
|
601 |
* descendants are also set marked. |
|
602 |
* |
|
603 |
* Note that item marking can be changed with this method, even if the |
|
604 |
* list itself is not set markable. Marking changes can be enabled and |
|
605 |
* disabled with @c EnableMarking() method. |
|
606 |
* |
|
607 |
* @param aItem Item ID of the item to be modified. |
|
608 |
* |
|
609 |
* @param aMarked @c ETrue to set item marked, @c EFalse to unmarked. |
|
610 |
* |
|
611 |
* @param aDrawNow @c ETrue to redraw the list after the item has been |
|
612 |
* set marked, otherwise @c EFalse. |
|
613 |
* |
|
614 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
615 |
*/ |
|
616 |
IMPORT_C void SetMarked( TAknTreeItemID aItem, TBool aMarked, |
|
617 |
TBool aDrawNow ); |
|
618 |
||
619 |
/** |
|
620 |
* Enables or disables marking of specified list item. By default, |
|
621 |
* marking is enabled for every list item. |
|
622 |
* |
|
623 |
* When marking is enabled for an item, its marking can be changed from |
|
624 |
* unmarked to marked, and vice versa, with SetMarked() method, and for |
|
625 |
* markable list, the marking can also change as a result of user action. |
|
626 |
* |
|
627 |
* When marking is disabled, the item can still be either unmarked or |
|
628 |
* marked, but the marking cannot be changed in any way, until it has |
|
629 |
* been enabled again for the item. |
|
630 |
* |
|
631 |
* @param aItem Item ID of the list item. |
|
632 |
* |
|
633 |
* @param aEnable @c ETrue to enable marking, @c EFalse to disable it. |
|
634 |
* |
|
635 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
636 |
*/ |
|
637 |
IMPORT_C void EnableMarking( TAknTreeItemID aItem, TBool aEnable ); |
|
638 |
||
639 |
/** |
|
640 |
* Gets all the marked items from the tree list. The marked items are |
|
641 |
* appended to the end of the array passed as parameter. |
|
642 |
* |
|
643 |
* @param aMarkedItems On return, contains item IDs of all marked items. |
|
644 |
* |
|
645 |
* @leave KErrNoMemory Appending item to the array fails. |
|
646 |
*/ |
|
647 |
IMPORT_C void GetMarkedItemsL( RArray<TAknTreeItemID>& aMarkedItems ) const; |
|
648 |
||
649 |
/** |
|
650 |
* Gets all the marked items from the specified node. The marked items |
|
651 |
* are appended to the end of the array passed as parameter. |
|
652 |
* |
|
653 |
* @param aNode Item ID of a node from where the marked items are |
|
654 |
* retrieved. |
|
655 |
* |
|
656 |
* @param aMarkedItems On return, contains item IDs of marked items in |
|
657 |
* the specified node. |
|
658 |
* |
|
659 |
* @leave KErrNoMemory Appending item to the array fails. |
|
660 |
* |
|
661 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
662 |
* |
|
663 |
* @panic EAknHListPanicInvalidItemType Specified item is not a node. |
|
664 |
*/ |
|
665 |
IMPORT_C void GetMarkedItemsL( TAknTreeItemID aNode, |
|
666 |
RArray<TAknTreeItemID>& aMarkedItems ) const; |
|
667 |
||
668 |
/** |
|
669 |
* Checks whether the specified node is empty. To decrease memory |
|
670 |
* consumption, the descendants of tree nodes can be removed from the |
|
671 |
* hierarchical list when the node is collapsed. As the empty nodes may |
|
672 |
* have different appearances in the list view, the collapsed nodes can be |
|
673 |
* set to appear as non-empty with @c SetNonEmpty() method to indicate that |
|
674 |
* nodes will have some content when expanded. |
|
675 |
* |
|
676 |
* @param aNode Item ID of checked item. |
|
677 |
* |
|
678 |
* @return @c ETrue, if the item has been set non-empty. |
|
679 |
* |
|
680 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
681 |
* |
|
682 |
* @panic EAknHListPanicInvalidItemType Specified target item is not a node. |
|
683 |
*/ |
|
684 |
IMPORT_C TBool IsEmpty( TAknTreeItemID aNode ) const; |
|
685 |
||
686 |
/** |
|
687 |
* Sets a node non-empty. |
|
688 |
* |
|
689 |
* @param aNode Item ID of the item to be modified. |
|
690 |
* |
|
691 |
* @param aNonEmpty @c ETrue to set node non-empty, @c EFalse to empty. |
|
692 |
* |
|
693 |
* @param aDrawNow @c ETrue to redraw the list after the setting has been |
|
694 |
* change, otherwise @c EFalse. |
|
695 |
* |
|
696 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
697 |
* |
|
698 |
* @panic EAknHListPanicInvalidItemType Specified target item is not a node. |
|
699 |
*/ |
|
700 |
IMPORT_C void SetNonEmpty( TAknTreeItemID aNode, TBool aNonEmpty, |
|
701 |
TBool aDrawNow ); |
|
702 |
||
703 |
/** |
|
704 |
* Checks if the specified item is set persistent. If an item is set |
|
705 |
* persistent, it is not removed from the list, when its parent or any of |
|
706 |
* its ancestors is collapsed. This means also that a node cannot be |
|
707 |
* automatically removed from the list on collapse event, if any of its |
|
708 |
* descendants is set persistent. |
|
709 |
* |
|
710 |
* @param aItem Item ID. |
|
711 |
* |
|
712 |
* @return @c ETrue, if item is set persistent. |
|
713 |
* |
|
714 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
715 |
*/ |
|
716 |
IMPORT_C TBool IsPersistent( TAknTreeItemID aItem ) const; |
|
717 |
||
718 |
/** |
|
719 |
* Sets an item persistent. If the specified item is a node, the state |
|
720 |
* of all its descendants is also changed accordingly. |
|
721 |
* |
|
722 |
* @param aItem Item ID. |
|
723 |
* |
|
724 |
* @param aPersistent @c ETrue to set item persistent. |
|
725 |
* |
|
726 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
727 |
*/ |
|
728 |
IMPORT_C void SetPersistent( TAknTreeItemID aItem, |
|
729 |
TBool aPersistent ); |
|
730 |
||
731 |
/** |
|
732 |
* Sets custom ordering for the hierarchical list and sorts the list |
|
733 |
* with the use of given ordering interface. The given interface is |
|
734 |
* used until it is replaced with some other ordering. |
|
735 |
* |
|
736 |
* Note: Ownership of the interface is not transferred to the list. |
|
737 |
* |
|
738 |
* Note: When custom ordering is set to the list, new items are added |
|
739 |
* to the end of their parent nodes, because the interface cannot |
|
740 |
* be used for determining the position for inserted item, as the |
|
741 |
* client receives its identifier only after it has been inserted. |
|
742 |
* @c Sort(TAknTreeItemID, TBool, TBool) method can be used for sorting |
|
743 |
* the node with custom ordering interface after new items have been |
|
744 |
* inserted in the list. |
|
745 |
* |
|
746 |
* @param aOrdering Custom ordering interface used in list sorting. |
|
747 |
* |
|
748 |
* @param aDrawNow @c ETrue to redraw the list after sorting. |
|
749 |
*/ |
|
750 |
IMPORT_C void Sort( MAknCustomTreeOrdering* aOrdering, TBool aDrawNow ); |
|
751 |
||
752 |
/** |
|
753 |
* Sorts the specified node with the use of previously set ordering |
|
754 |
* interface. The sorting can be restricted to the specified node, or |
|
755 |
* the sorting can be set to include also every descendant node of the |
|
756 |
* specified node. Whole list can be sorted by giving the constant |
|
757 |
* @c KAknTreeIIDRoot as the @c aNode parameter. This method has no |
|
758 |
* effect, if no ordering has been set for the list. |
|
759 |
* |
|
760 |
* @param aNode Item ID of the node that has to be sorted. |
|
761 |
* |
|
762 |
* @param aSortDescendants @c ETrue to sort the content of the specified |
|
763 |
* node including the content of its descendant nodes, @c EFalse to |
|
764 |
* sort only the child items within the specified node. |
|
765 |
* |
|
766 |
* @param aDrawNow @c ETrue to redraw the list after sorting. |
|
767 |
* |
|
768 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
769 |
* |
|
770 |
* @panic EAknHListPanicInvalidItemType Specified item is not a node. |
|
771 |
*/ |
|
772 |
IMPORT_C void Sort( TAknTreeItemID aNode, TBool aSortDescendants, |
|
773 |
TBool aDrawNow ); |
|
774 |
||
775 |
/** |
|
776 |
* Adds an observer for the hierarchical list. Notifications of the list |
|
777 |
* events are sent to all observers set with this method. Observers can |
|
778 |
* be removed from the list with @c RemoveObserver() method. |
|
779 |
* |
|
780 |
* Note: Hierarchical list also sends a state changed event on every list |
|
781 |
* event through the usual control observer interface that can be set with |
|
782 |
* @c CCoeControl::SetObserver method. |
|
783 |
* |
|
784 |
* @param aObserver Implementation of the observer interface. |
|
785 |
* |
|
786 |
* @post The given interface is set as the observer of the list. The |
|
787 |
* ownership of the interface is not transferred to the list. |
|
788 |
*/ |
|
789 |
IMPORT_C void AddObserverL( MAknTreeListObserver* aObserver ); |
|
790 |
||
791 |
/** |
|
792 |
* Removes an observer from the hierarchical list. |
|
793 |
* |
|
794 |
* @param aObserver The observer interface to be removed. |
|
795 |
*/ |
|
796 |
IMPORT_C void RemoveObserver( MAknTreeListObserver* aObserver ); |
|
797 |
||
798 |
/** |
|
799 |
* Notifies all of the tree list observers of the specified event. This |
|
800 |
* method is not exported, as it is intended for internal use only. |
|
801 |
* |
|
802 |
* @param aEvent The event to be notified. |
|
803 |
* |
|
804 |
* @param aItem ID of the tree item related to the event. |
|
805 |
*/ |
|
806 |
void NotifyObservers( MAknTreeListObserver::TEvent aEvent, |
|
807 |
TAknTreeItemID aItem ); |
|
808 |
||
809 |
/** |
|
810 |
* Checks whether tabulator mode function indicators are enabled. |
|
811 |
* |
|
812 |
* @return @c ETrue if tabulator mode is enabled. |
|
813 |
*/ |
|
814 |
IMPORT_C TBool TabModeFunctionIndicators() const; |
|
815 |
||
816 |
/** |
|
817 |
* Changes the appearance of collapse and expand function indicators. The |
|
818 |
* appearance of default function indicators suggest that left and right |
|
819 |
* arrow keys expand and collapse the focused nodes, but when the list is |
|
820 |
* used with tabulators, those keys are used in changing tabulators. |
|
821 |
* Alternate representation for function indicator can be set by enabling |
|
822 |
* tabulator mode indicator with this method. |
|
823 |
* |
|
824 |
* @param aEnable @c ETrue to enable tabulator mode function indicators, |
|
825 |
* @c EFalse to use the default function indicators. |
|
826 |
*/ |
|
827 |
IMPORT_C void EnableTabModeFunctionIndicatorsL( TBool aEnable ); |
|
828 |
||
829 |
||
830 |
/** |
|
831 |
* Sets the focused item and its position on the list view. |
|
832 |
* |
|
833 |
* When the focused item is changed, the vertical position of the view |
|
834 |
* is changed as follows: |
|
835 |
* |
|
836 |
* If the focused item is set on the first page, view is changed |
|
837 |
* to the beginning of the list. |
|
838 |
* |
|
839 |
* If the focused item is not set on the first page, view is changed so |
|
840 |
* that focused item is at the lowest line on the screen. |
|
841 |
* |
|
842 |
* (In this context first page means actual lines from 0 |
|
843 |
* to max. number of visible lines - 1) |
|
844 |
* |
|
845 |
* The horizontal position of the view is changed so that the |
|
846 |
* the beginning of the focused item is visible. |
|
847 |
* |
|
848 |
* @param aItem Item ID of the item to be focused. |
|
849 |
* |
|
850 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
851 |
*/ |
|
852 |
IMPORT_C void SetFocusedItem( TAknTreeItemID aItem ); |
|
853 |
||
854 |
/** |
|
855 |
* Gets the index of the focused item on the screen. Possible values are |
|
856 |
* from 0 to max. number of visible lines - 1. Value -1 is |
|
857 |
* returned if no item is focused or focused item is not visible. |
|
858 |
* |
|
859 |
* @return index of the focused item on the screen. |
|
860 |
*/ |
|
861 |
IMPORT_C TInt FocusedItemIndex() const; |
|
862 |
||
863 |
/** |
|
864 |
* Gets the index of the item on the screen. Possible values are |
|
865 |
* from 0 to max. number of visible lines - 1. Value -1 is |
|
866 |
* returned if the requested item is not visible on the screen. |
|
867 |
* |
|
868 |
* @return index of the requested item. |
|
869 |
*/ |
|
870 |
IMPORT_C TInt VisibleItemIndex( TAknTreeItemID aItem ) const; |
|
871 |
||
872 |
||
873 |
/** |
|
874 |
* Sets custom ordering for the hierarchical list and sorts the list |
|
875 |
* with the use of given ordering interface. The given interface is |
|
876 |
* used until it is replaced with some other ordering. |
|
877 |
* |
|
878 |
* @param aOrdering Custom ordering interface used in list sorting. |
|
879 |
* |
|
880 |
* @param aFocusBehaviour Tells how focus should be handled after sorting. |
|
881 |
* @c ESaveFocus saves focus in the item where it was before sorting, |
|
882 |
* @c EMoveFocusToFirstItem changes view to the beginning of the list |
|
883 |
* and moves focus to the first item. |
|
884 |
* |
|
885 |
* @param aDrawNow @c ETrue to redraw the list after sorting. |
|
886 |
*/ |
|
887 |
IMPORT_C void Sort( MAknCustomTreeOrdering* aOrdering, TFocusBehaviour aFocusBehaviour, TBool aDrawNow ); |
|
888 |
||
889 |
/** |
|
890 |
* Sorts the specified node with the use of previously set ordering |
|
891 |
* interface. The sorting can be restricted to the specified node, or |
|
892 |
* the sorting can be set to include also every descendant node of the |
|
893 |
* specified node. Whole list can be sorted by giving the constant |
|
894 |
* @c KAknTreeIIDRoot as the @c aNode parameter. This method has no |
|
895 |
* effect, if no ordering has been set for the list. |
|
896 |
* |
|
897 |
* @param aNode Item ID of the node that has to be sorted. |
|
898 |
* |
|
899 |
* @param aFocusBehaviour Tells how focus should be handled after sorting. |
|
900 |
* @c ESaveFocus saves focus in the item where it was before sorting, |
|
901 |
* @c EMoveFocusToFirstItem changes view to the beginning of the list |
|
902 |
* and moves focus to the first item. |
|
903 |
* |
|
904 |
* @param aSortDescendants @c ETrue to sort the content of the specified |
|
905 |
* node including the content of its descendant nodes, @c EFalse to |
|
906 |
* sort only the child items within the specified node. |
|
907 |
* |
|
908 |
* @param aDrawNow @c ETrue to redraw the list after sorting. |
|
909 |
* |
|
910 |
* @panic EAknHListPanicInvalidItemID Item with specified ID is not found. |
|
911 |
* |
|
912 |
* @panic EAknHListPanicInvalidItemType Specified item is not a node. |
|
913 |
*/ |
|
914 |
IMPORT_C void Sort( TAknTreeItemID aNode, TFocusBehaviour aFocusBehaviour, TBool aSortDescendants, TBool aDrawNow ); |
|
915 |
||
916 |
/** |
|
917 |
* Sets text for the empty list. This text is visible if the list box |
|
918 |
* has no items. |
|
919 |
* |
|
920 |
* @param aText The text for the empty list. |
|
921 |
*/ |
|
922 |
IMPORT_C void SetEmptyTextL(const TDesC& aText); |
|
923 |
||
924 |
/** |
|
925 |
* Sets the marking mode observer. |
|
926 |
* |
|
927 |
* @since S60 5.2 |
|
928 |
* |
|
929 |
* @param aObserver Marking mode observer, @c NULL removes the existing |
|
930 |
* observer. |
|
931 |
*/ |
|
932 |
IMPORT_C void SetMarkingModeObserver( MAknMarkingModeObserver* aObserver ); |
|
933 |
||
64
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
934 |
/** |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
935 |
* Turns the marking mode on / off. |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
936 |
* |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
937 |
* @since S60 5.2 |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
938 |
* |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
939 |
* @param aEnable @c ETrue to turn marking mode on |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
940 |
* @c EFalse to turn marking mode off |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
941 |
*/ |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
942 |
IMPORT_C void SetMarkingMode( TBool aEnable ); |
85902f042028
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
56
diff
changeset
|
943 |
|
56 | 944 |
// From base class CCoeControl |
945 |
||
946 |
/** |
|
947 |
* From CCoeControl. |
|
948 |
* Handles key events. The method will return @c EKeyWasNotConsumed, if |
|
949 |
* the list is not focused. |
|
950 |
* |
|
951 |
* @param aKeyEvent The key event. |
|
952 |
* |
|
953 |
* @param aType The type of key event: @c EEventKey, @c EEventKeyUp or |
|
954 |
* @c EEventKeyDown. |
|
955 |
*/ |
|
956 |
TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
957 |
||
958 |
/** |
|
959 |
* From CCoeControl. |
|
960 |
* Changes the visibility of the hierarchical list. |
|
961 |
* |
|
962 |
* @param aVisible @c ETrue to make the list visible, @c EFalse to make |
|
963 |
* it invisible. |
|
964 |
*/ |
|
965 |
void MakeVisible( TBool aVisible ); |
|
966 |
||
967 |
/** |
|
968 |
* From CCoeControl. |
|
969 |
* Sets whether the list is dimmed. |
|
970 |
* |
|
971 |
* @param aDimmed @c ETrue to set list dimmed, otherwise @c EFalse. |
|
972 |
*/ |
|
973 |
void SetDimmed( TBool aDimmed ); |
|
974 |
||
975 |
/** |
|
976 |
* From CCoeControl. |
|
977 |
* Sets the control's containing window by copying it from aContainer. |
|
978 |
* |
|
979 |
* @param aContainer The compound control that is the container for this |
|
980 |
* control. |
|
981 |
*/ |
|
982 |
void SetContainerWindowL( const CCoeControl& aContainer ); |
|
983 |
||
984 |
/** |
|
985 |
* From CCoeControl. |
|
986 |
* Sets the control as ready to be drawn. |
|
987 |
*/ |
|
988 |
void ActivateL(); |
|
989 |
||
990 |
/** |
|
991 |
* From CCoeControl. |
|
992 |
* Handles resource changes. |
|
993 |
* |
|
994 |
* @param aType |
|
995 |
*/ |
|
996 |
void HandleResourceChange( TInt aType ); |
|
997 |
||
998 |
/** |
|
999 |
* From CCoeControl. |
|
1000 |
* Gets the control's input capabilities. |
|
1001 |
* |
|
1002 |
* @return The control's input capabilities. |
|
1003 |
*/ |
|
1004 |
TCoeInputCapabilities InputCapabilities() const; |
|
1005 |
||
1006 |
/** |
|
1007 |
* From CCoeControl. |
|
1008 |
* Handles pointer events. |
|
1009 |
* |
|
1010 |
* @param aPointerEvent Pointer event. |
|
1011 |
*/ |
|
1012 |
void HandlePointerEventL( const TPointerEvent& aPointerEvent ); |
|
1013 |
||
1014 |
/** |
|
1015 |
* From CCoeControl. |
|
1016 |
* Gets the number of controls contained in a compound control. |
|
1017 |
* |
|
1018 |
* @return The number of component controls contained by this control. |
|
1019 |
*/ |
|
1020 |
TInt CountComponentControls() const; |
|
1021 |
||
1022 |
/** |
|
1023 |
* From CCoeControl. |
|
1024 |
* Gets an indexed component of a compound control. |
|
1025 |
* |
|
1026 |
* @param aIndex The index of the control. |
|
1027 |
* |
|
1028 |
* @return The component control with an index of aIndex. |
|
1029 |
*/ |
|
1030 |
CCoeControl* ComponentControl( TInt aIndex ) const; |
|
1031 |
||
1032 |
/** |
|
1033 |
* Returns the marking mode observer. |
|
1034 |
* |
|
1035 |
* @since S60 5.2 |
|
1036 |
* |
|
1037 |
* @return Pointer to the marking mode observer. |
|
1038 |
*/ |
|
1039 |
MAknMarkingModeObserver* MarkingModeObserver(); |
|
1040 |
||
1041 |
protected: |
|
1042 |
||
1043 |
/** |
|
1044 |
* Constructor. |
|
1045 |
*/ |
|
1046 |
CAknTreeList(); |
|
1047 |
||
1048 |
/** |
|
1049 |
* Second phase constructor. Completes the construction of the base class. |
|
1050 |
* When this version of @c BaseConstructL() is used, new window is created |
|
1051 |
* for the list. |
|
1052 |
*/ |
|
1053 |
void BaseConstructL(); |
|
1054 |
||
1055 |
/** |
|
1056 |
* Second phase constructor. Completes the construction of the base class. |
|
1057 |
* |
|
1058 |
* @param aContainer Container for the list. |
|
1059 |
*/ |
|
1060 |
void BaseConstructL( const CCoeControl& aContainer ); |
|
1061 |
||
1062 |
/** |
|
1063 |
* Reference to the tree structure. |
|
1064 |
* |
|
1065 |
* @return Reference to tree structure. |
|
1066 |
*/ |
|
1067 |
CAknTree& Tree(); |
|
1068 |
||
1069 |
/** |
|
1070 |
* Constant reference to the tree structure. |
|
1071 |
* |
|
1072 |
* @return Constant reference to tree structure. |
|
1073 |
*/ |
|
1074 |
const CAknTree& Tree() const; |
|
1075 |
||
1076 |
/** |
|
1077 |
* Reference to the tree list view. |
|
1078 |
* |
|
1079 |
* @return Reference to tree list view. |
|
1080 |
*/ |
|
1081 |
CAknTreeListView& View(); |
|
1082 |
||
1083 |
/** |
|
1084 |
* Constant reference to the tree list view. |
|
1085 |
* |
|
1086 |
* @return Constant reference to tree list view. |
|
1087 |
*/ |
|
1088 |
const CAknTreeListView& View() const; |
|
1089 |
||
1090 |
// from base class CCoeControl |
|
1091 |
||
1092 |
/** |
|
1093 |
* From CCoeControl. |
|
1094 |
* Handles focus change. |
|
1095 |
* |
|
1096 |
* @param aDrawNow @c EDrawNow to redraw the list. |
|
1097 |
*/ |
|
1098 |
void FocusChanged( TDrawNow aDrawNow ); |
|
1099 |
||
1100 |
/** |
|
1101 |
* From CCoeControl. |
|
1102 |
* Responds to changes to the size and position of this control. |
|
1103 |
*/ |
|
1104 |
void SizeChanged(); |
|
1105 |
||
1106 |
/** |
|
1107 |
* From CCoeControl. |
|
1108 |
* Responds to changes in the position of this control. |
|
1109 |
*/ |
|
1110 |
void PositionChanged(); |
|
1111 |
||
1112 |
/** |
|
1113 |
* From CCoeControl. |
|
1114 |
* Retrieves an object of the same type as that encapsulated in aId. |
|
1115 |
* |
|
1116 |
* @param aId An encapsulated object type ID. |
|
1117 |
* |
|
1118 |
* @return Encapsulates the pointer to the object provided. Note that the |
|
1119 |
* encapsulated pointer may be NULL |
|
1120 |
*/ |
|
1121 |
TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
1122 |
||
1123 |
private: |
|
1124 |
||
1125 |
// from base class CCoeControl |
|
1126 |
||
1127 |
/** |
|
1128 |
* From CCoeControl. |
|
1129 |
* Draws the list. |
|
1130 |
* |
|
1131 |
* @param aRect Specifies the area that needs to be redrawn. |
|
1132 |
*/ |
|
1133 |
void Draw( const TRect& aRect ) const; |
|
1134 |
||
1135 |
private: // data |
|
1136 |
||
1137 |
/** |
|
1138 |
* Flags. |
|
1139 |
*/ |
|
1140 |
TUint32 iFlags; |
|
1141 |
||
1142 |
/** |
|
1143 |
* Tree structure. |
|
1144 |
* Own. |
|
1145 |
*/ |
|
1146 |
CAknTree* iTree; |
|
1147 |
||
1148 |
/** |
|
1149 |
* Tree list view. |
|
1150 |
* Own. |
|
1151 |
*/ |
|
1152 |
CAknTreeListView* iView; |
|
1153 |
||
1154 |
/** |
|
1155 |
* Tree list observers. |
|
1156 |
* Not own. |
|
1157 |
*/ |
|
1158 |
RPointerArray<MAknTreeListObserver> iObservers; |
|
1159 |
||
1160 |
/** |
|
1161 |
* Index to observer array. |
|
1162 |
*/ |
|
1163 |
TInt iIndex; |
|
1164 |
||
1165 |
/** |
|
1166 |
* Marking mode observer |
|
1167 |
* Not own |
|
1168 |
*/ |
|
1169 |
MAknMarkingModeObserver* iMarkingModeObserver; |
|
1170 |
}; |
|
1171 |
||
1172 |
||
1173 |
#endif // C_AKNTREELIST_H |