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