|
1 /* |
|
2 * Copyright (c) 2003 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: SVG Implementation header file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _INC_CSVGANIMATEELEMENTIMPL_ |
|
20 #define _INC_CSVGANIMATEELEMENTIMPL_ |
|
21 |
|
22 #include "SVGAnimationBase.h" |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 class CSvgDocumentImpl; |
|
28 |
|
29 |
|
30 /** |
|
31 * Class description goes here. |
|
32 * |
|
33 * @lib SVGEngine.lib |
|
34 * @since 1.0 |
|
35 */ |
|
36 class CSvgAnimateElementImpl : public CSvgAnimationBase |
|
37 { |
|
38 public: |
|
39 |
|
40 // Constructor/deconstructor |
|
41 |
|
42 TBool iIsInheritedAttribute; |
|
43 |
|
44 void InitAnimationL(); |
|
45 |
|
46 void Reset(MSvgEvent* aEvent); |
|
47 void DeactivateAnimation(); |
|
48 void SetToOriginalL(); |
|
49 |
|
50 // for calculation of interpolated values for viewBox animation. |
|
51 void DoViewBoxAnimProcL(MSvgTimerEvent* aEvent); |
|
52 TBool DoAnimProcL(MSvgEvent* aEvent); |
|
53 |
|
54 /** |
|
55 * Need method description |
|
56 * |
|
57 * @since 1.0 |
|
58 * @param |
|
59 * @return |
|
60 */ |
|
61 static CSvgAnimateElementImpl* NewL( const TUint8 aElemID, |
|
62 CSvgDocumentImpl* aDoc ); |
|
63 |
|
64 |
|
65 /** |
|
66 * Need method description |
|
67 * |
|
68 * @since 1.0 |
|
69 * @param |
|
70 * @return |
|
71 */ |
|
72 static CSvgAnimateElementImpl* NewLC( const TUint8 aElemID, |
|
73 CSvgDocumentImpl* aDoc ); |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 /** |
|
79 * Need method description |
|
80 * |
|
81 * @since 1.0 |
|
82 * @param |
|
83 * @return |
|
84 */ |
|
85 virtual ~CSvgAnimateElementImpl(); |
|
86 |
|
87 // Dom Reuse |
|
88 void ReInitializeAnimation(); |
|
89 |
|
90 void SetOriginalValues_DOMReuse(); |
|
91 CGfxGeneralPath* GetPathAttribute(TInt aAttributeId); |
|
92 void SetPathAttribute(TInt aAttributeId, CGfxGeneralPath* aPathHandle); |
|
93 |
|
94 protected: |
|
95 |
|
96 |
|
97 /** |
|
98 * Need method description |
|
99 * |
|
100 * @since 1.0 |
|
101 * @param |
|
102 * @return |
|
103 */ |
|
104 void ConstructL( const TUint8 aElemID ); |
|
105 |
|
106 |
|
107 |
|
108 /** |
|
109 * Need method description |
|
110 * |
|
111 * @since 1.0 |
|
112 * @param |
|
113 * @return |
|
114 */ |
|
115 CSvgAnimateElementImpl( CSvgDocumentImpl* aDoc ); |
|
116 |
|
117 |
|
118 public: |
|
119 |
|
120 /** |
|
121 * Need method description |
|
122 * |
|
123 * @since 1.0 |
|
124 * @param |
|
125 * @return |
|
126 */ |
|
127 TInt SetAttributeIntL( const TInt aNameId, const TInt32 aValue); |
|
128 /** |
|
129 * Need method description |
|
130 * |
|
131 * @since 1.0 |
|
132 * @param |
|
133 * @return |
|
134 */ |
|
135 TInt GetAttributeIntL( const TInt aNameId, TInt32& aValue ); |
|
136 /** |
|
137 * Need method description |
|
138 * |
|
139 * @since 1.0 |
|
140 * @param |
|
141 * @return |
|
142 */ |
|
143 TInt SetAttributeFloatL(const TInt aNameId, TFloatFixPt aValue ); |
|
144 /** |
|
145 * Need method description |
|
146 * |
|
147 * @since 1.0 |
|
148 * @param |
|
149 * @return |
|
150 */ |
|
151 TInt GetAttributeFloat(const TInt aNameId, TFloatFixPt& aValue ); |
|
152 |
|
153 // From MEventReceiver |
|
154 |
|
155 /** |
|
156 * Need method description |
|
157 * |
|
158 * @since 1.0 |
|
159 * @param |
|
160 * @return |
|
161 */ |
|
162 TBool ReceiveEventL( MSvgEvent* aEvent ); |
|
163 // From MEventReceiver |
|
164 |
|
165 /** |
|
166 * Need method description |
|
167 * |
|
168 * @since 1.0 |
|
169 * @param |
|
170 * @return |
|
171 */ |
|
172 void ResetReferenceElementL(); |
|
173 |
|
174 /** |
|
175 * Need method description |
|
176 * |
|
177 * @since 1.0 |
|
178 * @param |
|
179 * @return |
|
180 */ |
|
181 MXmlElement* CloneL(MXmlElement* aParentElement); |
|
182 |
|
183 /** |
|
184 * Need method description |
|
185 * |
|
186 * @since 1.0 |
|
187 * @param |
|
188 * @return |
|
189 */ |
|
190 void CopyL(CSvgAnimateElementImpl* aDestElement ); |
|
191 |
|
192 void Print( TBool aIsEncodeOn ); |
|
193 |
|
194 private: |
|
195 // From CSvgAnimationBase |
|
196 |
|
197 /** |
|
198 * Need method description |
|
199 * |
|
200 * @since 1.0 |
|
201 * @param |
|
202 * @return |
|
203 */ |
|
204 |
|
205 virtual TBool AnimProcL( MSvgTimerEvent* aEvent ); |
|
206 |
|
207 |
|
208 /** |
|
209 * Need method description |
|
210 * |
|
211 * @since 1.0 |
|
212 * @param |
|
213 * @return |
|
214 */ |
|
215 void ResetAnimationL(); |
|
216 |
|
217 // Utility method to blend between two paths and give a current path |
|
218 |
|
219 /** |
|
220 * Need method description |
|
221 * |
|
222 * @since 1.0 |
|
223 * @param |
|
224 * @return |
|
225 */ |
|
226 void BlendPathL( TInt32 aAlpha, |
|
227 CGfxGeneralPath* aFromPath, |
|
228 CGfxGeneralPath* aToPath, |
|
229 CGfxGeneralPath*& aBlendPath ); |
|
230 |
|
231 |
|
232 /** |
|
233 * Need method description |
|
234 * |
|
235 * @since 1.0 |
|
236 * @param |
|
237 * @return |
|
238 */ |
|
239 void AddPathsL( CGfxGeneralPath*& aPathResult, |
|
240 CGfxGeneralPath* aPath1 ); |
|
241 |
|
242 /** |
|
243 * Need method description |
|
244 * |
|
245 * @since 1.0 |
|
246 * @param |
|
247 * @return |
|
248 */ |
|
249 void CopyPathsL( CGfxGeneralPath*& aPathResult, |
|
250 CGfxGeneralPath* aPath1 ); |
|
251 }; |
|
252 |
|
253 |
|
254 #endif /* _INC_CSvgAnimateElementImpl_ */ |