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: A visualizer for data items with plain text. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef C_FSTREEPLAINONELINEITEMVISUALIZER_H |
|
20 |
#define C_FSTREEPLAINONELINEITEMVISUALIZER_H |
|
21 |
||
22 |
#include <e32base.h> |
|
23 |
#include <alf/alfeventhandler.h> |
|
24 |
#include "fstreeitemvisualizerbase.h" |
|
25 |
||
26 |
class CAlfViewportLayout; |
|
27 |
class CAlfTextVisual; |
|
28 |
class CAlfImageVisual; |
|
29 |
||
30 |
class CFsTreePlainOneLineItemData; |
|
31 |
class TFsMarqueeClet; |
|
32 |
||
33 |
/** |
|
34 |
* CFsTreePlainItemVisualizer is a visualizer for data items with plain text. |
|
35 |
* |
|
36 |
* Thic class is a concrete implementation for the MFsTreeItemVisualizer |
|
37 |
* interface. It provides visualization for data items with plain text. |
|
38 |
* |
|
39 |
* @code |
|
40 |
* |
|
41 |
* @endcode |
|
42 |
* |
|
43 |
* @lib |
|
44 |
*/ |
|
45 |
NONSHARABLE_CLASS( CFsTreePlainOneLineItemVisualizer ): |
|
46 |
public CFsTreeItemVisualizerBase |
|
47 |
{ |
|
48 |
public: |
|
49 |
||
50 |
/** |
|
51 |
* Two-phased constructor |
|
52 |
* |
|
53 |
* @param aOwnerControl Owner control. |
|
54 |
*/ |
|
55 |
IMPORT_C static CFsTreePlainOneLineItemVisualizer* NewL( |
|
56 |
CAlfControl& aOwnerControl ); |
|
57 |
||
58 |
/** |
|
59 |
* C++ destructor |
|
60 |
*/ |
|
61 |
virtual ~CFsTreePlainOneLineItemVisualizer(); |
|
62 |
||
63 |
public: |
|
64 |
||
65 |
// from base class MFsTreeItemVisualizer |
|
66 |
||
67 |
/** |
|
68 |
* From MFsTreeItemVisualizer. |
|
69 |
* Returns the type of the item's visualizer. |
|
70 |
*/ |
|
71 |
virtual TFsTreeItemVisualizerType Type() const; |
|
72 |
||
73 |
||
74 |
/** |
|
75 |
* From MFsTreeItemVisualizer. |
|
76 |
* A call to this function means that the item is requested to draw itself |
|
77 |
* within specified parent layout. Data to be visualized is passed as an |
|
78 |
* argument. |
|
79 |
* |
|
80 |
* Parameter descriptions will be added when the final function prototype |
|
81 |
* is ready. |
|
82 |
*/ |
|
83 |
virtual void ShowL( CAlfLayout& aParentLayout, |
|
84 |
const TUint aTimeout = 0 ); |
|
85 |
||
86 |
/** |
|
87 |
* A call to this function means that the item is requested to update its |
|
88 |
* visual content. |
|
89 |
*/ |
|
90 |
virtual void UpdateL( const MFsTreeItemData& aData, |
|
91 |
TBool aFocused, |
|
92 |
const TUint aLevel, |
|
73
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
93 |
CAlfTexture*& aMarkOnIcon, |
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
94 |
CAlfTexture*& aMarkOffIcon, |
64 | 95 |
CAlfTexture*& aMenuIcon, |
96 |
const TUint aTimeout = 0, |
|
97 |
TBool aUpdateData = ETrue); |
|
98 |
||
99 |
/** |
|
100 |
* From MFsTreeItemVisualizer. |
|
101 |
* A call to this function means that the item goes out of the visible |
|
102 |
* items scope. The visualizer should destroy all its visuals to save |
|
103 |
* memory. |
|
104 |
*/ |
|
105 |
virtual void Hide( const TInt aTimeout = 0 ); |
|
106 |
||
107 |
||
108 |
/** |
|
109 |
* From MFsTreeItemVisualizer. |
|
110 |
* This method marquees the text in tree item if it is too long. |
|
111 |
* |
|
112 |
* @param aMarqueeType Type of marquee. |
|
113 |
* @param aMarqueeSpeed Speed of marquee in pixels per second. |
|
114 |
* @param aMarqueeStartDelay Marquee's start delay in miliseconds. |
|
115 |
* @param aMarqueeCycleStartDelay Marquee cycle's start delay. |
|
116 |
* @param aMarqueeRepetitions Number of marquee's cycles. |
|
117 |
*/ |
|
118 |
virtual void MarqueeL(const TFsTextMarqueeType aMarqueeType, |
|
119 |
const TUint aMarqueeSpeed, |
|
120 |
const TInt aMarqueeStartDelay, |
|
121 |
const TInt aMarqueeCycleStartDelay, |
|
122 |
const TInt aMarqueeRepetitions); |
|
123 |
||
124 |
/** |
|
125 |
* This method sets flag disable wrapping the text item. |
|
126 |
*/ |
|
127 |
virtual void OffWrapping(); |
|
128 |
||
129 |
/** |
|
130 |
* |
|
131 |
*/ |
|
132 |
virtual TBool OfferEventL(const TAlfEvent& aEvent); |
|
133 |
||
134 |
protected: |
|
135 |
||
136 |
/** |
|
137 |
* C++ constructor |
|
138 |
* |
|
139 |
* @param aOwnerControl Owner control. |
|
140 |
*/ |
|
141 |
CFsTreePlainOneLineItemVisualizer( CAlfControl& aOwnerControl ); |
|
142 |
||
143 |
/** |
|
144 |
* Second phase constructor |
|
145 |
* |
|
146 |
*/ |
|
147 |
void ConstructL( ); |
|
148 |
||
149 |
private: |
|
150 |
||
151 |
void UpdateLayout(const CFsTreePlainOneLineItemData* aData, |
|
152 |
const TInt aIndentation ); |
|
153 |
||
154 |
protected: |
|
155 |
||
156 |
/** |
|
157 |
* Viewport layouut containing text visual. Used for text marquee. |
|
158 |
* Own. |
|
159 |
*/ |
|
160 |
CAlfViewportLayout* iViewportLayout; |
|
161 |
||
162 |
/** |
|
163 |
* Text visual. |
|
164 |
* Own. |
|
165 |
*/ |
|
166 |
CAlfTextVisual* iTextVisual; |
|
167 |
||
168 |
/** |
|
169 |
* Visual for an icon. |
|
170 |
*/ |
|
171 |
CAlfImageVisual* iIconVisual; |
|
172 |
||
173 |
/** |
|
174 |
* Visual for a mark icon. |
|
175 |
*/ |
|
73
c8382f7b54ef
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
64
diff
changeset
|
176 |
CAlfImageVisual* iIconMark; |
64 | 177 |
|
178 |
/** |
|
179 |
* Visual for a menu icon. |
|
180 |
*/ |
|
181 |
CAlfImageVisual* iIconMenu; |
|
182 |
||
183 |
/** |
|
184 |
* Clet for text marquee. |
|
185 |
*/ |
|
186 |
TFsMarqueeClet* iTextMarquee; |
|
187 |
||
188 |
TBool iManualWrapper; |
|
189 |
||
190 |
}; |
|
191 |
||
192 |
#endif // C_FSTREEPLAINONELINEITEMVISUALIZER_H |