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: Base class of node visualizer. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#include "emailtrace.h" |
|
20 |
#include <AknsUtils.h> |
|
21 |
#include <AknsSkinInstance.h> |
|
22 |
#include <biditext.h> |
|
23 |
||
24 |
#include "fstreenodevisualizerbase.h" |
|
25 |
#include "fstreelist.h" |
|
26 |
#include "fslayoutmanager.h" |
|
27 |
#include "fsalftextstylemanager.h" |
|
28 |
||
29 |
#include <alf/alfgradientbrush.h> |
|
30 |
#include <alf/alfimagebrush.h> |
|
31 |
#include <alf/alfanchorlayout.h> |
|
32 |
#include <alf/alfcontrol.h> |
|
33 |
#include <alf/alftexture.h> |
|
34 |
#include <alf/alfimage.h> |
|
35 |
#include <alf/alfenv.h> |
|
36 |
#include <alf/alftextstyle.h> |
|
37 |
#include <alf/alftextvisual.h> |
|
38 |
#include <alf/alfmappingfunctions.h> |
|
39 |
||
40 |
// --------------------------------------------------------------------------- |
|
41 |
// C++ destructor. |
|
42 |
// --------------------------------------------------------------------------- |
|
43 |
// |
|
44 |
CFsTreeNodeVisualizerBase::~CFsTreeNodeVisualizerBase() |
|
45 |
{ |
|
46 |
FUNC_LOG; |
|
47 |
if (iLayout) |
|
48 |
{ |
|
49 |
iLayout->Env().CancelCustomCommands(this); |
|
50 |
iLayout->RemoveAndDestroyAllD(); |
|
51 |
} |
|
52 |
} |
|
53 |
||
54 |
||
55 |
// --------------------------------------------------------------------------- |
|
56 |
// Returns visualizer's type. |
|
57 |
// --------------------------------------------------------------------------- |
|
58 |
// |
|
59 |
TFsTreeItemVisualizerType CFsTreeNodeVisualizerBase::Type() const |
|
60 |
{ |
|
61 |
FUNC_LOG; |
|
62 |
return EFsTreeItemVisualizerBase; |
|
63 |
} |
|
64 |
||
65 |
||
66 |
// --------------------------------------------------------------------------- |
|
67 |
// Sets the alignment for text item. |
|
68 |
// --------------------------------------------------------------------------- |
|
69 |
// |
|
70 |
void CFsTreeNodeVisualizerBase::SetTextAlign( |
|
71 |
const TAlfAlignHorizontal aAlign ) |
|
72 |
{ |
|
73 |
FUNC_LOG; |
|
74 |
iTextAlign = aAlign; |
|
75 |
} |
|
76 |
||
77 |
||
78 |
// --------------------------------------------------------------------------- |
|
79 |
// The function sets item's text color for the focused state. |
|
80 |
// --------------------------------------------------------------------------- |
|
81 |
// |
|
82 |
void CFsTreeNodeVisualizerBase::SetFocusedStateTextColor( const TRgb& aColor ) |
|
83 |
{ |
|
84 |
FUNC_LOG; |
|
85 |
iIsCustomTextFocusedColor = ETrue; |
|
86 |
iFocusedTextColor = aColor; |
|
87 |
} |
|
88 |
||
89 |
||
90 |
// --------------------------------------------------------------------------- |
|
91 |
// The function returns item's text color for the focused state. |
|
92 |
// --------------------------------------------------------------------------- |
|
93 |
// |
|
94 |
TRgb CFsTreeNodeVisualizerBase::FocusedStateTextColor() const |
|
95 |
{ |
|
96 |
FUNC_LOG; |
|
97 |
return iFocusedTextColor; |
|
98 |
} |
|
99 |
||
100 |
// --------------------------------------------------------------------------- |
|
101 |
// The function sets item's text color for the normal (unfocused) state. |
|
102 |
// --------------------------------------------------------------------------- |
|
103 |
// |
|
104 |
void CFsTreeNodeVisualizerBase::SetNormalStateTextColor( const TRgb& aColor ) |
|
105 |
{ |
|
106 |
FUNC_LOG; |
|
107 |
iIsCustomTextNormalColor = ETrue; |
|
108 |
iNormalTextColor = aColor; |
|
109 |
} |
|
110 |
||
111 |
||
112 |
// --------------------------------------------------------------------------- |
|
113 |
// The function returns item's text color for the normal (unfocused) state. |
|
114 |
// --------------------------------------------------------------------------- |
|
115 |
// |
|
116 |
TRgb CFsTreeNodeVisualizerBase::NormalStateTextColor() const |
|
117 |
{ |
|
118 |
FUNC_LOG; |
|
119 |
||
120 |
return iNormalTextColor; |
|
121 |
} |
|
122 |
||
123 |
||
124 |
// --------------------------------------------------------------------------- |
|
125 |
// The function sets the style of item's text. |
|
126 |
// --------------------------------------------------------------------------- |
|
127 |
// |
|
128 |
void CFsTreeNodeVisualizerBase::SetTextStyleId ( const TInt aTextStyleId ) |
|
129 |
{ |
|
130 |
FUNC_LOG; |
|
131 |
iIsCustomTextStyle = ETrue; |
|
132 |
iTextStyleId = aTextStyleId; |
|
133 |
} |
|
134 |
||
135 |
||
136 |
// --------------------------------------------------------------------------- |
|
137 |
// The function returns the style of item's text. |
|
138 |
// --------------------------------------------------------------------------- |
|
139 |
// |
|
140 |
TInt CFsTreeNodeVisualizerBase::TextStyleId () const |
|
141 |
{ |
|
142 |
FUNC_LOG; |
|
143 |
TInt styleId(0); |
|
144 |
if ( iIsCustomTextStyle ) |
|
145 |
{ |
|
146 |
styleId = iTextStyleId; |
|
147 |
} |
|
148 |
else |
|
149 |
{ |
|
150 |
TRAP_IGNORE( styleId = ModifiedStyleIdL() ); |
|
151 |
} |
|
152 |
return styleId; |
|
153 |
} |
|
154 |
||
155 |
||
156 |
// --------------------------------------------------------------------------- |
|
157 |
// From class MFsTreeItemVisualizer. |
|
158 |
// Sets multiple flags for an item at one time. |
|
159 |
// --------------------------------------------------------------------------- |
|
160 |
// |
|
161 |
void CFsTreeNodeVisualizerBase::SetFlags( TUint32 aFlags ) |
|
162 |
{ |
|
163 |
FUNC_LOG; |
|
164 |
iFlags = aFlags; |
|
165 |
} |
|
166 |
||
167 |
// --------------------------------------------------------------------------- |
|
168 |
// From class MFsTreeItemVisualizer. |
|
169 |
// Returns flags of the item visualizer. |
|
170 |
// --------------------------------------------------------------------------- |
|
171 |
// |
|
172 |
TUint32 CFsTreeNodeVisualizerBase::Flags() |
|
173 |
{ |
|
174 |
FUNC_LOG; |
|
175 |
return iFlags; |
|
176 |
} |
|
177 |
||
178 |
// --------------------------------------------------------------------------- |
|
179 |
// From class MFsTreeItemVisualizer. |
|
180 |
// Sets visualized item's state to marked/unmarked. |
|
181 |
// --------------------------------------------------------------------------- |
|
182 |
// |
|
183 |
void CFsTreeNodeVisualizerBase::SetMarked( TBool aFlag ) |
|
184 |
{ |
|
185 |
FUNC_LOG; |
|
186 |
if ( aFlag ) |
|
187 |
{ |
|
188 |
iFlags |= KFsTreeListItemMarked; |
|
189 |
} |
|
190 |
else |
|
191 |
{ |
|
192 |
iFlags &= ~KFsTreeListItemMarked; |
|
193 |
} |
|
194 |
} |
|
195 |
||
196 |
// --------------------------------------------------------------------------- |
|
197 |
// From class MFsTreeItemVisualizer. |
|
198 |
// Returns mark/unmark state of the item's visualization. |
|
199 |
// --------------------------------------------------------------------------- |
|
200 |
// |
|
201 |
TBool CFsTreeNodeVisualizerBase::IsMarked() const |
|
202 |
{ |
|
203 |
FUNC_LOG; |
|
204 |
return iFlags & KFsTreeListItemMarked ? ETrue : EFalse; |
|
205 |
} |
|
206 |
||
207 |
// --------------------------------------------------------------------------- |
|
208 |
// From class MFsTreeItemVisualizer. |
|
209 |
// Sets visualized item's state to dimmed/not dimmed. |
|
210 |
// --------------------------------------------------------------------------- |
|
211 |
// |
|
212 |
void CFsTreeNodeVisualizerBase::SetDimmed( TBool aFlag ) |
|
213 |
{ |
|
214 |
FUNC_LOG; |
|
215 |
if ( aFlag ) |
|
216 |
{ |
|
217 |
iFlags |= KFsTreeListItemDimmed; |
|
218 |
} |
|
219 |
else |
|
220 |
{ |
|
221 |
iFlags &= ~KFsTreeListItemDimmed; |
|
222 |
} |
|
223 |
} |
|
224 |
||
225 |
// --------------------------------------------------------------------------- |
|
226 |
// From class MFsTreeItemVisualizer. |
|
227 |
// Returns dimmed/not dimmed state of the item's visualization. |
|
228 |
// --------------------------------------------------------------------------- |
|
229 |
// |
|
230 |
TBool CFsTreeNodeVisualizerBase::IsDimmed() const |
|
231 |
{ |
|
232 |
FUNC_LOG; |
|
233 |
return iFlags & KFsTreeListItemDimmed ? ETrue : EFalse; |
|
234 |
} |
|
235 |
||
236 |
||
237 |
// --------------------------------------------------------------------------- |
|
238 |
// From class MFsTreeItemVisualizer. |
|
239 |
// Sets the size of the item visualization when item is not in expanded state. |
|
240 |
// --------------------------------------------------------------------------- |
|
241 |
// |
|
242 |
void CFsTreeNodeVisualizerBase::SetSize( const TSize aSize ) |
|
243 |
{ |
|
244 |
FUNC_LOG; |
|
245 |
iSize = aSize; |
|
246 |
} |
|
247 |
||
248 |
||
249 |
// --------------------------------------------------------------------------- |
|
250 |
// From class MFsTreeItemVisualizer. |
|
251 |
// Returns the size of an item in a normal (not expanded) state. |
|
252 |
// --------------------------------------------------------------------------- |
|
253 |
// |
|
254 |
TSize CFsTreeNodeVisualizerBase::Size() const |
|
255 |
{ |
|
256 |
FUNC_LOG; |
|
257 |
if ( iFlags & KFsTreeListItemManagedLayout ) |
|
258 |
{ |
|
259 |
CFsLayoutManager::TFsLayoutMetrics normalSizeMetrics (CFsLayoutManager::EFsLmListSingleFsDycPane); |
|
260 |
TRect parentLayoutRect(0,0,0,0); |
|
261 |
TSize size(0,0); |
|
262 |
TBool retVal(EFalse); |
|
263 |
||
264 |
retVal = CFsLayoutManager::LayoutMetricsSize( |
|
265 |
parentLayoutRect, |
|
266 |
normalSizeMetrics, |
|
267 |
size ); |
|
268 |
||
269 |
if ( !retVal ) |
|
270 |
{ |
|
271 |
size = iSize; |
|
272 |
} |
|
273 |
||
274 |
return size; |
|
275 |
} |
|
276 |
else |
|
277 |
{ |
|
278 |
return iSize; |
|
279 |
} |
|
280 |
} |
|
281 |
||
282 |
// --------------------------------------------------------------------------- |
|
283 |
// From class MFsTreeItemVisualizer. |
|
284 |
// Sets the item's visualization state to expanded. |
|
285 |
// --------------------------------------------------------------------------- |
|
286 |
// |
|
287 |
void CFsTreeNodeVisualizerBase::SetExtended( const TBool aFlag ) |
|
288 |
{ |
|
289 |
FUNC_LOG; |
|
290 |
if ( aFlag ) |
|
291 |
{ |
|
292 |
iFlags |= KFsTreeListItemExtended; |
|
293 |
} |
|
294 |
else |
|
295 |
{ |
|
296 |
iFlags &= ~KFsTreeListItemExtended; |
|
297 |
} |
|
298 |
} |
|
299 |
||
300 |
// --------------------------------------------------------------------------- |
|
301 |
// From class MFsTreeItemVisualizer. |
|
302 |
// Returns expanded/not expanded state of the item visualization. |
|
303 |
// --------------------------------------------------------------------------- |
|
304 |
// |
|
305 |
TBool CFsTreeNodeVisualizerBase::IsExtended() const |
|
306 |
{ |
|
307 |
FUNC_LOG; |
|
308 |
return iFlags & KFsTreeListItemExtended ? ETrue : EFalse; |
|
309 |
} |
|
310 |
||
311 |
// --------------------------------------------------------------------------- |
|
312 |
// From class MFsTreeItemVisualizer. |
|
313 |
// Sets if an item can be in expanded state or not. |
|
314 |
// --------------------------------------------------------------------------- |
|
315 |
// |
|
316 |
void CFsTreeNodeVisualizerBase::SetExtendable( TBool aFlag ) |
|
317 |
{ |
|
318 |
FUNC_LOG; |
|
319 |
if ( aFlag ) |
|
320 |
{ |
|
321 |
iFlags |= KFsTreeListItemExtendable; |
|
322 |
} |
|
323 |
else |
|
324 |
{ |
|
325 |
iFlags &= ~KFsTreeListItemExtendable; |
|
326 |
} |
|
327 |
} |
|
328 |
||
329 |
// --------------------------------------------------------------------------- |
|
330 |
// From class MFsTreeItemVisualizer. |
|
331 |
// Returns an information if item can be in expanded state. |
|
332 |
// --------------------------------------------------------------------------- |
|
333 |
// |
|
334 |
TBool CFsTreeNodeVisualizerBase::IsExtendable( ) |
|
335 |
{ |
|
336 |
FUNC_LOG; |
|
337 |
return iFlags & KFsTreeListItemExtendable ? ETrue : EFalse; |
|
338 |
} |
|
339 |
||
340 |
// --------------------------------------------------------------------------- |
|
341 |
// From class MFsTreeItemVisualizer. |
|
342 |
// Returns an information if item can be focusable. |
|
343 |
// --------------------------------------------------------------------------- |
|
344 |
// |
|
345 |
TBool CFsTreeNodeVisualizerBase::IsFocusable( ) const |
|
346 |
{ |
|
347 |
FUNC_LOG; |
|
348 |
return iFlags & KFsTreeListItemFocusable ? ETrue : EFalse; |
|
349 |
} |
|
350 |
||
351 |
// --------------------------------------------------------------------------- |
|
352 |
// From class MFsTreeItemVisualizer. |
|
353 |
// Sets the item's ability to receive focus. |
|
354 |
// --------------------------------------------------------------------------- |
|
355 |
// |
|
356 |
void CFsTreeNodeVisualizerBase::SetFocusable( const TBool aFlag ) |
|
357 |
{ |
|
358 |
FUNC_LOG; |
|
359 |
if ( aFlag ) |
|
360 |
{ |
|
361 |
iFlags |= KFsTreeListItemFocusable; |
|
362 |
} |
|
363 |
else |
|
364 |
{ |
|
365 |
iFlags &= ~KFsTreeListItemFocusable; |
|
366 |
} |
|
367 |
} |
|
368 |
||
369 |
// --------------------------------------------------------------------------- |
|
370 |
// From class MFsTreeItemVisualizer. |
|
371 |
// Sets the size of the item visualization area when item is in expanded |
|
372 |
// state. |
|
373 |
// --------------------------------------------------------------------------- |
|
374 |
// |
|
375 |
void CFsTreeNodeVisualizerBase::SetExtendedSize( |
|
376 |
const TSize aExtendedSize ) |
|
377 |
{ |
|
378 |
FUNC_LOG; |
|
379 |
iExtendedSize = aExtendedSize; |
|
380 |
} |
|
381 |
||
382 |
// --------------------------------------------------------------------------- |
|
383 |
// From class MFsTreeItemVisualizer. |
|
384 |
// Returns the size of an item in expanded state. |
|
385 |
// --------------------------------------------------------------------------- |
|
386 |
// |
|
387 |
TSize CFsTreeNodeVisualizerBase::ExtendedSize() const |
|
388 |
{ |
|
389 |
FUNC_LOG; |
|
390 |
if ( iFlags & KFsTreeListItemManagedLayout ) |
|
391 |
{ |
|
392 |
CFsLayoutManager::TFsLayoutMetrics extendedSizeMetrics( CFsLayoutManager::EFsLmListMediumLineX2 ); |
|
393 |
TRect parentLayoutRect(0,0,0,0); |
|
394 |
TSize extSize(0,0); |
|
395 |
TBool retVal(EFalse); |
|
396 |
||
397 |
retVal = CFsLayoutManager::LayoutMetricsSize( |
|
398 |
parentLayoutRect, |
|
399 |
extendedSizeMetrics, |
|
400 |
extSize ); |
|
401 |
||
402 |
if ( !retVal ) |
|
403 |
{ |
|
404 |
extSize = iExtendedSize; |
|
405 |
} |
|
406 |
||
407 |
return extSize; |
|
408 |
} |
|
409 |
else |
|
410 |
{ |
|
411 |
return iExtendedSize; |
|
412 |
} |
|
413 |
} |
|
414 |
||
415 |
// --------------------------------------------------------------------------- |
|
416 |
// From class MFsTreeItemVisualizer. |
|
417 |
// Sets visualized item's state to hidden/visible. |
|
418 |
// --------------------------------------------------------------------------- |
|
419 |
// |
|
420 |
void CFsTreeNodeVisualizerBase::SetHidden( TBool aFlag ) |
|
421 |
{ |
|
422 |
FUNC_LOG; |
|
423 |
if ( aFlag ) |
|
424 |
{ |
|
425 |
iFlags |= KFsTreeListItemHidden; |
|
426 |
} |
|
427 |
else |
|
428 |
{ |
|
429 |
iFlags &= ~KFsTreeListItemHidden; |
|
430 |
} |
|
431 |
} |
|
432 |
||
433 |
// --------------------------------------------------------------------------- |
|
434 |
// From class MFsTreeItemVisualizer. |
|
435 |
// Returns an information if the item is hidden or not. |
|
436 |
// --------------------------------------------------------------------------- |
|
437 |
// |
|
438 |
TBool CFsTreeNodeVisualizerBase::IsHidden() |
|
439 |
{ |
|
440 |
FUNC_LOG; |
|
441 |
return iFlags & KFsTreeListItemHidden ? ETrue : EFalse; |
|
442 |
} |
|
443 |
||
444 |
// --------------------------------------------------------------------------- |
|
445 |
// From MFsTreeItemVisualizer. |
|
446 |
// Enables or disables text shadow. |
|
447 |
// --------------------------------------------------------------------------- |
|
448 |
// |
|
449 |
void CFsTreeNodeVisualizerBase::EnableTextShadow( |
|
450 |
const TBool aShadowOn ) |
|
451 |
{ |
|
452 |
FUNC_LOG; |
|
453 |
if (aShadowOn) |
|
454 |
{ |
|
455 |
iFlags |= KFsTreeListItemTextShadow; |
|
456 |
} |
|
457 |
else |
|
458 |
{ |
|
459 |
iFlags &= ~KFsTreeListItemTextShadow; |
|
460 |
} |
|
461 |
} |
|
462 |
||
463 |
// --------------------------------------------------------------------------- |
|
464 |
// From class MFsTreeItemVisualizer. |
|
465 |
// Sets text indentation. |
|
466 |
// --------------------------------------------------------------------------- |
|
467 |
void CFsTreeNodeVisualizerBase::SetIndentation( |
|
468 |
const TInt aIndentation ) |
|
469 |
{ |
|
470 |
FUNC_LOG; |
|
471 |
iTextIndentation = aIndentation; |
|
472 |
} |
|
473 |
||
474 |
||
475 |
// --------------------------------------------------------------------------- |
|
476 |
// From MFsTreeItemVisualizer. |
|
477 |
// Sets item background color. |
|
478 |
// --------------------------------------------------------------------------- |
|
479 |
// |
|
480 |
void CFsTreeNodeVisualizerBase::SetBackgroundColor(const TRgb aColor) |
|
481 |
{ |
|
482 |
FUNC_LOG; |
|
483 |
iBackgroundColor = aColor; |
|
484 |
iBackgroundState = EFsNodeBackgroundColor; |
|
485 |
} |
|
486 |
||
487 |
// --------------------------------------------------------------------------- |
|
488 |
// From MFsTreeItemVisualizer. |
|
489 |
// Returns background color if it's set. |
|
490 |
// --------------------------------------------------------------------------- |
|
491 |
// |
|
492 |
TBool CFsTreeNodeVisualizerBase::GetBackgroundColor( TRgb& aColor ) |
|
493 |
{ |
|
494 |
FUNC_LOG; |
|
495 |
TBool retVal(EFalse); |
|
496 |
||
497 |
if ( iBackgroundState == EFsNodeBackgroundColor ) |
|
498 |
{ |
|
499 |
aColor = iBackgroundColor; |
|
500 |
retVal = ETrue; |
|
501 |
} |
|
502 |
return retVal; |
|
503 |
} |
|
504 |
||
505 |
// --------------------------------------------------------------------------- |
|
506 |
// From MFsTreeItemVisualizer. |
|
507 |
// Sets item background texture. |
|
508 |
// --------------------------------------------------------------------------- |
|
509 |
// |
|
510 |
void CFsTreeNodeVisualizerBase::SetBackgroundTexture( |
|
511 |
const CAlfTexture& aTexture) |
|
512 |
{ |
|
513 |
FUNC_LOG; |
|
514 |
iBackgroundTexture = &aTexture; |
|
515 |
iBackgroundState = EFsNodeBackgroundTexture; |
|
516 |
} |
|
517 |
||
518 |
// --------------------------------------------------------------------------- |
|
519 |
// From MFsTreeItemVisualizer. |
|
520 |
// Returns background texture if it's set. |
|
521 |
// --------------------------------------------------------------------------- |
|
522 |
// |
|
523 |
TBool CFsTreeNodeVisualizerBase::GetBackgroundTexture( const CAlfTexture*& aTexture ) |
|
524 |
{ |
|
525 |
FUNC_LOG; |
|
526 |
TBool retVal(EFalse); |
|
527 |
if ( iBackgroundState == EFsNodeBackgroundTexture ) |
|
528 |
{ |
|
529 |
aTexture = iBackgroundTexture; |
|
530 |
retVal = ETrue; |
|
531 |
} |
|
532 |
return retVal; |
|
533 |
} |
|
534 |
||
535 |
// --------------------------------------------------------------------------- |
|
536 |
// From MFsTreeItemVisualizer. |
|
537 |
// Sets item background brush. |
|
538 |
// --------------------------------------------------------------------------- |
|
539 |
// |
|
540 |
void CFsTreeNodeVisualizerBase::SetBackgroundBrush( CAlfBrush* aBrush ) |
|
541 |
{ |
|
542 |
FUNC_LOG; |
|
543 |
iBackgroundBrush = aBrush; |
|
544 |
iBackgroundState = EFsNodeBackgroundBrush; |
|
545 |
} |
|
546 |
||
547 |
// --------------------------------------------------------------------------- |
|
548 |
// From MFsTreeItemVisualizer. |
|
549 |
// Returns item background brush and opacity. |
|
550 |
// --------------------------------------------------------------------------- |
|
551 |
// |
|
552 |
TBool CFsTreeNodeVisualizerBase::GetBackgroundBrush( CAlfBrush*& aBrush ) |
|
553 |
{ |
|
554 |
FUNC_LOG; |
|
555 |
TBool retVal( EFalse ); |
|
556 |
if ( iBackgroundState == EFsNodeBackgroundBrush && iBackgroundBrush ) |
|
557 |
{ |
|
558 |
aBrush = iBackgroundBrush; |
|
559 |
retVal = ETrue; |
|
560 |
} |
|
561 |
||
562 |
return retVal; |
|
563 |
} |
|
564 |
||
565 |
// --------------------------------------------------------------------------- |
|
566 |
// From MFsTreeItemVisualizer. |
|
567 |
// Clears item background. |
|
568 |
// --------------------------------------------------------------------------- |
|
569 |
// |
|
570 |
void CFsTreeNodeVisualizerBase::ClearBackground( ) |
|
571 |
{ |
|
572 |
FUNC_LOG; |
|
573 |
iBackgroundState = EFsNodeBackgroundNone; |
|
574 |
} |
|
575 |
||
576 |
// --------------------------------------------------------------------------- |
|
577 |
// Returns reference to the item's main layout |
|
578 |
// --------------------------------------------------------------------------- |
|
579 |
// |
|
580 |
CAlfLayout& CFsTreeNodeVisualizerBase::Layout() const |
|
581 |
{ |
|
582 |
FUNC_LOG; |
|
583 |
return (static_cast<CAlfLayout&>(*iLayout)); |
|
584 |
} |
|
585 |
||
586 |
// --------------------------------------------------------------------------- |
|
587 |
// Sets menu for item |
|
588 |
// --------------------------------------------------------------------------- |
|
589 |
// |
|
590 |
void CFsTreeNodeVisualizerBase::SetMenu( CFsTreeList* aMenu ) |
|
591 |
{ |
|
592 |
FUNC_LOG; |
|
593 |
iMenu = aMenu; |
|
594 |
iFlags |= KFsTreeListItemHasMenu; |
|
595 |
} |
|
596 |
||
597 |
// --------------------------------------------------------------------------- |
|
598 |
// Returns CFsTreeList object contaning menu items |
|
599 |
// --------------------------------------------------------------------------- |
|
600 |
// |
|
601 |
CFsTreeList* CFsTreeNodeVisualizerBase::Menu() const |
|
602 |
{ |
|
603 |
FUNC_LOG; |
|
604 |
return iMenu; |
|
605 |
} |
|
606 |
||
607 |
// --------------------------------------------------------------------------- |
|
608 |
// This functions sets wether an item should always be in extended state. |
|
609 |
// --------------------------------------------------------------------------- |
|
610 |
// |
|
611 |
void CFsTreeNodeVisualizerBase::SetAlwaysExtended( TBool aAlwaysExtended ) |
|
612 |
{ |
|
613 |
FUNC_LOG; |
|
614 |
if ( aAlwaysExtended ) |
|
615 |
{ |
|
616 |
iFlags |= KFsTreeListItemAlwaysExtended; |
|
617 |
} |
|
618 |
else |
|
619 |
{ |
|
620 |
iFlags &= ~KFsTreeListItemAlwaysExtended; |
|
621 |
} |
|
622 |
} |
|
623 |
||
624 |
// --------------------------------------------------------------------------- |
|
73
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
625 |
// |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
626 |
// --------------------------------------------------------------------------- |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
627 |
// |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
628 |
void CFsTreeNodeVisualizerBase::SetMarkingMode( TBool aMarkingMode ) |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
629 |
{ |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
630 |
FUNC_LOG; |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
631 |
if ( aMarkingMode ) |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
632 |
{ |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
633 |
iFlags |= KFsTreeListMarkingMode; |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
634 |
} |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
635 |
else |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
636 |
{ |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
637 |
aMarkingMode &= ~KFsTreeListMarkingMode; |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
638 |
} |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
639 |
} |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
640 |
|
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
641 |
// --------------------------------------------------------------------------- |
64 | 642 |
// This function returns wether an item is always in extended state. |
643 |
// --------------------------------------------------------------------------- |
|
644 |
// |
|
645 |
TBool CFsTreeNodeVisualizerBase::IsAlwaysExtended( ) const |
|
646 |
{ |
|
647 |
FUNC_LOG; |
|
648 |
return iFlags & KFsTreeListItemAlwaysExtended ? ETrue : EFalse; |
|
649 |
} |
|
650 |
||
651 |
||
652 |
// --------------------------------------------------------------------------- |
|
653 |
// From class MFsTreeItemVisualizer. |
|
654 |
// A call to this function means that the visualization of empty root |
|
655 |
// becomes visible and should draw itself within specified parent layout. |
|
656 |
// --------------------------------------------------------------------------- |
|
657 |
// |
|
658 |
void CFsTreeNodeVisualizerBase::ShowL( CAlfLayout& /*aParentLayout*/, |
|
659 |
const TUint /*aTimeout*/ ) |
|
660 |
{ |
|
661 |
FUNC_LOG; |
|
662 |
} |
|
663 |
||
664 |
// --------------------------------------------------------------------------- |
|
665 |
// From class MFsTreeItemVisualizer. |
|
666 |
// Stub. |
|
667 |
// --------------------------------------------------------------------------- |
|
668 |
// |
|
669 |
void CFsTreeNodeVisualizerBase::UpdateL( const MFsTreeItemData& /*aData*/, |
|
670 |
TBool /*aFocused*/, |
|
671 |
const TUint /*aLevel*/, |
|
73
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
672 |
CAlfTexture*& /*aMarkIconOn*/, |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
673 |
CAlfTexture*& /*aMarkIconOff*/, |
64 | 674 |
CAlfTexture*& /*aMenuIcon*/, |
675 |
const TUint /*aTimeout*/, |
|
676 |
TBool /*aUpdateData*/) |
|
677 |
{ |
|
678 |
FUNC_LOG; |
|
679 |
} |
|
680 |
||
681 |
// --------------------------------------------------------------------------- |
|
682 |
// From class MFsTreeItemVisualizer. |
|
683 |
// Stub. |
|
684 |
// --------------------------------------------------------------------------- |
|
685 |
// |
|
686 |
void CFsTreeNodeVisualizerBase::Hide( const TInt /*aTimeout*/ ) |
|
687 |
{ |
|
688 |
FUNC_LOG; |
|
689 |
} |
|
690 |
||
691 |
||
692 |
// --------------------------------------------------------------------------- |
|
693 |
// From class MFsTreeItemVisualizer. |
|
694 |
// Stub. |
|
695 |
// --------------------------------------------------------------------------- |
|
696 |
// |
|
697 |
void CFsTreeNodeVisualizerBase::MarqueeL(const TFsTextMarqueeType /*aMarqueeType*/, |
|
698 |
const TUint /*aMarqueeSpeed*/, |
|
699 |
const TInt /*aMarqueeStartDelay*/, |
|
700 |
const TInt /*aMarqueeCycleStartDelay*/, |
|
701 |
const TInt /*aMarqueeRepetitions*/) |
|
702 |
{ |
|
703 |
FUNC_LOG; |
|
704 |
} |
|
705 |
||
706 |
||
707 |
// --------------------------------------------------------------------------- |
|
708 |
// From MAlfEventHandler. Stub. |
|
709 |
// --------------------------------------------------------------------------- |
|
710 |
// |
|
711 |
TBool CFsTreeNodeVisualizerBase::OfferEventL(const TAlfEvent& /*aEvent*/) |
|
712 |
{ |
|
713 |
FUNC_LOG; |
|
714 |
return EFalse; |
|
715 |
} |
|
716 |
||
717 |
||
718 |
// --------------------------------------------------------------------------- |
|
719 |
// Sets the text style manager for the item visualizer. |
|
720 |
// --------------------------------------------------------------------------- |
|
721 |
// |
|
722 |
void CFsTreeNodeVisualizerBase::SetTextStyleManager( |
|
723 |
CFsAlfTextStyleManager& aManager ) |
|
724 |
{ |
|
725 |
FUNC_LOG; |
|
726 |
iTextStyleManager = &aManager; |
|
727 |
} |
|
728 |
||
729 |
||
730 |
// --------------------------------------------------------------------------- |
|
731 |
// Sets the text stroke weight for the item visualizer. |
|
732 |
// --------------------------------------------------------------------------- |
|
733 |
// |
|
734 |
void CFsTreeNodeVisualizerBase::SetTextBold( const TBool aIsBold ) |
|
735 |
{ |
|
736 |
FUNC_LOG; |
|
737 |
if (aIsBold) |
|
738 |
{ |
|
739 |
iFlags |= KFsTreeListItemTextBold; |
|
740 |
} |
|
741 |
else |
|
742 |
{ |
|
743 |
iFlags &= ~KFsTreeListItemTextBold; |
|
744 |
} |
|
745 |
} |
|
746 |
||
747 |
||
748 |
// --------------------------------------------------------------------------- |
|
749 |
// Gets the text stroke weight for the item visualizer. |
|
750 |
// --------------------------------------------------------------------------- |
|
751 |
// |
|
752 |
TBool CFsTreeNodeVisualizerBase::IsTextBold( ) const |
|
753 |
{ |
|
754 |
FUNC_LOG; |
|
755 |
return iFlags & KFsTreeListItemTextBold; |
|
756 |
} |
|
757 |
||
758 |
||
759 |
// --------------------------------------------------------------------------- |
|
760 |
// Function gets text color for a focused item. The color is taken from the |
|
761 |
// skin if skin support is on, if not then a default value is used. |
|
762 |
// --------------------------------------------------------------------------- |
|
763 |
// |
|
764 |
TRgb CFsTreeNodeVisualizerBase::FocusedStateTextSkinColor( ) |
|
765 |
{ |
|
766 |
FUNC_LOG; |
|
767 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
768 |
TRgb textColor; |
|
769 |
// First try to get the FS specific text color |
|
770 |
if( AknsUtils::GetCachedColor( skin, textColor, |
|
771 |
KAknsIIDFsHighlightColors, EAknsCIFsHighlightColorsCG1 ) != KErrNone ) |
|
772 |
{ |
|
773 |
// If FS specific text color not found, try to get the |
|
774 |
// normal Avkon list highlight text color |
|
775 |
if( AknsUtils::GetCachedColor( skin, textColor, |
|
776 |
KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 ) != KErrNone ) |
|
777 |
{ |
|
778 |
textColor = KRgbBlack; |
|
779 |
} |
|
780 |
} |
|
781 |
return textColor; |
|
782 |
} |
|
783 |
||
784 |
// --------------------------------------------------------------------------- |
|
785 |
// Function gets text color for a non focused item. The color is taken from |
|
786 |
// the skin if skin support is on, if not then a default value is used. |
|
787 |
// --------------------------------------------------------------------------- |
|
788 |
// |
|
789 |
TRgb CFsTreeNodeVisualizerBase::NormalStateTextSkinColor( ) |
|
790 |
{ |
|
791 |
FUNC_LOG; |
|
792 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
793 |
TRgb textColor; |
|
794 |
if ( AknsUtils::GetCachedColor( skin, textColor, |
|
795 |
KAknsIIDFsTextColors, EAknsCIFsTextColorsCG3 ) != KErrNone ) |
|
796 |
{ |
|
797 |
textColor = KRgbBlack; |
|
798 |
} |
|
799 |
return textColor; |
|
800 |
} |
|
801 |
||
802 |
// --------------------------------------------------------------------------- |
|
803 |
// Returns horizontal alignment of the displayed text in respect to current layout. |
|
804 |
// --------------------------------------------------------------------------- |
|
805 |
// |
|
806 |
TAlfAlignHorizontal CFsTreeNodeVisualizerBase::CurrentTextAlignmentL( TAlfAlignHorizontal aAlignment, |
|
807 |
TDesC* aText, |
|
808 |
CAlfTextVisual* aVisual) |
|
809 |
{ |
|
810 |
FUNC_LOG; |
|
811 |
TAlfAlignHorizontal align (aAlignment); |
|
812 |
TBool isMirrored( EFalse ); |
|
813 |
||
814 |
isMirrored = CFsLayoutManager::IsMirrored(); |
|
815 |
||
816 |
if ( align == EAlfAlignHLocale ) |
|
817 |
{ |
|
818 |
if ( aText && aVisual ) |
|
819 |
{ |
|
820 |
TInt textWidth(0), visualWidth(0); |
|
821 |
textWidth = aVisual->SubstringExtents(0, aVisual->Text().Length()).Width(); |
|
822 |
visualWidth = aVisual->Size().Target().iX; |
|
823 |
||
824 |
if ( textWidth >= visualWidth ) |
|
825 |
{ |
|
826 |
TBool found(EFalse); |
|
827 |
TBidiText * bidiText = TBidiText::NewL(aText->Length() + 1, 1); |
|
828 |
TBidiText::TDirectionality direction = bidiText->TextDirectionality( *aText, &found ); |
|
829 |
delete bidiText; |
|
830 |
if ( direction == TBidiText::ELeftToRight ) |
|
831 |
{ |
|
832 |
align = EAlfAlignHLeft; |
|
833 |
} |
|
834 |
else |
|
835 |
{ //direction == TBidiText::ERightToLeft |
|
836 |
align = EAlfAlignHRight; |
|
837 |
} |
|
838 |
} |
|
839 |
else |
|
840 |
{ |
|
841 |
if ( isMirrored ) |
|
842 |
{ |
|
843 |
align = EAlfAlignHRight; |
|
844 |
} |
|
845 |
else |
|
846 |
{ |
|
847 |
align = EAlfAlignHLeft; |
|
848 |
} |
|
849 |
} |
|
850 |
} |
|
851 |
} |
|
852 |
else if ( isMirrored ) |
|
853 |
{//convert left <-> right in mirrored layout |
|
854 |
if ( align == EAlfAlignHLeft ) |
|
855 |
{ |
|
856 |
align = EAlfAlignHRight; |
|
857 |
} |
|
858 |
else if ( align == EAlfAlignHRight ) |
|
859 |
{ |
|
860 |
align = EAlfAlignHLeft; |
|
861 |
} |
|
862 |
} |
|
863 |
||
864 |
return align; |
|
865 |
} |
|
866 |
||
867 |
||
868 |
// --------------------------------------------------------------------------- |
|
869 |
// Returns text style id used in the node. |
|
870 |
// --------------------------------------------------------------------------- |
|
871 |
// |
|
872 |
TInt CFsTreeNodeVisualizerBase::ModifiedStyleIdL( ) const |
|
873 |
{ |
|
874 |
FUNC_LOG; |
|
875 |
TInt styleId(iTextStyleId); |
|
876 |
TCharFormat charFormat; |
|
877 |
||
878 |
if ( iIsCustomTextStyle ) |
|
879 |
{ |
|
880 |
CAlfTextStyle* textStyle( iOwnerControl.Env().TextStyleManager().TextStyle( styleId ) ); |
|
881 |
HBufC* name = textStyle->TypefaceNameL(); |
|
882 |
charFormat.iFontSpec.iTypeface.iName = name->Left( KMaxTypefaceNameLength ); |
|
883 |
delete name; |
|
884 |
||
885 |
charFormat.iFontSpec.iHeight = textStyle->TextSizeInTwips(); |
|
886 |
charFormat.iFontPresentation.iTextColor = textStyle->TextColor(); |
|
887 |
||
888 |
charFormat.iFontPresentation.iStrikethrough = textStyle->IsStrikeThrough() ? EStrikethroughOn : EStrikethroughOff; |
|
889 |
charFormat.iFontPresentation.iUnderline = textStyle->IsUnderline() ? EUnderlineOn : EUnderlineOff; |
|
890 |
||
891 |
} |
|
892 |
else |
|
893 |
{ |
|
894 |
TRect parentRect( Size() ); |
|
895 |
CFsLayoutManager::TFsText text; |
|
896 |
||
897 |
CFsLayoutManager::LayoutMetricsText( parentRect,CFsLayoutManager::EFsLmListMediumLineT3T1, text, 0 ); |
|
898 |
||
899 |
charFormat.iFontSpec = text.iFont->FontSpecInTwips(); |
|
900 |
} |
|
901 |
||
902 |
||
903 |
TBool isBold(EFalse); |
|
904 |
isBold = iFlags & KFsTreeListItemTextBold; |
|
905 |
if ( isBold ) |
|
906 |
{ |
|
907 |
charFormat.iFontSpec.iFontStyle.SetStrokeWeight( EStrokeWeightBold ); |
|
908 |
} |
|
909 |
else |
|
910 |
{ |
|
911 |
charFormat.iFontSpec.iFontStyle.SetStrokeWeight( EStrokeWeightNormal ); |
|
912 |
} |
|
913 |
||
914 |
if ( iTextStyleManager ) |
|
915 |
{ |
|
916 |
styleId = iTextStyleManager->GetStyleIDL( charFormat ); |
|
917 |
} |
|
918 |
||
919 |
return styleId; |
|
920 |
} |
|
921 |
||
922 |
||
923 |
// --------------------------------------------------------------------------- |
|
924 |
// Method to set text font height in twips. |
|
925 |
// --------------------------------------------------------------------------- |
|
926 |
// |
|
927 |
void CFsTreeNodeVisualizerBase::SetFontHeight(const TInt aHeightInTwips) |
|
928 |
{ |
|
929 |
FUNC_LOG; |
|
930 |
iFontHeight = aHeightInTwips; |
|
931 |
} |
|
932 |
||
933 |
||
934 |
// --------------------------------------------------------------------------- |
|
935 |
// Gets height of a text font in twips. |
|
936 |
// --------------------------------------------------------------------------- |
|
937 |
// |
|
938 |
TInt CFsTreeNodeVisualizerBase::FontHeight() const |
|
939 |
{ |
|
940 |
FUNC_LOG; |
|
941 |
return iFontHeight; |
|
942 |
} |
|
943 |
||
944 |
||
945 |
// --------------------------------------------------------------------------- |
|
946 |
// Method to set text font height in pixels. |
|
947 |
// --------------------------------------------------------------------------- |
|
948 |
// |
|
949 |
void CFsTreeNodeVisualizerBase::SetFontHeightInPixels(const TInt aHeightInPixels) |
|
950 |
{ |
|
951 |
FUNC_LOG; |
|
952 |
TZoomFactor devicemap(CCoeEnv::Static()->ScreenDevice()); |
|
953 |
devicemap.SetZoomFactor(TZoomFactor::EZoomOneToOne); |
|
954 |
TInt heightInTwips = devicemap.VerticalPixelsToTwips(aHeightInPixels); |
|
955 |
||
956 |
iFontHeight = heightInTwips; |
|
957 |
} |
|
958 |
||
959 |
||
960 |
// --------------------------------------------------------------------------- |
|
961 |
// Gets height of a text font in pixels. |
|
962 |
// --------------------------------------------------------------------------- |
|
963 |
// |
|
964 |
TInt CFsTreeNodeVisualizerBase::FontHeightInPixels() const |
|
965 |
{ |
|
966 |
FUNC_LOG; |
|
967 |
TZoomFactor devicemap(CCoeEnv::Static()->ScreenDevice()); |
|
968 |
devicemap.SetZoomFactor(TZoomFactor::EZoomOneToOne); |
|
969 |
||
970 |
return devicemap.VerticalTwipsToPixels(iFontHeight); |
|
971 |
} |
|
972 |
||
973 |
||
974 |
// --------------------------------------------------------------------------- |
|
975 |
// Second phase constructor. |
|
976 |
// --------------------------------------------------------------------------- |
|
977 |
// |
|
978 |
void CFsTreeNodeVisualizerBase::ConstructL( ) |
|
979 |
{ |
|
980 |
FUNC_LOG; |
|
981 |
//get default skin values |
|
982 |
iNormalTextColor = NormalStateTextSkinColor(); |
|
983 |
iFocusedTextColor = FocusedStateTextSkinColor(); |
|
984 |
} |
|
985 |
||
986 |
||
987 |
// --------------------------------------------------------------------------- |
|
988 |
// From class MFsTreeNodeVisualizer. |
|
989 |
// Sets visualized node's state to rolled/unrolled. |
|
990 |
// --------------------------------------------------------------------------- |
|
991 |
// |
|
992 |
void CFsTreeNodeVisualizerBase::SetExpanded( TBool aFlag, const MFsTreeItemData* /*aData*/ ) |
|
993 |
{ |
|
994 |
FUNC_LOG; |
|
995 |
if ( aFlag ) |
|
996 |
{ |
|
997 |
iFlags |= KFsTreeListNodeExpanded; |
|
998 |
} |
|
999 |
else |
|
1000 |
{ |
|
1001 |
iFlags &= ~KFsTreeListNodeExpanded; |
|
1002 |
} |
|
1003 |
} |
|
1004 |
||
1005 |
||
1006 |
// --------------------------------------------------------------------------- |
|
1007 |
// From class MFsTreeNodeVisualizer. |
|
1008 |
// Returns rolled/unrolled state of the node's visualization. |
|
1009 |
// --------------------------------------------------------------------------- |
|
1010 |
// |
|
1011 |
TBool CFsTreeNodeVisualizerBase::IsExpanded() const |
|
1012 |
{ |
|
1013 |
FUNC_LOG; |
|
1014 |
return iFlags & KFsTreeListNodeExpanded ? ETrue : EFalse; |
|
1015 |
} |
|
1016 |
||
1017 |
||
1018 |
// --------------------------------------------------------------------------- |
|
1019 |
// C++ constructor. |
|
1020 |
// --------------------------------------------------------------------------- |
|
1021 |
// |
|
1022 |
CFsTreeNodeVisualizerBase::CFsTreeNodeVisualizerBase( |
|
1023 |
CAlfControl& aOwnerControl) |
|
1024 |
: iOwnerControl(aOwnerControl), |
|
1025 |
iLayout(NULL), |
|
1026 |
iFlags(KFsTreeListNodeExpanded|KFsTreeListItemFocusable| |
|
1027 |
KFsTreeListItemManagedLayout), |
|
1028 |
iTextAlign( EAlfAlignHLocale ), |
|
1029 |
iTextIndentation( KFsDefaultIndentation ), |
|
1030 |
iIsCustomTextNormalColor(EFalse), |
|
1031 |
iIsCustomTextFocusedColor(EFalse), |
|
1032 |
iTextStyleId ( EAlfTextStyleNormal ), |
|
1033 |
iIsCustomTextStyle( EFalse ), |
|
1034 |
iFontHeight(0), |
|
1035 |
iBackgroundState( EFsNodeBackgroundNone ) |
|
1036 |
{ |
|
1037 |
FUNC_LOG; |
|
1038 |
||
1039 |
} |
|
1040 |
||
1041 |
// --------------------------------------------------------------------------- |
|
1042 |
// Set layouting hints |
|
1043 |
// --------------------------------------------------------------------------- |
|
1044 |
// |
|
1045 |
void CFsTreeNodeVisualizerBase::SetLayoutHints( const TUint aHints ) |
|
1046 |
{ |
|
1047 |
FUNC_LOG; |
|
1048 |
iLayoutHints |= aHints; |
|
1049 |
} |
|
1050 |
||
1051 |
// --------------------------------------------------------------------------- |
|
1052 |
// Check if hint is set |
|
1053 |
// --------------------------------------------------------------------------- |
|
1054 |
// |
|
1055 |
TBool CFsTreeNodeVisualizerBase::IsLayoutHintSet( const TLayoutHint aHint ) const |
|
1056 |
{ |
|
1057 |
FUNC_LOG; |
|
1058 |
return iLayoutHints & aHint; |
|
1059 |
} |