author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 11:52:37 +0300 | |
branch | RCL_3 |
changeset 73 | c8382f7b54ef |
parent 64 | 3533d4323edc |
child 80 | 726fba06891a |
permissions | -rw-r--r-- |
64 | 1 |
/* |
2 |
* Copyright (c) 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: Freestyle tree list component |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef C_FSTREELIST_H |
|
20 |
#define C_FSTREELIST_H |
|
21 |
||
22 |
||
23 |
/////SYSTEM INCLUDES |
|
24 |
||
25 |
//////TOOLKIT INCLUDES |
|
26 |
#include <alf/alfcontrol.h> |
|
27 |
||
28 |
//////PROJECT INCLUDES |
|
29 |
#include "fstreelistconstants.h" |
|
30 |
#include "fstreevisualizerbase.h" |
|
31 |
#include "fstreevisualizerobserver.h" |
|
32 |
||
33 |
//////TOOLKIT CLASSES |
|
34 |
class CAlfEnv; |
|
35 |
class CAlfTexture; |
|
36 |
||
37 |
//////PROJECT CLASSES |
|
38 |
class CFsTree; |
|
39 |
class CFsTreeControl; |
|
40 |
class MFsTreeListObserver; |
|
41 |
class MFsTreeItemData; |
|
42 |
class MFsTreeItemVisualizer; |
|
43 |
class MFsTreeNodeVisualizer; |
|
44 |
class CFsAlfTextStyleManager; |
|
45 |
||
46 |
/** An array of tree list observers */ |
|
47 |
typedef RPointerArray<MFsTreeListObserver> RFsTreeListObservers; |
|
48 |
||
49 |
/** |
|
50 |
* Batch updates for the tree. |
|
51 |
*/ |
|
52 |
class MFsTreeBatchProcessing |
|
53 |
{ |
|
54 |
public: |
|
55 |
/** |
|
56 |
* Begin batch update. During batch update changes to the world |
|
57 |
* will not be updated on screen until the EndUpdateL is called. |
|
58 |
*/ |
|
59 |
virtual void BeginUpdate() = 0; |
|
60 |
||
61 |
/** |
|
62 |
* End batch update. All changes done between BeginUpdate and EndUpdateL |
|
63 |
* will be shown on screen. |
|
64 |
*/ |
|
65 |
virtual void EndUpdateL() = 0; |
|
66 |
}; |
|
67 |
||
68 |
/** |
|
69 |
* CFsTreeList is a component for creating and displaying hierarchical list |
|
70 |
* using tree data structure. |
|
71 |
* |
|
72 |
* @code |
|
73 |
* |
|
74 |
* @endcode |
|
75 |
* |
|
76 |
* @lib |
|
77 |
*/ |
|
78 |
class CFsTreeList : public CBase, MFsTreeVisualizerObserver, MFsTreeBatchProcessing |
|
79 |
{ |
|
80 |
public: // from MFsTreeBatchProcessing |
|
81 |
||
82 |
/** |
|
83 |
* @see MFsTreeBatchProcessing::BeginUpdate |
|
84 |
*/ |
|
85 |
void BeginUpdate(); |
|
86 |
||
87 |
/** |
|
88 |
* @see MFsTreeBatchProcessing::EndUpdateL |
|
89 |
*/ |
|
90 |
void EndUpdateL(); |
|
91 |
||
92 |
public: // Construction |
|
93 |
||
94 |
||
95 |
/** Pre-defined types of markability in list */ |
|
96 |
enum TFsTreeListMarkType |
|
97 |
{ |
|
98 |
EFsTreeListNonMarkable, |
|
99 |
EFsTreeListMarkable, |
|
100 |
EFsTreeListMultiMarkable |
|
101 |
}; |
|
102 |
||
103 |
/** Pre-defined types of scrolling in list |
|
104 |
* OLD API - to be removed. |
|
105 |
* */ |
|
106 |
enum TFsTreeListScrollbars |
|
107 |
{ |
|
108 |
EFsTreeListNoScrollbars, |
|
109 |
EFsTreeListVerticalScrollbar |
|
110 |
}; |
|
111 |
||
112 |
/** |
|
113 |
* Two-phased constructor |
|
114 |
* |
|
115 |
* @param aTreeV Pointer to the class responsible for visualizing tree |
|
116 |
* structure |
|
117 |
* @param aEnv Reference to the UI toolkit environment |
|
118 |
*/ |
|
119 |
IMPORT_C static CFsTreeList* NewL( CFsTreeVisualizerBase& aTreeV, |
|
120 |
CAlfEnv& aEnv ); |
|
121 |
||
122 |
/** |
|
123 |
* C++ destructor |
|
124 |
*/ |
|
125 |
IMPORT_C virtual ~CFsTreeList(); |
|
126 |
||
127 |
/** |
|
128 |
* Adds observer to the list of observers |
|
129 |
* |
|
130 |
* @param aTreeListObserver Reference to the list observer |
|
131 |
*/ |
|
132 |
IMPORT_C void AddObserverL( MFsTreeListObserver& aTreeListObserver ); |
|
133 |
||
134 |
/** |
|
135 |
* Removes observer from the list of observers |
|
136 |
* |
|
137 |
* @param aTreeListObserver Reference to the list observer |
|
138 |
* |
|
139 |
* @panic ETreeListPanicObserverNotFound The given observer was not |
|
140 |
* registered previously |
|
141 |
*/ |
|
142 |
IMPORT_C void RemoveObserver( MFsTreeListObserver& aTreeListObserver ); |
|
143 |
||
144 |
public: // Tree list configuration |
|
145 |
||
146 |
/** |
|
147 |
* Returns a hitckcock control associated with the component. |
|
148 |
*/ |
|
149 |
IMPORT_C CAlfControl* TreeControl( ) const; |
|
150 |
||
151 |
/** |
|
152 |
* The function sets duration of the slide-in effect. |
|
153 |
* |
|
154 |
* @param aTimeMiliseconds Slide in time in milliseconds. |
|
155 |
*/ |
|
156 |
IMPORT_C void SetSlideInDuration ( TInt aTimeMiliseconds ); |
|
157 |
||
158 |
/** |
|
159 |
* The function returns slide in effect's duration. |
|
160 |
* |
|
161 |
* @return Slide in duration in miliseconds. |
|
162 |
*/ |
|
163 |
IMPORT_C TInt SlideInDuration ( ) const; |
|
164 |
||
165 |
/** |
|
166 |
* The function sets direction of the slide in effect. |
|
167 |
* |
|
168 |
* @param aDirection A direction of the slide in effect. |
|
169 |
*/ |
|
170 |
IMPORT_C void SetSlideInDirection ( |
|
171 |
MFsTreeVisualizer::TFsSlideEffect aDirection ); |
|
172 |
||
173 |
/** |
|
174 |
* The function returns direction of the slide in effect. |
|
175 |
* |
|
176 |
* @return A direction of the slide in effect. |
|
177 |
*/ |
|
178 |
IMPORT_C MFsTreeVisualizer::TFsSlideEffect SlideInDirection ( ) const; |
|
179 |
||
180 |
/** |
|
181 |
* The function sets duration of the slide-out effect. |
|
182 |
* |
|
183 |
* @param aTimeMiliseconds Slide out time in milliseconds. |
|
184 |
*/ |
|
185 |
IMPORT_C void SetSlideOutDuration ( TInt aTimeMiliseconds ); |
|
186 |
||
187 |
/** |
|
188 |
* The function returns slide out effect's duration. |
|
189 |
* |
|
190 |
* @return Slide out duration in miliseconds. |
|
191 |
*/ |
|
192 |
IMPORT_C TInt SlideOutDuration ( ) const; |
|
193 |
||
194 |
/** |
|
195 |
* The function sets direction of the slide out effect. |
|
196 |
* |
|
197 |
* @param aDirection A direction of the slide out effect. |
|
198 |
*/ |
|
199 |
IMPORT_C void SetSlideOutDirection ( |
|
200 |
MFsTreeVisualizer::TFsSlideEffect aDirection ); |
|
201 |
||
202 |
/** |
|
203 |
* The function returns direction of the slide out effect. |
|
204 |
* |
|
205 |
* @return A direction of the slide out effect. |
|
206 |
*/ |
|
207 |
IMPORT_C MFsTreeVisualizer::TFsSlideEffect SlideOutDirection ( ) const; |
|
208 |
||
209 |
/** |
|
210 |
* Returns information about looping type of the list. |
|
211 |
* |
|
212 |
* @return Type of list looping. EFsTreeListLoopingDisabled when looping |
|
213 |
* is turned off. |
|
214 |
*/ |
|
215 |
IMPORT_C TFsTreeListLoopingType LoopingType() const; |
|
216 |
||
217 |
/** |
|
218 |
* Returns information whether list is markable, non-markable or |
|
219 |
* multi-markable |
|
220 |
* |
|
221 |
* @return Returns markability of the list |
|
222 |
*/ |
|
223 |
IMPORT_C TFsTreeListMarkType MarkType() const; |
|
224 |
||
225 |
/** |
|
226 |
* OLD API - to be removed. |
|
227 |
* Returns information about scrollbars used by list visual |
|
228 |
* |
|
229 |
* @return Returns a type of scrollbars that the list uses |
|
230 |
*/ |
|
231 |
IMPORT_C TFsTreeListScrollbars HasScrollBars() const; |
|
232 |
||
233 |
/** |
|
234 |
* Old API - to be removed |
|
235 |
* |
|
236 |
* @param aFlag Scrollbar type for the list |
|
237 |
*/ |
|
238 |
IMPORT_C void SetScrollBarsL( const TFsTreeListScrollbars aFlag ); |
|
239 |
||
240 |
||
241 |
/** |
|
242 |
* Returns information about scrollbars used by list visual |
|
243 |
* |
|
244 |
* @return Returns a type of scrollbars that the list uses |
|
245 |
*/ |
|
246 |
IMPORT_C TFsScrollbarVisibility ScrollbarVisibility() const; |
|
247 |
||
248 |
/** |
|
249 |
* Enables or disables scrollbars |
|
250 |
* |
|
251 |
* @param aFlag Scrollbar type for the list |
|
252 |
*/ |
|
253 |
IMPORT_C void SetScrollbarVisibilityL(const TFsScrollbarVisibility aVisibility); |
|
254 |
||
255 |
/** |
|
256 |
* Sets type of list's looping. |
|
257 |
* |
|
258 |
* @param aLoopingType type of list looping. |
|
259 |
*/ |
|
260 |
IMPORT_C void SetLoopingType( const TFsTreeListLoopingType aLoopingType ); |
|
261 |
||
262 |
||
263 |
/** |
|
264 |
* The functions sets fade-in's effect duration. |
|
265 |
* @param aFadeTime A time in miliseconds for fade in effect. |
|
266 |
*/ |
|
267 |
IMPORT_C void SetFadeInEffectTime( TInt aFadeTime ); |
|
268 |
||
269 |
/** |
|
270 |
* The functions returns fade-in's effect duration. |
|
271 |
* @return A time in miliseconds for fade in effect. |
|
272 |
*/ |
|
273 |
IMPORT_C TInt FadeInEffectTime( ); |
|
274 |
||
275 |
/** |
|
276 |
* The functions sets fade-out's effect duration. |
|
277 |
* @param aFadeTime A time in miliseconds for fade-out effect. |
|
278 |
*/ |
|
279 |
IMPORT_C void SetFadeOutEffectTime( TInt aFadeTime ); |
|
280 |
||
281 |
/** |
|
282 |
* The functions returns fade-out's effect duration. |
|
283 |
* @return A time in miliseconds for fade-out effect. |
|
284 |
*/ |
|
285 |
IMPORT_C TInt FadeOutEffectTime( ); |
|
286 |
||
287 |
/** |
|
288 |
* Function sets the time of list scroll per item and the scroll |
|
289 |
* acceleration rate. |
|
290 |
* @param aScrollTime Time (in miliseconds) at which the list items are |
|
291 |
* scrolled. |
|
292 |
* @param aScrollAcceleration Rate of scroll acceleration when the up/down |
|
293 |
* key is pressed for a long time. This is |
|
294 |
* multiplied by the number of up/down key |
|
295 |
* repeats. Acceleration rate should be in |
|
296 |
* 0.0-1.0 range. |
|
297 |
*/ |
|
298 |
IMPORT_C void SetScrollTime ( TInt aScrollTime, |
|
299 |
TReal aScrollAcceleration = 0.0 ); |
|
300 |
||
301 |
/** |
|
302 |
* Function gets the values of scroll speed and its acceleration rate. |
|
303 |
* |
|
304 |
* @param aScrollTime Time (in miliseconds) at which the list items are |
|
305 |
* scrolled. |
|
306 |
* |
|
307 |
* @param aScrollAcceleration Rate of scroll acceleration when the up/down |
|
308 |
* key is pressed for a long time. |
|
309 |
*/ |
|
310 |
IMPORT_C void GetScrollTime( TInt& aScrollTime, |
|
311 |
TReal& aScrollAcceleration ); |
|
312 |
||
313 |
/** |
|
314 |
* Enables or disables marking of list items |
|
315 |
* |
|
316 |
* @param aFlag Type of markability for the list |
|
317 |
*/ |
|
318 |
IMPORT_C void SetMarkTypeL( const TFsTreeListMarkType aFlag ); |
|
319 |
||
320 |
/** |
|
321 |
* Returns information whether list enables indention or not |
|
322 |
* |
|
323 |
* @return ETrue if indention is enabled, EFalse otherwise |
|
324 |
*/ |
|
325 |
IMPORT_C TInt Indentation() const; |
|
326 |
||
327 |
/** |
|
328 |
* Enables or disables indention for list |
|
329 |
* |
|
330 |
* @param aIndentation Indentation in pixels. |
|
331 |
*/ |
|
332 |
IMPORT_C void SetIndentationL( const TInt aIndentation ); |
|
333 |
||
334 |
/** |
|
335 |
* The functions sets wether all item in the list should be always in |
|
336 |
* extended state or in normal state. |
|
337 |
* The list view is refreshed. |
|
338 |
* |
|
339 |
* @param aAlwaysExtended ETrue if items should be always extended. EFalse |
|
340 |
* if items should be in normal state. |
|
341 |
*/ |
|
342 |
IMPORT_C void SetItemsAlwaysExtendedL ( TBool aAlwaysExtended ); |
|
343 |
||
344 |
/* |
|
345 |
* The function returns if items are always in extended state or in |
|
346 |
* normal. |
|
347 |
* |
|
348 |
* @return ETrue if items are always in extended state, EFalse if items |
|
349 |
* are in normal state. |
|
350 |
*/ |
|
351 |
IMPORT_C TBool IsItemsAlwaysExtended ( ); |
|
352 |
||
353 |
public: // Tree management |
|
354 |
||
355 |
/** |
|
356 |
* Inserts new item as a child of parent given by Id with the given |
|
357 |
* position |
|
358 |
* |
|
359 |
* @param aItemD Pointer to item's data |
|
360 |
* @param aItemV Pointer to item's visualizer |
|
361 |
* @param aParentId Id of parent node |
|
362 |
* @param aIndex Position of new item in the list of parent's children (if |
|
363 |
* omitted, the item is inserted as last) |
|
364 |
* @param aAllowRefresh Blocks/Allows view update after an item has been added |
|
365 |
* to the tree list. Currently works only with scrollbar update. |
|
366 |
* |
|
367 |
* @return Id of the inserted item |
|
368 |
* |
|
369 |
* @panic EFsListPanicParentIdNotFound The specified parent id was not |
|
370 |
* found |
|
371 |
* @panic EFsListPanicIndexOutOfRange Specified index exceeds node's |
|
372 |
* number of children |
|
373 |
*/ |
|
374 |
IMPORT_C TFsTreeItemId InsertItemL( MFsTreeItemData& aItemD, |
|
375 |
MFsTreeItemVisualizer& aItemV, |
|
376 |
const TFsTreeItemId aParentId, |
|
377 |
const TInt aIndex = -1, |
|
378 |
const TBool aAllowRefresh = ETrue); |
|
379 |
||
380 |
/** |
|
381 |
* Inserts new node as a child of parent given by Id with the given |
|
382 |
* position |
|
383 |
* |
|
384 |
* @param aItemD Pointer to node's data |
|
385 |
* @param aItemV Pointer to node's visualizer |
|
386 |
* @param aParentId Id of parent node |
|
387 |
* @param aIndex Position of new node in the list of parent's children (if |
|
388 |
* omitted, the node is inserted as last) |
|
389 |
* |
|
390 |
* @return Id of the inserted node |
|
391 |
* |
|
392 |
* @panic EFsListPanicParentIdNotFound The specified parent id was not |
|
393 |
* found |
|
394 |
* @panic EFsListPanicIndexOutOfRange Specified index exceeds node's |
|
395 |
* number of children |
|
396 |
*/ |
|
397 |
IMPORT_C TFsTreeItemId InsertNodeL( MFsTreeItemData& aItemD, |
|
398 |
MFsTreeNodeVisualizer& aNodeV, |
|
399 |
const TFsTreeItemId aParentId, |
|
400 |
const TInt aIndex = -1, |
|
401 |
const TBool aAllowRefresh = ETrue ); |
|
402 |
||
403 |
/** |
|
404 |
* Removes the item with given Id from the list. If aItemId is a node all |
|
405 |
* its children will be removed as well. |
|
406 |
* |
|
407 |
* @param aItemId Id of the item to be removed |
|
408 |
* |
|
409 |
* @panic EFsListPanicInvalidItemId The specified item id was not found in |
|
410 |
* the list |
|
411 |
*/ |
|
412 |
IMPORT_C void RemoveL( const TFsTreeItemId aItemId ); |
|
413 |
||
414 |
/** |
|
415 |
* Removes all items from the list. |
|
416 |
*/ |
|
417 |
IMPORT_C void RemoveAllL( ); |
|
418 |
||
419 |
/** |
|
420 |
* Removes all children of the given node. |
|
421 |
* |
|
422 |
* @param aNodeId Id of the node |
|
423 |
* |
|
424 |
* @panic EFsListPanicInvalidItemId The specified item id was not found in |
|
425 |
* the list |
|
426 |
* @panic EFsListPanicInvalidItemType Item id was passed instead of the |
|
427 |
* node id |
|
428 |
*/ |
|
429 |
IMPORT_C void RemoveChildrenL( const TFsTreeItemId aNodeId ); |
|
430 |
||
431 |
/** |
|
432 |
* Moves the item with given Id to the list of children of parent with |
|
433 |
* given id |
|
434 |
* |
|
435 |
* @param aItemId Id of the item to be moved |
|
436 |
* @param aTargetNode Id of the new parent node |
|
437 |
* @param aIndex Position of the item in the list of new parent's children |
|
438 |
* (if omitted, the item/node is inserted as last) |
|
439 |
* |
|
440 |
* @panic EFsListPanicInvalidItemId The specified item id was not found in |
|
441 |
* the list |
|
442 |
* @panic EFsListPanicParentIdNotFound The specified parent id was not |
|
443 |
* found |
|
444 |
* @panic EFsListPanicInvalidItemType Item id was passed as a second param |
|
445 |
* instead of the node id |
|
446 |
* @panic EFsListPanicIndexOutOfRange Specified index exceeds node's |
|
447 |
* number of children |
|
448 |
*/ |
|
449 |
IMPORT_C void MoveItemL( const TFsTreeItemId aItemId, |
|
450 |
const TFsTreeItemId aTargetNode, const TInt aIndex = -1 ); |
|
451 |
||
452 |
/** |
|
453 |
* Checks if a node has children, if parameter is omitted, root of the |
|
454 |
* list is checked to indicate if the list is empty |
|
455 |
* |
|
456 |
* @param aNodeId Id of a node |
|
457 |
* |
|
458 |
* @return Etrue if a node has children, EFalse if it does not |
|
459 |
* |
|
460 |
* @panic EFsListPanicInvalidItemId The specified item id was not found in |
|
461 |
* the list |
|
462 |
* @panic EFsListPanicInvalidItemType Item id was passed instead of the |
|
463 |
* node id |
|
464 |
*/ |
|
465 |
IMPORT_C TBool IsEmpty(const TFsTreeItemId aNodeId = KFsTreeRootID) const; |
|
466 |
||
467 |
/** |
|
468 |
* Returns the level of an item in tree. |
|
469 |
* |
|
470 |
* @param aItemId Id of an item. |
|
471 |
* |
|
472 |
* @return Level of an item. |
|
473 |
*/ |
|
474 |
IMPORT_C TUint Level( const TFsTreeItemId aItemId ) const; |
|
475 |
||
476 |
/** |
|
477 |
* Counts elements in the list |
|
478 |
* |
|
479 |
* @return Number of list items |
|
480 |
*/ |
|
481 |
IMPORT_C TUint Count() const; |
|
482 |
||
483 |
/** |
|
484 |
* Gets the number of children of the given node |
|
485 |
* |
|
486 |
* @param aNodeId Id of the node |
|
487 |
* |
|
488 |
* @return Number of node's children |
|
489 |
* |
|
490 |
* @panic EFsListPanicInvalidItemId The specified item id was not found in |
|
491 |
* the list |
|
492 |
* @panic EFsListPanicInvalidItemType Item id was passed instead of the |
|
493 |
* node id |
|
494 |
*/ |
|
495 |
IMPORT_C TUint CountChildren( const TFsTreeItemId aNodeId ) const; |
|
496 |
||
497 |
/** |
|
498 |
* Gets the id of a child of the specified node with the position given |
|
499 |
* |
|
500 |
* @param aNodeId Id of a node |
|
501 |
* @param aIndex Index of the child |
|
502 |
* |
|
503 |
* @return Id of a child |
|
504 |
* |
|
505 |
* @panic EFsListPanicInvalidItemId The specified item id was not found in |
|
506 |
* the list |
|
507 |
* @panic EFsListPanicInvalidItemType Item id was passed instead of the |
|
508 |
* node id |
|
509 |
* @panic EFsListPanicIndexOutOfRange Specified index exceeds node's |
|
510 |
* number of children |
|
511 |
*/ |
|
512 |
IMPORT_C TFsTreeItemId Child( const TFsTreeItemId aNodeId, |
|
513 |
const TUint aIndex ) const; |
|
514 |
||
515 |
/** |
|
516 |
* Returns the index of a child for a given parent |
|
517 |
* |
|
518 |
* @param aNodeId Id of a node |
|
519 |
* @param aItemId Id of a child |
|
520 |
* |
|
521 |
* @return Index of a child |
|
522 |
* |
|
523 |
* @panic EFsListPanicInvalidItemId The specified item id was not found |
|
524 |
* in the list |
|
525 |
* @panic EFsListPanicInvalidItemType Item id was passed instead of |
|
526 |
* the node id |
|
527 |
* @panic EFsListPanicIndexOutOfRange Specified index exceeds node's |
|
528 |
* number of children |
|
529 |
*/ |
|
530 |
IMPORT_C TUint ChildIndex( const TFsTreeItemId aNodeId, |
|
531 |
const TFsTreeItemId aItemId ) const; |
|
532 |
||
533 |
/** |
|
534 |
* Gets the parent's id for the specified item. If KFsTreeRootID is passed |
|
535 |
* then KFsTreeNoneID is returned. |
|
536 |
* |
|
537 |
* @param aItemId Id of an item |
|
538 |
* |
|
539 |
* @return Id of item's parent |
|
540 |
* |
|
541 |
* @panic EFsListPanicInvalidItemId The specified item id was not found |
|
542 |
* in the list |
|
543 |
*/ |
|
544 |
IMPORT_C TFsTreeItemId Parent( const TFsTreeItemId aItemId ) const; |
|
545 |
||
546 |
/** |
|
547 |
* Checks whether the item with specified id belongs to the list |
|
548 |
* |
|
549 |
* @param aItemId Id of an item |
|
550 |
* |
|
551 |
* @return ETrue if the item is in the list, EFalse otherwise |
|
552 |
*/ |
|
553 |
IMPORT_C TBool Contains( const TFsTreeItemId aItemId ) const; |
|
554 |
||
555 |
/** |
|
556 |
* Checks whether the item with specified id is a node |
|
557 |
* |
|
558 |
* @param aItemId Id of an item |
|
559 |
* |
|
560 |
* @return ETrue if the item is a node, EFalse otherwise |
|
561 |
* |
|
562 |
* @panic EFsListPanicInvalidItemId The specified item id was not found |
|
563 |
* in the list |
|
564 |
*/ |
|
565 |
IMPORT_C TBool IsNode( const TFsTreeItemId aItemId ) const; |
|
566 |
||
567 |
/** |
|
568 |
* Sets focus state of list component |
|
569 |
* @param aFocused status of the focus to be set |
|
570 |
*/ |
|
571 |
IMPORT_C void SetFocusedL( const TBool aFocused ); |
|
572 |
||
573 |
/** |
|
574 |
* Returns state of the focus |
|
575 |
* @return State of the focus |
|
576 |
*/ |
|
577 |
IMPORT_C TBool IsFocused() const; |
|
578 |
||
579 |
/** |
|
580 |
* Returns item visualizer for given item id. |
|
581 |
*/ |
|
582 |
IMPORT_C CFsTreeList* ItemMenu( TFsTreeItemId aItemId ); |
|
583 |
||
73
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
584 |
/** |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
585 |
* Sets marking mode on\off |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
586 |
* |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
587 |
* @param ETrue if marking mode is set on |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
588 |
*/ |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
589 |
|
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
590 |
IMPORT_C void SetMarkingModeL( const TBool aMarkingMode ); |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
591 |
|
64 | 592 |
public: // Visualization management |
593 |
||
594 |
/** |
|
595 |
* Displays the list. |
|
596 |
* |
|
597 |
* @param aFadeIn Defines if list visual should or shouldn't fade in to |
|
598 |
* the screen. |
|
599 |
* @param aSlideIn ETrue if slide in effect should be used, EFalse if not. |
|
600 |
*/ |
|
601 |
IMPORT_C void ShowListL( const TBool aFadeIn = EFalse, |
|
602 |
const TBool aSlideIn = EFalse ); |
|
603 |
||
604 |
||
605 |
/** |
|
606 |
* Sets direct touch mode. |
|
607 |
* |
|
608 |
* @param aDirectTouchMode ETrue if list should work as in direct touch, EFalse |
|
609 |
* otherwise. |
|
610 |
*/ |
|
611 |
IMPORT_C void SetDirectTouchMode( const TBool aDirectTouchMode ); |
|
612 |
||
613 |
/** |
|
614 |
* Hides the list. |
|
615 |
* |
|
616 |
* @param aFadeOut Defines if list visual should or shouldn't fade out |
|
617 |
* from the screen. |
|
618 |
* @param aSlideOut ETrue if slide out effect should be used,EFalse if not |
|
619 |
*/ |
|
620 |
IMPORT_C void HideListL( const TBool aFadeOut = EFalse, |
|
621 |
const TBool aSlideOut = EFalse ); |
|
622 |
||
623 |
/** |
|
624 |
* Gets the currently focused (highlighted) item id |
|
625 |
* |
|
626 |
* @return Id of the item being focused (highlighted) |
|
627 |
*/ |
|
628 |
IMPORT_C TFsTreeItemId FocusedItem() const; |
|
629 |
||
630 |
/** |
|
631 |
* Sets the focus (highlight) upon the item with given id |
|
632 |
* |
|
633 |
* @param aItemId Id of the item that is to be focused (highlighted) |
|
634 |
* |
|
635 |
* @panic EFsListPanicInvalidItemId The specified item id was not found |
|
636 |
* in the list |
|
637 |
*/ |
|
638 |
IMPORT_C void SetFocusedItemL( const TFsTreeItemId aItemId ); |
|
639 |
||
640 |
/** |
|
641 |
* Checks whether the item with specified id is marked. |
|
642 |
* |
|
643 |
* @param aItemId Id of an item. |
|
644 |
* |
|
645 |
* @return ETrue if the item is marked, EFalse otherwise. |
|
646 |
* |
|
647 |
* @panic EFsListPanicInvalidItemId The specified item id was not found |
|
648 |
* in the list. |
|
649 |
*/ |
|
650 |
IMPORT_C TBool IsMarked( const TFsTreeItemId aItemId ) const; |
|
651 |
||
652 |
/** |
|
653 |
* Checks whether the node with specified id is expanded. |
|
654 |
* |
|
655 |
* @param aNodeId Id of a node |
|
656 |
* |
|
657 |
* @return ETrue if the node is expanded, EFalse otherwise |
|
658 |
* |
|
659 |
* @panic EFsListPanicInvalidItemId The specified item id was not found |
|
660 |
* in the list |
|
661 |
* @panic EFsListPanicInvalidItemType Item id was passed instead of |
|
662 |
* the node id |
|
663 |
*/ |
|
664 |
IMPORT_C TBool IsExpanded( const TFsTreeItemId aNodeId ); |
|
665 |
||
666 |
/** |
|
667 |
* Marks the item. |
|
668 |
* |
|
669 |
* @param aItemId Id of an item |
|
670 |
* |
|
671 |
* @param aMarked ETrue to set item marked, EFalse to unmarked. |
|
672 |
* |
|
673 |
* @panic EFsListPanicInvalidItemId The specified item id was not found |
|
674 |
* in the list |
|
675 |
* @panic EFsListPanicIsNonMarkable The list is non-markable |
|
676 |
*/ |
|
677 |
IMPORT_C void MarkItemL( const TFsTreeItemId aItemId, TBool aMarked ); |
|
678 |
||
679 |
/** |
|
680 |
* Expands the node. Does nothing when the node is already expanded. |
|
681 |
* |
|
682 |
* @param aNodeId Id of a node |
|
683 |
* |
|
684 |
* @panic EFsListPanicInvalidItemId The specified item id was not found |
|
685 |
* in the list |
|
686 |
* @panic EFsListPanicInvalidItemType Item id was passed instead of |
|
687 |
* the node id |
|
688 |
*/ |
|
689 |
IMPORT_C void ExpandNodeL( const TFsTreeItemId aNodeId ); |
|
690 |
||
691 |
/** |
|
692 |
* Collapses the node. Does nothing when the node is already collapsed. |
|
693 |
* |
|
694 |
* @param aNodeId Id of a node |
|
695 |
* |
|
696 |
* @panic EFsListPanicInvalidItemId The specified item id was not found |
|
697 |
* in the list |
|
698 |
* @panic EFsListPanicInvalidItemType Item id was passed instead of |
|
699 |
* the node id |
|
700 |
*/ |
|
701 |
IMPORT_C void CollapseNodeL( const TFsTreeItemId aNodeId ); |
|
702 |
||
703 |
/** |
|
704 |
* Gets the list of marked items |
|
705 |
* |
|
706 |
* @param aMarkedItems Reference to the array that the list will copy |
|
707 |
* array of marked items' ids to |
|
708 |
*/ |
|
709 |
IMPORT_C void GetMarkedItemsL( RFsTreeItemIdList& aMarkedItems ) const; |
|
710 |
||
711 |
/** |
|
712 |
* Gets the reference to the item/node data (const) |
|
713 |
* |
|
714 |
* @param aItemId Id of the item/node |
|
715 |
* |
|
716 |
* @return Reference to the item/node data (const) |
|
717 |
* |
|
718 |
* @panic EFsListPanicInvalidItemId The specified item id was not found |
|
719 |
* in the list |
|
720 |
*/ |
|
721 |
IMPORT_C MFsTreeItemData& ItemData(const TFsTreeItemId aItemId) const; |
|
722 |
||
723 |
/** |
|
724 |
* Sets the reference to the item/node data |
|
725 |
* |
|
726 |
* @param aData Reference to the item/node data |
|
727 |
* @param aItemId Id of the item/node |
|
728 |
* |
|
729 |
* @panic EFsListPanicInvalidItemId The specified item id was not found |
|
730 |
* in the list |
|
731 |
*/ |
|
732 |
IMPORT_C void SetItemDataL( MFsTreeItemData& aData, |
|
733 |
const TFsTreeItemId aItemId ); |
|
734 |
||
735 |
/** |
|
736 |
* Gets the reference to the item visualizer (const) |
|
737 |
* |
|
738 |
* @param aItemId Id of the item |
|
739 |
* |
|
740 |
* @return Reference to the item visualizer (const) |
|
741 |
* |
|
742 |
* @panic EFsListPanicInvalidItemId The specified item id was not found |
|
743 |
* in the list |
|
744 |
*/ |
|
745 |
IMPORT_C MFsTreeItemVisualizer& ItemVisualizer( |
|
746 |
const TFsTreeItemId aItemId ) const; |
|
747 |
||
748 |
/** |
|
749 |
* Sets the reference to the item visualizer |
|
750 |
* |
|
751 |
* @param aVisualizer Reference to the new item's visualizer |
|
752 |
* @param aItemId Id of the item |
|
753 |
* |
|
754 |
* @panic EFsListPanicInvalidItemId The specified item id was not found |
|
755 |
* in the list |
|
756 |
*/ |
|
757 |
IMPORT_C void SetItemVisualizerL( MFsTreeItemVisualizer& aVisualizer, |
|
758 |
const TFsTreeItemId aItemId ); |
|
759 |
||
760 |
/** |
|
761 |
* Gets the reference to the tree visualizer |
|
762 |
* |
|
763 |
* @return Reference to the tree visualizer currently used by the tree |
|
764 |
* list. |
|
765 |
*/ |
|
766 |
IMPORT_C CFsTreeVisualizerBase& TreeVisualizer() const; |
|
767 |
||
768 |
/** |
|
769 |
* Sets a tree visualizer for the list |
|
770 |
* |
|
771 |
* @param aTreeV Reference to the tree visualizer that the tree list will |
|
772 |
* be using |
|
773 |
*/ |
|
774 |
IMPORT_C void SetTreeVisualizer( CFsTreeVisualizerBase& aTreeV ); |
|
775 |
||
776 |
/** |
|
777 |
* Sets visiblity of the border |
|
778 |
*/ |
|
779 |
IMPORT_C virtual void SetBorderL( const TBool aVisible, |
|
780 |
CAlfTexture* aBorderTexture = 0 ); |
|
781 |
||
782 |
/** |
|
783 |
* Sets visiblity of the shadow |
|
784 |
*/ |
|
785 |
IMPORT_C void SetShadowL( const TBool aVisible ); |
|
786 |
||
787 |
/** |
|
788 |
* Returns the items's target bounding rectangle in display coordinates if the item is visible. |
|
789 |
* Display coordinates are defined relative to the display's visible area. |
|
790 |
* |
|
791 |
* @param aItemId Item's ID. |
|
792 |
* @param aRect Out parameter. If successfull, contains item's target rectangle. |
|
793 |
* @return KErrNone if successfull, |
|
794 |
* KErrNotFound 1. the list does not contain item with given ID. |
|
795 |
* 2. item is not visible |
|
796 |
*/ |
|
797 |
IMPORT_C TInt GetItemDisplayRectTarget ( const TFsTreeItemId aItemId, TAlfRealRect& aRect ); |
|
798 |
||
799 |
//From MFsTreeVisualizerObserver |
|
800 |
||
801 |
/** |
|
802 |
* |
|
803 |
*/ |
|
804 |
IMPORT_C virtual void TreeVisualizerEventL( |
|
805 |
const TFsTreeVisualizerEvent aEvent, |
|
806 |
const TFsTreeItemId aId, |
|
807 |
const TPoint& aPoint ) const; |
|
808 |
||
809 |
/** |
|
810 |
* Gets the reference to the text style manager. |
|
811 |
* |
|
812 |
* @return Reference to the text style manager. |
|
813 |
*/ |
|
814 |
IMPORT_C CFsAlfTextStyleManager& TextStyleManager() const; |
|
815 |
||
816 |
/** |
|
817 |
* Sets the type of text marquee. |
|
818 |
* |
|
819 |
* @param aMarquee Type of marquee. |
|
820 |
*/ |
|
821 |
IMPORT_C void SetTextMarqueeType(const TFsTextMarqueeType aMarquee); |
|
822 |
||
823 |
/** |
|
824 |
* Returns the type of text marquee. |
|
825 |
* |
|
826 |
* @return Type of marquee. |
|
827 |
*/ |
|
828 |
IMPORT_C TFsTextMarqueeType TextMarqueeType() const; |
|
829 |
||
830 |
/** |
|
831 |
* Sets the speed of marquee. |
|
832 |
* |
|
833 |
* @param aPixelsPerSec How many pixels per second. |
|
834 |
*/ |
|
835 |
IMPORT_C void SetTextMarqueeSpeed ( const TInt aPixelsPerSec ); |
|
836 |
||
837 |
/** |
|
838 |
* Returns the speed of marquee. |
|
839 |
* |
|
840 |
* @return How many pixels per second. |
|
841 |
*/ |
|
842 |
IMPORT_C TInt TextMarqueeSpeed ( ) const; |
|
843 |
||
844 |
/** |
|
845 |
* Sets delay for text marquee start. |
|
846 |
* |
|
847 |
* @param aStartDelay Time after which the text marquee starts (in miliseconds). |
|
848 |
*/ |
|
849 |
IMPORT_C void SetTextMarqueeStartDelay ( const TInt aStartDelay ); |
|
850 |
||
851 |
/** |
|
852 |
* Returns delay for text marquee. |
|
853 |
* |
|
854 |
* @return Time after which the text marquee starts (in miliseconds). |
|
855 |
*/ |
|
856 |
IMPORT_C TInt TextMarqueeStartDelay () const; |
|
857 |
||
858 |
/** |
|
859 |
* Sets a delay for each cycle start. |
|
860 |
* |
|
861 |
* @param aCycleStartDelay Time after which the text marquee cycle starts (in miliseconds). |
|
862 |
*/ |
|
863 |
IMPORT_C void SetTextMarqueeCycleStartDelay ( const TInt aCycleStartDelay ); |
|
864 |
||
865 |
/** |
|
866 |
* Returns a delay for each cycle start. |
|
867 |
* |
|
868 |
* @return Time after which the text marquee cycle starts (in miliseconds). |
|
869 |
*/ |
|
870 |
IMPORT_C TInt TextMarqueeCycleStartDelay () const; |
|
871 |
||
872 |
/** |
|
873 |
* Sets repetitions number of marquee cycle. |
|
874 |
* |
|
875 |
* @param aRepetitions Number of marquee cycles. Negetive values - infinite loop. |
|
876 |
*/ |
|
877 |
IMPORT_C void SetTextMarqueeRepetitions ( const TInt aMarqueeRepetitions ); |
|
878 |
||
879 |
/** |
|
880 |
* Returns repetitions number of marquee cycle. |
|
881 |
* |
|
882 |
* @return Number of marquee cycles. Negetive values - infinite loop. |
|
883 |
*/ |
|
884 |
IMPORT_C TInt TextMarqueeRepetitions ( ) const; |
|
885 |
||
886 |
/** |
|
887 |
* Disables kinetic scrolling (Drag events will not scroll the list). |
|
888 |
* |
|
889 |
* @param aDisable ETrue if kinetic scrolling should be disabled. |
|
890 |
*/ |
|
891 |
IMPORT_C void DisableKineticScrolling( TBool aDisable ); |
|
892 |
||
893 |
protected: //Construction |
|
894 |
||
895 |
/** |
|
896 |
* C++ constructor |
|
897 |
*/ |
|
898 |
IMPORT_C CFsTreeList( CAlfEnv& aEnv, CFsTreeVisualizerBase& aTreeV ); |
|
899 |
||
900 |
/** |
|
901 |
* Second phase constructor |
|
902 |
* |
|
903 |
* @param aEnv Reference to the UI toolkit environment |
|
904 |
*/ |
|
905 |
IMPORT_C void ConstructL( CAlfEnv& aEnv ); |
|
906 |
||
907 |
protected: //Data members |
|
908 |
||
909 |
/** |
|
910 |
* Alf env |
|
911 |
*/ |
|
912 |
CAlfEnv* iEnv; |
|
913 |
||
914 |
/** |
|
915 |
* Visualizer class |
|
916 |
* Not own |
|
917 |
*/ |
|
918 |
CFsTreeVisualizerBase* iTreeVisualizer; |
|
919 |
||
920 |
/** |
|
921 |
* Tree data structure clas |
|
922 |
* Own |
|
923 |
*/ |
|
924 |
CFsTree* iTree; |
|
925 |
||
926 |
/** |
|
927 |
* Controller class for the list |
|
928 |
* Own |
|
929 |
*/ |
|
930 |
CFsTreeControl* iTreeControl; |
|
931 |
||
932 |
/** |
|
933 |
* Loop flag |
|
934 |
*/ |
|
935 |
TBool iIsLooping; |
|
936 |
||
937 |
/** |
|
938 |
* part of OLD API - to be removed. |
|
939 |
* SScrollbar flag |
|
940 |
*/ |
|
941 |
TFsTreeListScrollbars iHasScrollBars; |
|
942 |
||
943 |
||
944 |
/** |
|
945 |
* Id of the focused item |
|
946 |
*/ |
|
947 |
TFsTreeItemId iFocusedItem; |
|
948 |
||
949 |
/** |
|
950 |
* Type of markability |
|
951 |
*/ |
|
952 |
TFsTreeListMarkType iMarkType; |
|
953 |
||
954 |
/** |
|
955 |
* Array of observers |
|
956 |
*/ |
|
957 |
RFsTreeListObservers iObservers; |
|
958 |
||
959 |
/** |
|
960 |
* Text style manager. |
|
961 |
* Own |
|
962 |
*/ |
|
963 |
CFsAlfTextStyleManager* iTextStyleManager; |
|
964 |
||
965 |
/** |
|
966 |
* The list has focus or not. |
|
967 |
*/ |
|
968 |
TBool iListFocused; |
|
969 |
||
970 |
}; |
|
971 |
||
972 |
#endif // C_FSTREELIST_H |
|
973 |