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 list component implementation
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
//////SYSTEM INCLUDES
|
|
21 |
|
|
22 |
//////TOOLKIT INCLUDES
|
|
23 |
// <cmail> SF
|
|
24 |
#include "emailtrace.h"
|
|
25 |
#include <alf/alfenv.h>
|
|
26 |
// </cmail>
|
|
27 |
|
|
28 |
//////PROJECT INCLUDES
|
|
29 |
//<cmail> removed __FS_ALFRED_SUPPORT flag
|
|
30 |
//#include <fsconfig.h>
|
|
31 |
//</cmail> removed __FS_ALFRED_SUPPORT flag
|
|
32 |
#include "fstreelist.h"
|
|
33 |
#include "fstreecontrol.h"
|
|
34 |
#include "fstree.h"
|
|
35 |
#include "fstreeitem.h"
|
|
36 |
#include "fstreenode.h"
|
|
37 |
#include "fsgenericpanic.h"
|
|
38 |
#include "fstreeitemdata.h"
|
|
39 |
#include "fstreeitemvisualizer.h"
|
|
40 |
#include "fstreenodevisualizer.h"
|
|
41 |
#include "fstreelistobserver.h"
|
|
42 |
#include "fstreevisualizerbase.h"
|
|
43 |
#include "fstextstylemanager.h"
|
|
44 |
#include "fstreeobserver.h"
|
|
45 |
#include "fsalftextstylemanager.h"
|
|
46 |
#include "fsscrollbarset.h"
|
|
47 |
|
|
48 |
|
|
49 |
// ======== MEMBER FUNCTIONS ========
|
|
50 |
|
|
51 |
// ---------------------------------------------------------------------------
|
|
52 |
// Two-phased constructor.
|
|
53 |
// ---------------------------------------------------------------------------
|
|
54 |
//
|
|
55 |
EXPORT_C CFsTreeList* CFsTreeList::NewL( CFsTreeVisualizerBase& aTreeV,
|
|
56 |
CAlfEnv& aEnv )
|
|
57 |
{
|
|
58 |
FUNC_LOG;
|
|
59 |
CFsTreeList* self = new( ELeave ) CFsTreeList( aEnv, aTreeV );
|
|
60 |
CleanupStack::PushL( self );
|
|
61 |
self->ConstructL( aEnv );
|
|
62 |
CleanupStack::Pop( self );
|
|
63 |
return self;
|
|
64 |
}
|
|
65 |
|
|
66 |
// ---------------------------------------------------------------------------
|
|
67 |
// C++ destructor.
|
|
68 |
// ---------------------------------------------------------------------------
|
|
69 |
//
|
|
70 |
EXPORT_C CFsTreeList::~CFsTreeList()
|
|
71 |
{
|
|
72 |
FUNC_LOG;
|
|
73 |
delete iTree;
|
|
74 |
delete iTreeVisualizer;
|
|
75 |
delete iTextStyleManager;
|
|
76 |
iObservers.Close();
|
|
77 |
}
|
|
78 |
|
|
79 |
// ---------------------------------------------------------------------------
|
|
80 |
// Adds observer to the list of observers
|
|
81 |
// ---------------------------------------------------------------------------
|
|
82 |
EXPORT_C void CFsTreeList::AddObserverL(
|
|
83 |
MFsTreeListObserver& aTreeListObserver )
|
|
84 |
{
|
|
85 |
FUNC_LOG;
|
|
86 |
iObservers.AppendL(&aTreeListObserver);
|
|
87 |
}
|
|
88 |
|
|
89 |
// ---------------------------------------------------------------------------
|
|
90 |
// Removes observer from the list of observers
|
|
91 |
// ---------------------------------------------------------------------------
|
|
92 |
|
|
93 |
EXPORT_C void CFsTreeList::RemoveObserver(
|
|
94 |
MFsTreeListObserver& aTreeListObserver )
|
|
95 |
{
|
|
96 |
FUNC_LOG;
|
|
97 |
TInt ind = iObservers.Find( &aTreeListObserver );
|
|
98 |
if ( ind >= 0 )
|
|
99 |
{
|
|
100 |
iObservers.Remove( ind );
|
|
101 |
}
|
|
102 |
}
|
|
103 |
|
|
104 |
// ---------------------------------------------------------------------------
|
|
105 |
// Returns a control associated with the component.
|
|
106 |
// ---------------------------------------------------------------------------
|
|
107 |
//
|
|
108 |
EXPORT_C CAlfControl* CFsTreeList::TreeControl( ) const
|
|
109 |
{
|
|
110 |
FUNC_LOG;
|
|
111 |
return iTreeControl;
|
|
112 |
}
|
|
113 |
|
|
114 |
void CFsTreeList::BeginUpdate()
|
|
115 |
{
|
|
116 |
iTreeVisualizer->SetAutoRefreshAtInsert( EFalse );
|
|
117 |
}
|
|
118 |
|
|
119 |
void CFsTreeList::EndUpdateL()
|
|
120 |
{
|
|
121 |
iTreeVisualizer->SetAutoRefreshAtInsert( ETrue );
|
|
122 |
}
|
|
123 |
|
|
124 |
// ---------------------------------------------------------------------------
|
|
125 |
// Inserts new item as a child of parent given by Id with the given position.
|
|
126 |
// ---------------------------------------------------------------------------
|
|
127 |
//
|
|
128 |
EXPORT_C TFsTreeItemId CFsTreeList::InsertItemL( MFsTreeItemData& aItemD,
|
|
129 |
MFsTreeItemVisualizer& aItemV,
|
|
130 |
const TFsTreeItemId aParent,
|
|
131 |
const TInt aIndex,
|
|
132 |
const TBool aAllowRefresh )
|
|
133 |
{
|
|
134 |
FUNC_LOG;
|
|
135 |
iTreeVisualizer->SetAutoRefreshAtInsert( aAllowRefresh );
|
|
136 |
return iTree->InsertItemL(aItemD,aItemV,aParent,aIndex);
|
|
137 |
}
|
|
138 |
|
|
139 |
// ---------------------------------------------------------------------------
|
|
140 |
// Inserts new node as a child of parent given by Id with the given position.
|
|
141 |
// ---------------------------------------------------------------------------
|
|
142 |
//
|
|
143 |
EXPORT_C TFsTreeItemId CFsTreeList::InsertNodeL( MFsTreeItemData& aItemD,
|
|
144 |
MFsTreeNodeVisualizer& aNodeV,
|
|
145 |
const TFsTreeItemId aParent,
|
|
146 |
const TInt aIndex,
|
|
147 |
const TBool aAllowRefresh )
|
|
148 |
{
|
|
149 |
FUNC_LOG;
|
|
150 |
iTreeVisualizer->SetAutoRefreshAtInsert( aAllowRefresh );
|
|
151 |
return iTree->InsertNodeL(aItemD, aNodeV, aParent, aIndex);
|
|
152 |
}
|
|
153 |
|
|
154 |
// ---------------------------------------------------------------------------
|
|
155 |
// Remove all items from the list.
|
|
156 |
// ---------------------------------------------------------------------------
|
|
157 |
//
|
|
158 |
EXPORT_C void CFsTreeList::RemoveL( const TFsTreeItemId aItemId )
|
|
159 |
{
|
|
160 |
FUNC_LOG;
|
|
161 |
iTree->RemoveL(aItemId);
|
|
162 |
}
|
|
163 |
|
|
164 |
// ---------------------------------------------------------------------------
|
|
165 |
// Remove all items from the list.
|
|
166 |
// ---------------------------------------------------------------------------
|
|
167 |
//
|
|
168 |
EXPORT_C void CFsTreeList::RemoveAllL()
|
|
169 |
{
|
|
170 |
FUNC_LOG;
|
|
171 |
iTree->RemoveL(KFsTreeRootID);
|
|
172 |
}
|
|
173 |
|
|
174 |
// ---------------------------------------------------------------------------
|
|
175 |
// Remove all children of the selected node.
|
|
176 |
// ---------------------------------------------------------------------------
|
|
177 |
//
|
|
178 |
EXPORT_C void CFsTreeList::RemoveChildrenL( const TFsTreeItemId aNodeId )
|
|
179 |
{
|
|
180 |
FUNC_LOG;
|
|
181 |
for ( TInt childIndex = 0; childIndex < iTree->CountChildren(aNodeId);
|
|
182 |
childIndex++ )
|
|
183 |
{
|
|
184 |
iTree->RemoveL(iTree->Child(aNodeId, childIndex));
|
|
185 |
}
|
|
186 |
}
|
|
187 |
|
|
188 |
|
|
189 |
// ---------------------------------------------------------------------------
|
|
190 |
// Moves the item with given Id to the list of children of parent with
|
|
191 |
// given id
|
|
192 |
// ---------------------------------------------------------------------------
|
|
193 |
//
|
|
194 |
EXPORT_C void CFsTreeList::MoveItemL( const TFsTreeItemId aItemId,
|
|
195 |
const TFsTreeItemId aTargetNode, const TInt aIndex )
|
|
196 |
{
|
|
197 |
FUNC_LOG;
|
|
198 |
TBool subtreeItem = EFalse;
|
|
199 |
TFsTreeItemId treeItem = aTargetNode;
|
|
200 |
while (treeItem!=KFsTreeRootID)
|
|
201 |
{
|
|
202 |
treeItem = iTree->Parent(treeItem);
|
|
203 |
if (treeItem==aItemId)
|
|
204 |
{
|
|
205 |
subtreeItem = ETrue;
|
|
206 |
break;
|
|
207 |
}
|
|
208 |
}
|
|
209 |
|
|
210 |
if (subtreeItem)
|
|
211 |
{
|
|
212 |
User::Leave(EFsListPanicMovingNodeToItsChild);
|
|
213 |
}
|
|
214 |
else
|
|
215 |
{
|
|
216 |
iTree->MoveL( aItemId, aTargetNode, aIndex );
|
|
217 |
}
|
|
218 |
}
|
|
219 |
|
|
220 |
// ---------------------------------------------------------------------------
|
|
221 |
// Checks if a node has children, if parameter is omitted, root of the list
|
|
222 |
// is checked to indicate if the list is empty.
|
|
223 |
// ---------------------------------------------------------------------------
|
|
224 |
//
|
|
225 |
EXPORT_C TBool CFsTreeList::IsEmpty( const TFsTreeItemId aNodeId ) const
|
|
226 |
{
|
|
227 |
FUNC_LOG;
|
|
228 |
TBool result = ETrue;
|
|
229 |
|
|
230 |
if (aNodeId == KFsTreeRootID)
|
|
231 |
{
|
|
232 |
if (iTree->Count() > 0)
|
|
233 |
{
|
|
234 |
result = EFalse;
|
|
235 |
}
|
|
236 |
}
|
|
237 |
else
|
|
238 |
{
|
|
239 |
if (iTree->CountChildren(aNodeId) > 0)
|
|
240 |
{
|
|
241 |
result = EFalse;
|
|
242 |
}
|
|
243 |
}
|
|
244 |
|
|
245 |
return result;
|
|
246 |
}
|
|
247 |
|
|
248 |
// ---------------------------------------------------------------------------
|
|
249 |
// Returns the level of an item in tree.
|
|
250 |
// ---------------------------------------------------------------------------
|
|
251 |
//
|
|
252 |
EXPORT_C TUint CFsTreeList::Level( const TFsTreeItemId aItemId ) const
|
|
253 |
{
|
|
254 |
FUNC_LOG;
|
|
255 |
return iTree->Level(aItemId);
|
|
256 |
}
|
|
257 |
|
|
258 |
// ---------------------------------------------------------------------------
|
|
259 |
// Remove all children of the selected node.
|
|
260 |
// ---------------------------------------------------------------------------
|
|
261 |
//
|
|
262 |
EXPORT_C TUint CFsTreeList::Count() const
|
|
263 |
{
|
|
264 |
FUNC_LOG;
|
|
265 |
return iTree->Count();
|
|
266 |
}
|
|
267 |
|
|
268 |
// ---------------------------------------------------------------------------
|
|
269 |
// Gets the number of children of the given node
|
|
270 |
// ---------------------------------------------------------------------------
|
|
271 |
//
|
|
272 |
EXPORT_C TUint CFsTreeList::CountChildren( const TFsTreeItemId aNodeId ) const
|
|
273 |
{
|
|
274 |
FUNC_LOG;
|
|
275 |
return iTree->CountChildren( aNodeId );
|
|
276 |
}
|
|
277 |
|
|
278 |
// ---------------------------------------------------------------------------
|
|
279 |
// Gets the id of a child of the specified node with the position given
|
|
280 |
// ---------------------------------------------------------------------------
|
|
281 |
//
|
|
282 |
EXPORT_C TFsTreeItemId CFsTreeList::Child( const TFsTreeItemId aNodeId,
|
|
283 |
const TUint aIndex ) const
|
|
284 |
{
|
|
285 |
FUNC_LOG;
|
|
286 |
return iTree->Child( aNodeId, aIndex );
|
|
287 |
}
|
|
288 |
|
|
289 |
// ---------------------------------------------------------------------------
|
|
290 |
// Gets the index of a child with the specified id.
|
|
291 |
// ---------------------------------------------------------------------------
|
|
292 |
//
|
|
293 |
EXPORT_C TUint CFsTreeList::ChildIndex(const TFsTreeItemId aNodeId,
|
|
294 |
const TFsTreeItemId aItemId ) const
|
|
295 |
{
|
|
296 |
FUNC_LOG;
|
|
297 |
return iTree->ChildIndex(aNodeId, aItemId);
|
|
298 |
}
|
|
299 |
|
|
300 |
// ---------------------------------------------------------------------------
|
|
301 |
// Gets the parent's id for the specified item.
|
|
302 |
// ---------------------------------------------------------------------------
|
|
303 |
//
|
|
304 |
EXPORT_C TFsTreeItemId CFsTreeList::Parent(const TFsTreeItemId aItemId) const
|
|
305 |
{
|
|
306 |
FUNC_LOG;
|
|
307 |
return iTree->Parent(aItemId);
|
|
308 |
}
|
|
309 |
|
|
310 |
// ---------------------------------------------------------------------------
|
|
311 |
// Checks whether the item with specified id belongs to the list.
|
|
312 |
// ---------------------------------------------------------------------------
|
|
313 |
//
|
|
314 |
EXPORT_C TBool CFsTreeList::Contains( const TFsTreeItemId aItemId ) const
|
|
315 |
{
|
|
316 |
FUNC_LOG;
|
|
317 |
return iTree->Contains(aItemId);
|
|
318 |
}
|
|
319 |
|
|
320 |
// ---------------------------------------------------------------------------
|
|
321 |
// Checks if item is node or not.
|
|
322 |
// ---------------------------------------------------------------------------
|
|
323 |
//
|
|
324 |
EXPORT_C TBool CFsTreeList::IsNode( const TFsTreeItemId aItemId ) const
|
|
325 |
{
|
|
326 |
FUNC_LOG;
|
|
327 |
return iTree->IsNode(aItemId);
|
|
328 |
}
|
|
329 |
|
|
330 |
//---------------------------------------------------------------------------
|
|
331 |
// Sets focus state of list component
|
|
332 |
//---------------------------------------------------------------------------
|
|
333 |
EXPORT_C void CFsTreeList::SetFocusedL( const TBool aFocused )
|
|
334 |
{
|
|
335 |
FUNC_LOG;
|
|
336 |
iListFocused = aFocused;
|
|
337 |
iTreeControl->SetFocused( iListFocused );
|
|
338 |
iTreeVisualizer->SetFocusedL( iListFocused );
|
|
339 |
}
|
|
340 |
|
|
341 |
//---------------------------------------------------------------------------
|
|
342 |
// Returns state of the focus
|
|
343 |
//---------------------------------------------------------------------------
|
|
344 |
EXPORT_C TBool CFsTreeList::IsFocused() const
|
|
345 |
{
|
|
346 |
FUNC_LOG;
|
|
347 |
return iListFocused;
|
|
348 |
}
|
|
349 |
|
|
350 |
// ---------------------------------------------------------------------------
|
|
351 |
// The function sets duration of the slide-in effect.
|
|
352 |
// ---------------------------------------------------------------------------
|
|
353 |
//
|
|
354 |
EXPORT_C void CFsTreeList::SetSlideInDuration ( TInt aTimeMiliseconds )
|
|
355 |
{
|
|
356 |
FUNC_LOG;
|
|
357 |
iTreeVisualizer->SetSlideInDuration ( aTimeMiliseconds );
|
|
358 |
}
|
|
359 |
|
|
360 |
// ---------------------------------------------------------------------------
|
|
361 |
// The function returns slide in effect's duration.
|
|
362 |
// ---------------------------------------------------------------------------
|
|
363 |
//
|
|
364 |
EXPORT_C TInt CFsTreeList::SlideInDuration ( ) const
|
|
365 |
{
|
|
366 |
FUNC_LOG;
|
|
367 |
return iTreeVisualizer->SlideInDuration ( );
|
|
368 |
}
|
|
369 |
|
|
370 |
// ---------------------------------------------------------------------------
|
|
371 |
// The function sets direction of the slide in effect.
|
|
372 |
// ---------------------------------------------------------------------------
|
|
373 |
//
|
|
374 |
EXPORT_C void CFsTreeList::SetSlideInDirection (
|
|
375 |
MFsTreeVisualizer::TFsSlideEffect aDirection )
|
|
376 |
{
|
|
377 |
FUNC_LOG;
|
|
378 |
iTreeVisualizer->SetSlideInDirection ( aDirection );
|
|
379 |
}
|
|
380 |
|
|
381 |
// ---------------------------------------------------------------------------
|
|
382 |
// The function returns direction of the slide in effect.
|
|
383 |
// ---------------------------------------------------------------------------
|
|
384 |
//
|
|
385 |
EXPORT_C MFsTreeVisualizer::TFsSlideEffect
|
|
386 |
CFsTreeList::SlideInDirection ( ) const
|
|
387 |
{
|
|
388 |
FUNC_LOG;
|
|
389 |
return iTreeVisualizer->SlideInDirection ( );
|
|
390 |
}
|
|
391 |
|
|
392 |
// ---------------------------------------------------------------------------
|
|
393 |
// The function sets duration of the slide-out effect.
|
|
394 |
// ---------------------------------------------------------------------------
|
|
395 |
//
|
|
396 |
EXPORT_C void CFsTreeList::SetSlideOutDuration ( TInt aTimeMiliseconds )
|
|
397 |
{
|
|
398 |
FUNC_LOG;
|
|
399 |
iTreeVisualizer->SetSlideOutDuration ( aTimeMiliseconds );
|
|
400 |
}
|
|
401 |
|
|
402 |
// ---------------------------------------------------------------------------
|
|
403 |
// The function returns slide out effect's duration.
|
|
404 |
// ---------------------------------------------------------------------------
|
|
405 |
//
|
|
406 |
EXPORT_C TInt CFsTreeList::SlideOutDuration ( ) const
|
|
407 |
{
|
|
408 |
FUNC_LOG;
|
|
409 |
return iTreeVisualizer->SlideOutDuration ( );
|
|
410 |
}
|
|
411 |
|
|
412 |
// ---------------------------------------------------------------------------
|
|
413 |
// The function sets direction of the slide out effect.
|
|
414 |
// ---------------------------------------------------------------------------
|
|
415 |
//
|
|
416 |
EXPORT_C void CFsTreeList::SetSlideOutDirection (
|
|
417 |
MFsTreeVisualizer::TFsSlideEffect aDirection )
|
|
418 |
{
|
|
419 |
FUNC_LOG;
|
|
420 |
iTreeVisualizer->SetSlideOutDirection ( aDirection );
|
|
421 |
}
|
|
422 |
|
|
423 |
// ---------------------------------------------------------------------------
|
|
424 |
// The function returns direction of the slide out effect.
|
|
425 |
// ---------------------------------------------------------------------------
|
|
426 |
//
|
|
427 |
EXPORT_C MFsTreeVisualizer::TFsSlideEffect
|
|
428 |
CFsTreeList::SlideOutDirection ( ) const
|
|
429 |
{
|
|
430 |
FUNC_LOG;
|
|
431 |
return iTreeVisualizer->SlideOutDirection ( );
|
|
432 |
}
|
|
433 |
|
|
434 |
// ---------------------------------------------------------------------------
|
|
435 |
// Returns information about looping type of the list.
|
|
436 |
// ---------------------------------------------------------------------------
|
|
437 |
//
|
|
438 |
EXPORT_C TFsTreeListLoopingType CFsTreeList::LoopingType() const
|
|
439 |
{
|
|
440 |
FUNC_LOG;
|
|
441 |
TFsTreeListLoopingType loopingType = EFsTreeListLoopingDisabled;
|
|
442 |
|
|
443 |
if ( iTreeVisualizer )
|
|
444 |
{
|
|
445 |
loopingType = iTreeVisualizer->LoopingType();
|
|
446 |
}
|
|
447 |
|
|
448 |
return loopingType;
|
|
449 |
}
|
|
450 |
|
|
451 |
// ---------------------------------------------------------------------------
|
|
452 |
// Returns information whether list is markable, non-markable or
|
|
453 |
// multi-markable
|
|
454 |
// ---------------------------------------------------------------------------
|
|
455 |
//
|
|
456 |
EXPORT_C CFsTreeList::TFsTreeListMarkType CFsTreeList::MarkType() const
|
|
457 |
{
|
|
458 |
FUNC_LOG;
|
|
459 |
return iMarkType;
|
|
460 |
}
|
|
461 |
|
|
462 |
// ---------------------------------------------------------------------------
|
|
463 |
// OLD API - to be removed.
|
|
464 |
// Returns information about scrollbars used by list visual
|
|
465 |
// ---------------------------------------------------------------------------
|
|
466 |
//
|
|
467 |
EXPORT_C CFsTreeList::TFsTreeListScrollbars CFsTreeList::HasScrollBars() const
|
|
468 |
{
|
|
469 |
FUNC_LOG;
|
|
470 |
return iHasScrollBars;
|
|
471 |
}
|
|
472 |
|
|
473 |
// ---------------------------------------------------------------------------
|
|
474 |
// Old API - to be removed
|
|
475 |
// Enables or disables scrollbars
|
|
476 |
// ---------------------------------------------------------------------------
|
|
477 |
//
|
|
478 |
EXPORT_C void CFsTreeList::SetScrollBarsL( const TFsTreeListScrollbars aFlag )
|
|
479 |
{
|
|
480 |
FUNC_LOG;
|
|
481 |
iHasScrollBars = aFlag;
|
|
482 |
if ( aFlag == EFsTreeListNoScrollbars )
|
|
483 |
{
|
|
484 |
iTreeVisualizer->SetVScrollBarL( EFalse );
|
|
485 |
}
|
|
486 |
else if ( aFlag == EFsTreeListVerticalScrollbar )
|
|
487 |
{
|
|
488 |
iTreeVisualizer->SetVScrollBarL( ETrue );
|
|
489 |
}
|
|
490 |
}
|
|
491 |
|
|
492 |
// ---------------------------------------------------------------------------
|
|
493 |
// Returns information about scrollbars used by list visual
|
|
494 |
// ---------------------------------------------------------------------------
|
|
495 |
//
|
|
496 |
EXPORT_C TFsScrollbarVisibility CFsTreeList::ScrollbarVisibility() const
|
|
497 |
{
|
|
498 |
FUNC_LOG;
|
|
499 |
return iTreeVisualizer->ScrollbarVisibility();
|
|
500 |
}
|
|
501 |
|
|
502 |
// ---------------------------------------------------------------------------
|
|
503 |
// Enables or disables scrollbars
|
|
504 |
// ---------------------------------------------------------------------------
|
|
505 |
//
|
|
506 |
EXPORT_C void CFsTreeList::SetScrollbarVisibilityL(const TFsScrollbarVisibility aVisibility)
|
|
507 |
{
|
|
508 |
FUNC_LOG;
|
|
509 |
iTreeVisualizer->SetScrollBarVisibilityL(aVisibility);
|
|
510 |
}
|
|
511 |
|
|
512 |
// ---------------------------------------------------------------------------
|
|
513 |
// Sets type of list's looping.
|
|
514 |
// ---------------------------------------------------------------------------
|
|
515 |
//
|
|
516 |
EXPORT_C void CFsTreeList::SetLoopingType(
|
|
517 |
const TFsTreeListLoopingType aLoopingType )
|
|
518 |
{
|
|
519 |
FUNC_LOG;
|
|
520 |
if ( iTreeVisualizer )
|
|
521 |
{
|
|
522 |
iTreeVisualizer->SetLoopingType( aLoopingType );
|
|
523 |
}
|
|
524 |
}
|
|
525 |
|
|
526 |
// ---------------------------------------------------------------------------
|
|
527 |
// The functions sets fade-in's effect duration.
|
|
528 |
// ---------------------------------------------------------------------------
|
|
529 |
//
|
|
530 |
EXPORT_C void CFsTreeList::SetFadeInEffectTime( TInt aFadeTime )
|
|
531 |
{
|
|
532 |
FUNC_LOG;
|
|
533 |
iTreeVisualizer->SetFadeInEffectTime( aFadeTime );
|
|
534 |
}
|
|
535 |
|
|
536 |
// ---------------------------------------------------------------------------
|
|
537 |
// The functions returns fade-in's effect duration.
|
|
538 |
// ---------------------------------------------------------------------------
|
|
539 |
//
|
|
540 |
EXPORT_C TInt CFsTreeList::FadeInEffectTime( )
|
|
541 |
{
|
|
542 |
FUNC_LOG;
|
|
543 |
return iTreeVisualizer->FadeInEffectTime( );
|
|
544 |
}
|
|
545 |
|
|
546 |
// ---------------------------------------------------------------------------
|
|
547 |
// The functions sets fade-out's effect duration.
|
|
548 |
// ---------------------------------------------------------------------------
|
|
549 |
//
|
|
550 |
EXPORT_C void CFsTreeList::SetFadeOutEffectTime( TInt aFadeTime )
|
|
551 |
{
|
|
552 |
FUNC_LOG;
|
|
553 |
iTreeVisualizer->SetFadeOutEffectTime ( aFadeTime );
|
|
554 |
}
|
|
555 |
|
|
556 |
// ---------------------------------------------------------------------------
|
|
557 |
// The functions returns fade-out's effect duration.
|
|
558 |
// ---------------------------------------------------------------------------
|
|
559 |
//
|
|
560 |
EXPORT_C TInt CFsTreeList::FadeOutEffectTime( )
|
|
561 |
{
|
|
562 |
FUNC_LOG;
|
|
563 |
return iTreeVisualizer->FadeOutEffectTime();
|
|
564 |
}
|
|
565 |
|
|
566 |
// ---------------------------------------------------------------------------
|
|
567 |
// Function sets the time of list scroll per item and the scroll
|
|
568 |
// acceleration rate.
|
|
569 |
// ---------------------------------------------------------------------------
|
|
570 |
//
|
|
571 |
EXPORT_C void CFsTreeList::SetScrollTime ( TInt aScrollTime,
|
|
572 |
TReal aScrollAcceleration )
|
|
573 |
{
|
|
574 |
FUNC_LOG;
|
|
575 |
iTreeVisualizer->SetScrollTime( aScrollTime, aScrollAcceleration );
|
|
576 |
}
|
|
577 |
|
|
578 |
// ---------------------------------------------------------------------------
|
|
579 |
// Function gets the values of scroll speed and its acceleration rate.
|
|
580 |
// ---------------------------------------------------------------------------
|
|
581 |
//
|
|
582 |
EXPORT_C void CFsTreeList::GetScrollTime( TInt& aScrollTime,
|
|
583 |
TReal& aScrollAcceleration )
|
|
584 |
{
|
|
585 |
FUNC_LOG;
|
|
586 |
iTreeVisualizer->GetScrollTime( aScrollTime, aScrollAcceleration );
|
|
587 |
}
|
|
588 |
|
|
589 |
// ---------------------------------------------------------------------------
|
|
590 |
// Gets the currently focused (highlighted) item id.
|
|
591 |
// ---------------------------------------------------------------------------
|
|
592 |
//
|
|
593 |
EXPORT_C TFsTreeItemId CFsTreeList::FocusedItem() const
|
|
594 |
{
|
|
595 |
FUNC_LOG;
|
|
596 |
return iTreeVisualizer->FocusedItem();
|
|
597 |
}
|
|
598 |
|
|
599 |
// ---------------------------------------------------------------------------
|
|
600 |
// Sets the focus (highlight) upon the item with given id.
|
|
601 |
// ---------------------------------------------------------------------------
|
|
602 |
//
|
|
603 |
EXPORT_C void CFsTreeList::SetFocusedItemL( const TFsTreeItemId aItemId )
|
|
604 |
{
|
|
605 |
FUNC_LOG;
|
|
606 |
iTreeVisualizer->SetFocusedItemL(aItemId);
|
|
607 |
}
|
|
608 |
|
|
609 |
// ---------------------------------------------------------------------------
|
|
610 |
// Checks whether the item with specified id is marked.
|
|
611 |
// ---------------------------------------------------------------------------
|
|
612 |
//
|
|
613 |
EXPORT_C TBool CFsTreeList::IsMarked( const TFsTreeItemId aItemId ) const
|
|
614 |
{
|
|
615 |
FUNC_LOG;
|
|
616 |
return iTreeVisualizer->IsMarked( aItemId );
|
|
617 |
}
|
|
618 |
|
|
619 |
// ---------------------------------------------------------------------------
|
|
620 |
// Marks the item.
|
|
621 |
// ---------------------------------------------------------------------------
|
|
622 |
//
|
|
623 |
EXPORT_C void CFsTreeList::MarkItemL( const TFsTreeItemId aItemId, TBool aMarked )
|
|
624 |
{
|
|
625 |
FUNC_LOG;
|
|
626 |
iTreeVisualizer-> MarkItemL( aItemId, aMarked );
|
|
627 |
}
|
|
628 |
|
|
629 |
// ---------------------------------------------------------------------------
|
|
630 |
// Enables or disables marking of list items.
|
|
631 |
// ---------------------------------------------------------------------------
|
|
632 |
//
|
|
633 |
EXPORT_C void CFsTreeList::SetMarkTypeL( const TFsTreeListMarkType aFlag )
|
|
634 |
{
|
|
635 |
FUNC_LOG;
|
|
636 |
iMarkType = aFlag;
|
|
637 |
|
|
638 |
switch ( iMarkType )
|
|
639 |
{
|
|
640 |
case EFsTreeListNonMarkable:
|
|
641 |
{
|
|
642 |
iTreeVisualizer->MarkAllItemsL( EFalse );
|
|
643 |
break;
|
|
644 |
}
|
|
645 |
case EFsTreeListMarkable:
|
|
646 |
{
|
|
647 |
RArray<TFsTreeItemId> markedItems;
|
|
648 |
iTreeVisualizer->GetMarkedItemsL( markedItems );
|
|
649 |
iTreeVisualizer->MarkAllItemsL( EFalse );
|
|
650 |
if ( markedItems.Count() > 0 )
|
|
651 |
{
|
|
652 |
iTreeVisualizer->MarkItemL( markedItems[0], ETrue );
|
|
653 |
}
|
|
654 |
break;
|
|
655 |
}
|
|
656 |
case EFsTreeListMultiMarkable:
|
|
657 |
{
|
|
658 |
break;
|
|
659 |
}
|
|
660 |
}
|
|
661 |
}
|
|
662 |
|
|
663 |
// ---------------------------------------------------------------------------
|
|
664 |
// Get items indentation in pixels.
|
|
665 |
// ---------------------------------------------------------------------------
|
|
666 |
//
|
|
667 |
EXPORT_C TInt CFsTreeList::Indentation() const
|
|
668 |
{
|
|
669 |
FUNC_LOG;
|
|
670 |
return iTreeVisualizer->Indentation();
|
|
671 |
}
|
|
672 |
|
|
673 |
// ---------------------------------------------------------------------------
|
|
674 |
// Set items indentation in pixels.
|
|
675 |
// ---------------------------------------------------------------------------
|
|
676 |
//
|
|
677 |
EXPORT_C void CFsTreeList::SetIndentationL( const TInt aIndentation )
|
|
678 |
{
|
|
679 |
FUNC_LOG;
|
|
680 |
iTreeVisualizer->SetIndentationL( aIndentation );
|
|
681 |
}
|
|
682 |
|
|
683 |
// ---------------------------------------------------------------------------
|
|
684 |
// The functions sets wether all item in the list should be always in
|
|
685 |
// extended state or in normal state.
|
|
686 |
// ---------------------------------------------------------------------------
|
|
687 |
//
|
|
688 |
EXPORT_C void CFsTreeList::SetItemsAlwaysExtendedL ( TBool aAlwaysExtended )
|
|
689 |
{
|
|
690 |
FUNC_LOG;
|
|
691 |
iTreeVisualizer->SetItemsAlwaysExtendedL ( aAlwaysExtended );
|
|
692 |
}
|
|
693 |
|
|
694 |
// ---------------------------------------------------------------------------
|
|
695 |
// The function returns if items are always in extended state or in normal.
|
|
696 |
// ---------------------------------------------------------------------------
|
|
697 |
//
|
|
698 |
EXPORT_C TBool CFsTreeList::IsItemsAlwaysExtended ( )
|
|
699 |
{
|
|
700 |
FUNC_LOG;
|
|
701 |
TBool alwaysExtended = EFalse;
|
|
702 |
alwaysExtended = iTreeVisualizer->IsItemsAlwaysExtended();
|
|
703 |
return alwaysExtended;
|
|
704 |
}
|
|
705 |
|
|
706 |
// ---------------------------------------------------------------------------
|
|
707 |
// C++ constructor.
|
|
708 |
// ---------------------------------------------------------------------------
|
|
709 |
//
|
|
710 |
EXPORT_C CFsTreeList::CFsTreeList( CAlfEnv& aEnv, CFsTreeVisualizerBase& aTreeV )
|
|
711 |
: iEnv(&aEnv),
|
|
712 |
iListFocused (ETrue)
|
|
713 |
{
|
|
714 |
FUNC_LOG;
|
|
715 |
iTreeVisualizer = &aTreeV;
|
|
716 |
}
|
|
717 |
|
|
718 |
// ---------------------------------------------------------------------------
|
|
719 |
// Second phase constructor.
|
|
720 |
// ---------------------------------------------------------------------------
|
|
721 |
//
|
|
722 |
EXPORT_C void CFsTreeList::ConstructL( CAlfEnv& aEnv )
|
|
723 |
{
|
|
724 |
FUNC_LOG;
|
|
725 |
iTextStyleManager = CFsAlfTextStyleManager::NewL( aEnv.TextStyleManager() );
|
|
726 |
iTree = CFsTree::NewL(*iTreeVisualizer, *(iTreeVisualizer->RootItemData()),
|
|
727 |
*(iTreeVisualizer->RootNodeVisualizer()));
|
|
728 |
iTreeVisualizer->SetTreeData(*iTree);
|
|
729 |
iTreeControl = CFsTreeControl::NewL(aEnv, *iTree, *iTreeVisualizer);
|
|
730 |
iTreeVisualizer->ShowListL( EFalse );
|
|
731 |
iTreeVisualizer->SetVisualizerObserver( this );
|
|
732 |
}
|
|
733 |
|
|
734 |
// ---------------------------------------------------------------------------
|
|
735 |
// Expand the node.
|
|
736 |
// ---------------------------------------------------------------------------
|
|
737 |
//
|
|
738 |
EXPORT_C void CFsTreeList::ExpandNodeL( const TFsTreeItemId aNodeId )
|
|
739 |
{
|
|
740 |
FUNC_LOG;
|
|
741 |
iTreeVisualizer->ExpandNodeL(aNodeId);
|
|
742 |
}
|
|
743 |
|
|
744 |
// ---------------------------------------------------------------------------
|
|
745 |
// Collapse the node.
|
|
746 |
// ---------------------------------------------------------------------------
|
|
747 |
//
|
|
748 |
EXPORT_C void CFsTreeList::CollapseNodeL( const TFsTreeItemId aNodeId )
|
|
749 |
{
|
|
750 |
FUNC_LOG;
|
|
751 |
iTreeVisualizer->CollapseNodeL(aNodeId);
|
|
752 |
}
|
|
753 |
|
|
754 |
// ---------------------------------------------------------------------------
|
|
755 |
// Copy the list of marked items.
|
|
756 |
// ---------------------------------------------------------------------------
|
|
757 |
//
|
|
758 |
EXPORT_C void CFsTreeList::GetMarkedItemsL(
|
|
759 |
RFsTreeItemIdList& aMarkedItems ) const
|
|
760 |
{
|
|
761 |
FUNC_LOG;
|
|
762 |
iTreeVisualizer->GetMarkedItemsL(aMarkedItems);
|
|
763 |
}
|
|
764 |
|
|
765 |
// ---------------------------------------------------------------------------
|
|
766 |
// Gets the reference to the item/node data (const).
|
|
767 |
// ---------------------------------------------------------------------------
|
|
768 |
//
|
|
769 |
EXPORT_C MFsTreeItemData& CFsTreeList::ItemData(
|
|
770 |
const TFsTreeItemId aItemId) const
|
|
771 |
{
|
|
772 |
FUNC_LOG;
|
|
773 |
return iTree->ItemData(aItemId);
|
|
774 |
}
|
|
775 |
|
|
776 |
// ---------------------------------------------------------------------------
|
|
777 |
// Sets the reference to the item/node data.
|
|
778 |
// ---------------------------------------------------------------------------
|
|
779 |
//
|
|
780 |
EXPORT_C void CFsTreeList::SetItemDataL( MFsTreeItemData& aData,
|
|
781 |
const TFsTreeItemId aItemId )
|
|
782 |
{
|
|
783 |
FUNC_LOG;
|
|
784 |
MFsTreeItemData* data = &iTree->ItemData(aItemId);
|
|
785 |
delete data;
|
|
786 |
iTree->SetItemData(aData, aItemId);
|
|
787 |
iTreeVisualizer->TreeEventL(
|
|
788 |
MFsTreeObserver::EFsTreeItemDataChanged,
|
|
789 |
MFsTreeObserver::TFsTreeEventParams(aItemId, KFsTreeNoneID, -1) );
|
|
790 |
}
|
|
791 |
|
|
792 |
// ---------------------------------------------------------------------------
|
|
793 |
// Gets the reference to the item visualizer (const).
|
|
794 |
// ---------------------------------------------------------------------------
|
|
795 |
//
|
|
796 |
EXPORT_C MFsTreeItemVisualizer& CFsTreeList::ItemVisualizer(
|
|
797 |
const TFsTreeItemId aItemId ) const
|
|
798 |
{
|
|
799 |
FUNC_LOG;
|
|
800 |
return *iTree->ItemVisualizer(aItemId);
|
|
801 |
}
|
|
802 |
|
|
803 |
// ---------------------------------------------------------------------------
|
|
804 |
// Sets the pointer to the item visualizer and refreshes item.
|
|
805 |
// ---------------------------------------------------------------------------
|
|
806 |
//
|
|
807 |
EXPORT_C void CFsTreeList::SetItemVisualizerL(
|
|
808 |
MFsTreeItemVisualizer& aVisualizer,
|
|
809 |
const TFsTreeItemId aItemId )
|
|
810 |
{
|
|
811 |
FUNC_LOG;
|
|
812 |
MFsTreeItemVisualizer* visualizer = iTree->ItemVisualizer(aItemId);
|
|
813 |
visualizer->Hide(iTreeVisualizer->ItemExpansionDelay());
|
|
814 |
delete visualizer;
|
|
815 |
iTree->SetItemVisualizer(aVisualizer, aItemId);
|
|
816 |
iTreeVisualizer->TreeEventL(
|
|
817 |
MFsTreeObserver::EFsTreeItemVisualizerChanged,
|
|
818 |
MFsTreeObserver::TFsTreeEventParams(aItemId, KFsTreeNoneID, -1));
|
|
819 |
}
|
|
820 |
|
|
821 |
// ---------------------------------------------------------------------------
|
|
822 |
// Check whether the node is expanded or collapsed.
|
|
823 |
// ---------------------------------------------------------------------------
|
|
824 |
//
|
|
825 |
EXPORT_C TBool CFsTreeList::IsExpanded( const TFsTreeItemId aNodeId )
|
|
826 |
{
|
|
827 |
FUNC_LOG;
|
|
828 |
return iTree->NodeVisualizer(aNodeId)->IsExpanded();
|
|
829 |
}
|
|
830 |
|
|
831 |
// ---------------------------------------------------------------------------
|
|
832 |
// Gets the reference to the tree visualizer
|
|
833 |
// ---------------------------------------------------------------------------
|
|
834 |
//
|
|
835 |
EXPORT_C CFsTreeVisualizerBase& CFsTreeList::TreeVisualizer() const
|
|
836 |
{
|
|
837 |
FUNC_LOG;
|
|
838 |
return *iTreeVisualizer;
|
|
839 |
}
|
|
840 |
|
|
841 |
// ---------------------------------------------------------------------------
|
|
842 |
// Sets a tree visualizer for the list
|
|
843 |
// ---------------------------------------------------------------------------
|
|
844 |
//
|
|
845 |
EXPORT_C void CFsTreeList::SetTreeVisualizer( CFsTreeVisualizerBase& aTreeV )
|
|
846 |
{
|
|
847 |
FUNC_LOG;
|
|
848 |
iTreeVisualizer = &aTreeV;
|
|
849 |
|
|
850 |
if (iTree)
|
|
851 |
{
|
|
852 |
iTreeVisualizer->SetTreeData(*iTree);
|
|
853 |
}
|
|
854 |
|
|
855 |
}
|
|
856 |
|
|
857 |
// ---------------------------------------------------------------------------
|
|
858 |
// Shows the list visual
|
|
859 |
// ---------------------------------------------------------------------------
|
|
860 |
//
|
|
861 |
EXPORT_C void CFsTreeList::ShowListL( const TBool aFadeIn,
|
|
862 |
const TBool aSlideIn )
|
|
863 |
{
|
|
864 |
FUNC_LOG;
|
|
865 |
//SetFocusedL(ETrue);
|
|
866 |
iTreeVisualizer->ShowListL( aFadeIn, aSlideIn );
|
|
867 |
}
|
|
868 |
|
|
869 |
// ---------------------------------------------------------------------------
|
|
870 |
// Shows the list visual
|
|
871 |
// ---------------------------------------------------------------------------
|
|
872 |
//
|
|
873 |
EXPORT_C void CFsTreeList::SetDirectTouchMode( const TBool aDirectTouchMode )
|
|
874 |
{
|
|
875 |
FUNC_LOG;
|
|
876 |
iTreeVisualizer->SetDirectTouchMode( aDirectTouchMode );
|
|
877 |
}
|
|
878 |
|
|
879 |
|
|
880 |
// ---------------------------------------------------------------------------
|
|
881 |
// Hides the list visual
|
|
882 |
// ---------------------------------------------------------------------------
|
|
883 |
//
|
|
884 |
EXPORT_C void CFsTreeList::HideListL( const TBool aFadeOut,
|
|
885 |
const TBool aSlideOut )
|
|
886 |
{
|
|
887 |
FUNC_LOG;
|
|
888 |
//SetFocusedL(EFalse);
|
|
889 |
iTreeVisualizer->HideList( aFadeOut, aSlideOut );
|
|
890 |
}
|
|
891 |
|
|
892 |
// ---------------------------------------------------------------------------
|
|
893 |
// Sets visiblity of the border
|
|
894 |
// ---------------------------------------------------------------------------
|
|
895 |
//
|
|
896 |
EXPORT_C void CFsTreeList::SetBorderL( const TBool aVisible,
|
|
897 |
CAlfTexture* aBorderTexture )
|
|
898 |
{
|
|
899 |
FUNC_LOG;
|
|
900 |
iTreeVisualizer->SetBorderL( aVisible, aBorderTexture );
|
|
901 |
}
|
|
902 |
|
|
903 |
// ---------------------------------------------------------------------------
|
|
904 |
// Sets visiblity of the border
|
|
905 |
// ---------------------------------------------------------------------------
|
|
906 |
//
|
|
907 |
EXPORT_C void CFsTreeList::SetShadowL( const TBool aVisible )
|
|
908 |
{
|
|
909 |
FUNC_LOG;
|
|
910 |
iTreeVisualizer->SetShadowL( aVisible );
|
|
911 |
}
|
|
912 |
|
|
913 |
// ---------------------------------------------------------------------------
|
|
914 |
//
|
|
915 |
// ---------------------------------------------------------------------------
|
|
916 |
//
|
|
917 |
EXPORT_C TInt CFsTreeList::GetItemDisplayRectTarget ( const TFsTreeItemId aItemId, TAlfRealRect& aRect )
|
|
918 |
{
|
|
919 |
FUNC_LOG;
|
|
920 |
TInt retVal(KErrNotFound);
|
|
921 |
if (iTree->Contains( aItemId ))
|
|
922 |
{
|
|
923 |
retVal = iTreeVisualizer->GetItemDisplayRectTarget( aItemId, aRect );
|
|
924 |
}
|
|
925 |
return retVal;
|
|
926 |
}
|
|
927 |
|
|
928 |
// ---------------------------------------------------------------------------
|
|
929 |
// Returns pointer to the menu list assigned to the item
|
|
930 |
// ---------------------------------------------------------------------------
|
|
931 |
//
|
|
932 |
EXPORT_C CFsTreeList* CFsTreeList::ItemMenu(
|
|
933 |
TFsTreeItemId aItemId )
|
|
934 |
{
|
|
935 |
FUNC_LOG;
|
|
936 |
return iTree->ItemVisualizer(aItemId)->Menu();
|
|
937 |
}
|
|
938 |
|
|
939 |
// ---------------------------------------------------------------------------
|
|
940 |
// Retrieves events from tree visualizer
|
|
941 |
// ---------------------------------------------------------------------------
|
|
942 |
//
|
|
943 |
// <cmail> Touch
|
|
944 |
EXPORT_C void CFsTreeList::TreeVisualizerEventL(
|
|
945 |
const TFsTreeVisualizerEvent aEvent,
|
|
946 |
const TFsTreeItemId aId,
|
|
947 |
const TPoint& aPoint ) const
|
|
948 |
// </cmail>
|
|
949 |
{
|
|
950 |
FUNC_LOG;
|
|
951 |
MFsTreeListObserver::TFsTreeListEvent listEvent;
|
|
952 |
|
|
953 |
switch ( aEvent )
|
|
954 |
{
|
|
955 |
// <cmail> "Base class modifications for using touch"
|
|
956 |
case MFsTreeVisualizerObserver::EFsTreeItemTouchAction:
|
|
957 |
{
|
|
958 |
listEvent = MFsTreeListObserver::EFsTreeListItemTouchAction;
|
|
959 |
break;
|
|
960 |
}
|
|
961 |
case MFsTreeVisualizerObserver::EFsTreeItemTouchLongTap:
|
|
962 |
{
|
|
963 |
listEvent = MFsTreeListObserver::EFsTreeListItemTouchLongTap;
|
|
964 |
break;
|
|
965 |
}
|
|
966 |
case MFsTreeVisualizerObserver::EFsTreeItemTouchFocused:
|
|
967 |
{
|
|
968 |
listEvent = MFsTreeListObserver::EFsTreeListItemTouchFocused;
|
|
969 |
break;
|
|
970 |
}
|
|
971 |
|
|
972 |
// </cmail>
|
|
973 |
|
|
974 |
case MFsTreeVisualizerObserver::EFsTreeItemSelected:
|
|
975 |
{
|
|
976 |
listEvent = MFsTreeListObserver::EFsTreeItemSelected;
|
|
977 |
break;
|
|
978 |
}
|
|
979 |
case MFsTreeVisualizerObserver::EFsTreeItemWithMenuSelected:
|
|
980 |
{
|
|
981 |
listEvent = MFsTreeListObserver::EFsTreeItemWithMenuSelected;
|
|
982 |
break;
|
|
983 |
}
|
|
984 |
case MFsTreeVisualizerObserver::EFsTreeKeyRightArrow:
|
|
985 |
{
|
|
986 |
listEvent = MFsTreeListObserver::EFsTreeListKeyRightArrow;
|
|
987 |
break;
|
|
988 |
}
|
|
989 |
case MFsTreeVisualizerObserver::EFsTreeKeyLeftArrow:
|
|
990 |
{
|
|
991 |
listEvent = MFsTreeListObserver::EFsTreeListKeyLeftArrow;
|
|
992 |
break;
|
|
993 |
}
|
|
994 |
case MFsTreeVisualizerObserver::EFsTreeListVisualizerShown:
|
|
995 |
{
|
|
996 |
listEvent = MFsTreeListObserver::EFsTreeListShown;
|
|
997 |
break;
|
|
998 |
}
|
|
999 |
case MFsTreeVisualizerObserver::EFsTreeListVisualizerHidden:
|
|
1000 |
{
|
|
1001 |
listEvent = MFsTreeListObserver::EFsTreeListHidden;
|
|
1002 |
break;
|
|
1003 |
}
|
|
1004 |
case MFsTreeVisualizerObserver::EFsTreeItemWillGetFocused:
|
|
1005 |
{
|
|
1006 |
listEvent = MFsTreeListObserver::EFsTreeListItemWillGetFocused;
|
|
1007 |
break;
|
|
1008 |
}
|
|
1009 |
|
|
1010 |
// <cmail>
|
|
1011 |
// Pass on the collapse/expand events.
|
|
1012 |
case MFsTreeVisualizerObserver::EFsTreeListItemCollapsed:
|
|
1013 |
{
|
|
1014 |
listEvent = MFsTreeListObserver::EFsTreeListItemCollapsed;
|
|
1015 |
break;
|
|
1016 |
}
|
|
1017 |
case MFsTreeVisualizerObserver::EFsTreeListItemExpanded:
|
|
1018 |
{
|
|
1019 |
listEvent = MFsTreeListObserver::EFsTreeListItemExpanded;
|
|
1020 |
break;
|
|
1021 |
}
|
|
1022 |
case MFsTreeVisualizerObserver::EFsTreeListCollapsedAll:
|
|
1023 |
{
|
|
1024 |
listEvent = MFsTreeListObserver::EFsTreeListCollapsedAll;
|
|
1025 |
break;
|
|
1026 |
}
|
|
1027 |
case MFsTreeVisualizerObserver::EFsTreeListExpandedAll:
|
|
1028 |
{
|
|
1029 |
listEvent = MFsTreeListObserver::EFsTreeListExpandedAll;
|
|
1030 |
break;
|
|
1031 |
}
|
|
1032 |
// </cmail>
|
|
1033 |
case MFsTreeVisualizerObserver::EFsChangeFocusVisibility:
|
|
1034 |
{
|
|
1035 |
listEvent = MFsTreeListObserver::EFsFocusVisibilityChange;
|
|
1036 |
break;
|
|
1037 |
}
|
|
1038 |
default:
|
|
1039 |
{
|
|
1040 |
return;
|
|
1041 |
}
|
|
1042 |
}
|
|
1043 |
|
|
1044 |
for ( TInt c = 0; c < iObservers.Count(); c++ )
|
|
1045 |
{
|
|
1046 |
iObservers[c]->TreeListEventL( listEvent, aId, aPoint );
|
|
1047 |
}
|
|
1048 |
}
|
|
1049 |
|
|
1050 |
// ---------------------------------------------------------------------------
|
|
1051 |
// Gets the reference to the text style manager.
|
|
1052 |
// ---------------------------------------------------------------------------
|
|
1053 |
EXPORT_C CFsAlfTextStyleManager& CFsTreeList::TextStyleManager() const
|
|
1054 |
{
|
|
1055 |
FUNC_LOG;
|
|
1056 |
return *iTextStyleManager;
|
|
1057 |
}
|
|
1058 |
|
|
1059 |
|
|
1060 |
// ---------------------------------------------------------------------------
|
|
1061 |
// Sets the type of text marquee.
|
|
1062 |
// ---------------------------------------------------------------------------
|
|
1063 |
//
|
|
1064 |
EXPORT_C void CFsTreeList::SetTextMarqueeType(const TFsTextMarqueeType aMarquee)
|
|
1065 |
{
|
|
1066 |
FUNC_LOG;
|
|
1067 |
iTreeVisualizer->SetTextMarqueeType( aMarquee );
|
|
1068 |
}
|
|
1069 |
|
|
1070 |
|
|
1071 |
// ---------------------------------------------------------------------------
|
|
1072 |
// Returns the type of text marquee.
|
|
1073 |
// ---------------------------------------------------------------------------
|
|
1074 |
//
|
|
1075 |
EXPORT_C TFsTextMarqueeType CFsTreeList::TextMarqueeType() const
|
|
1076 |
{
|
|
1077 |
FUNC_LOG;
|
|
1078 |
return iTreeVisualizer->TextMarqueeType();
|
|
1079 |
}
|
|
1080 |
|
|
1081 |
|
|
1082 |
// ---------------------------------------------------------------------------
|
|
1083 |
// Sets the speed of marquee.
|
|
1084 |
// ---------------------------------------------------------------------------
|
|
1085 |
//
|
|
1086 |
EXPORT_C void CFsTreeList::SetTextMarqueeSpeed ( const TInt aPixelsPerSec )
|
|
1087 |
{
|
|
1088 |
FUNC_LOG;
|
|
1089 |
iTreeVisualizer->SetTextMarqueeSpeed ( aPixelsPerSec );
|
|
1090 |
}
|
|
1091 |
|
|
1092 |
|
|
1093 |
// ---------------------------------------------------------------------------
|
|
1094 |
// Returns the speed of marquee.
|
|
1095 |
// ---------------------------------------------------------------------------
|
|
1096 |
//
|
|
1097 |
EXPORT_C TInt CFsTreeList::TextMarqueeSpeed ( ) const
|
|
1098 |
{
|
|
1099 |
FUNC_LOG;
|
|
1100 |
return iTreeVisualizer->TextMarqueeSpeed( );
|
|
1101 |
}
|
|
1102 |
|
|
1103 |
|
|
1104 |
// ---------------------------------------------------------------------------
|
|
1105 |
// Sets delay for text marquee start.
|
|
1106 |
// ---------------------------------------------------------------------------
|
|
1107 |
//
|
|
1108 |
EXPORT_C void CFsTreeList::SetTextMarqueeStartDelay ( const TInt aStartDelay )
|
|
1109 |
{
|
|
1110 |
FUNC_LOG;
|
|
1111 |
iTreeVisualizer->SetTextMarqueeStartDelay ( aStartDelay );
|
|
1112 |
}
|
|
1113 |
|
|
1114 |
|
|
1115 |
// ---------------------------------------------------------------------------
|
|
1116 |
// Returns delay for text marquee.
|
|
1117 |
// ---------------------------------------------------------------------------
|
|
1118 |
//
|
|
1119 |
EXPORT_C TInt CFsTreeList::TextMarqueeStartDelay () const
|
|
1120 |
{
|
|
1121 |
FUNC_LOG;
|
|
1122 |
return iTreeVisualizer->TextMarqueeStartDelay( );
|
|
1123 |
}
|
|
1124 |
|
|
1125 |
|
|
1126 |
// ---------------------------------------------------------------------------
|
|
1127 |
// Sets a delay for each cycle start.
|
|
1128 |
// ---------------------------------------------------------------------------
|
|
1129 |
//
|
|
1130 |
EXPORT_C void CFsTreeList::SetTextMarqueeCycleStartDelay ( const TInt aCycleStartDelay )
|
|
1131 |
{
|
|
1132 |
FUNC_LOG;
|
|
1133 |
iTreeVisualizer->SetTextMarqueeCycleStartDelay ( aCycleStartDelay );
|
|
1134 |
}
|
|
1135 |
|
|
1136 |
|
|
1137 |
// ---------------------------------------------------------------------------
|
|
1138 |
// Returns a delay for each cycle start.
|
|
1139 |
// ---------------------------------------------------------------------------
|
|
1140 |
//
|
|
1141 |
EXPORT_C TInt CFsTreeList::TextMarqueeCycleStartDelay () const
|
|
1142 |
{
|
|
1143 |
FUNC_LOG;
|
|
1144 |
return iTreeVisualizer->TextMarqueeCycleStartDelay( );
|
|
1145 |
}
|
|
1146 |
|
|
1147 |
|
|
1148 |
// ---------------------------------------------------------------------------
|
|
1149 |
// Sets number of marquee cycles.
|
|
1150 |
// ---------------------------------------------------------------------------
|
|
1151 |
//
|
|
1152 |
EXPORT_C void CFsTreeList::SetTextMarqueeRepetitions ( const TInt aMarqueeRepetitions )
|
|
1153 |
{
|
|
1154 |
FUNC_LOG;
|
|
1155 |
iTreeVisualizer->SetTextMarqueeRepetitions ( aMarqueeRepetitions );
|
|
1156 |
}
|
|
1157 |
|
|
1158 |
|
|
1159 |
// ---------------------------------------------------------------------------
|
|
1160 |
// Returns number of marquee cycles.
|
|
1161 |
// ---------------------------------------------------------------------------
|
|
1162 |
//
|
|
1163 |
EXPORT_C TInt CFsTreeList::TextMarqueeRepetitions ( ) const
|
|
1164 |
{
|
|
1165 |
FUNC_LOG;
|
|
1166 |
return iTreeVisualizer->TextMarqueeRepetitions( );
|
|
1167 |
}
|
|
1168 |
|
|
1169 |
// ---------------------------------------------------------------------------
|
|
1170 |
// Returns number of marquee cycles.
|
|
1171 |
// ---------------------------------------------------------------------------
|
|
1172 |
//
|
|
1173 |
EXPORT_C void CFsTreeList::DisableKineticScrolling( TBool aDisable )
|
|
1174 |
{
|
|
1175 |
iTreeVisualizer->DisableKineticScrolling( aDisable );
|
|
1176 |
}
|
|
1177 |
|
|
1178 |
//EOF
|
|
1179 |
|