|
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_CSVGRECTELEMENTIMPL_ |
|
20 #define _INC_CSVGRECTELEMENTIMPL_ |
|
21 |
|
22 #include "SVGElementImpl.h" |
|
23 #include "GfxFloatFixPt.h" |
|
24 #include "GfxRoundRectangle2D.h" |
|
25 |
|
26 |
|
27 |
|
28 class CSvgDocumentImpl; |
|
29 class TSvgFourPointRect; |
|
30 |
|
31 /** |
|
32 * Class description goes here. |
|
33 * |
|
34 * @lib SVGEngine.lib |
|
35 * @since 1.0 |
|
36 */ |
|
37 class CSvgRectElementImpl : public CSvgElementImpl |
|
38 { |
|
39 public: |
|
40 |
|
41 // Constructor/deconstructor |
|
42 |
|
43 /** |
|
44 * Need method description |
|
45 * |
|
46 * @since 1.0 |
|
47 * @param |
|
48 * @return |
|
49 */ |
|
50 static CSvgRectElementImpl*NewL( const TUint8 aElemID, |
|
51 CSvgDocumentImpl* aDoc ); |
|
52 |
|
53 /** |
|
54 * Need method description |
|
55 * |
|
56 * @since 1.0 |
|
57 * @param |
|
58 * @return |
|
59 */ |
|
60 static CSvgRectElementImpl*NewLC( const TUint8 aElemID, |
|
61 CSvgDocumentImpl* aDoc ); |
|
62 |
|
63 private: |
|
64 /** |
|
65 * Need method description |
|
66 * |
|
67 * @since 1.0 |
|
68 * @param |
|
69 * @return |
|
70 */ |
|
71 void ConstructL( const TUint8 aElemID ); |
|
72 |
|
73 |
|
74 |
|
75 public: |
|
76 |
|
77 |
|
78 /** |
|
79 * Need method description |
|
80 * |
|
81 * @since 1.0 |
|
82 * @param |
|
83 * @return |
|
84 */ |
|
85 virtual ~CSvgRectElementImpl(); |
|
86 |
|
87 // From SVG DOM |
|
88 |
|
89 |
|
90 /** |
|
91 * Need method description |
|
92 * |
|
93 * @since 1.0 |
|
94 * @param |
|
95 * @return |
|
96 */ |
|
97 TFloatFixPt X(); |
|
98 |
|
99 |
|
100 /** |
|
101 * Need method description |
|
102 * |
|
103 * @since 1.0 |
|
104 * @param |
|
105 * @return |
|
106 */ |
|
107 TFloatFixPt Y(); |
|
108 |
|
109 |
|
110 /** |
|
111 * Need method description |
|
112 * |
|
113 * @since 1.0 |
|
114 * @param |
|
115 * @return |
|
116 */ |
|
117 TFloatFixPt Width(); |
|
118 |
|
119 |
|
120 /** |
|
121 * Need method description |
|
122 * |
|
123 * @since 1.0 |
|
124 * @param |
|
125 * @return |
|
126 */ |
|
127 TFloatFixPt Height(); |
|
128 |
|
129 |
|
130 /** |
|
131 * Need method description |
|
132 * |
|
133 * @since 1.0 |
|
134 * @param |
|
135 * @return |
|
136 */ |
|
137 TFloatFixPt Rx(); |
|
138 |
|
139 |
|
140 /** |
|
141 * Need method description |
|
142 * |
|
143 * @since 1.0 |
|
144 * @param |
|
145 * @return |
|
146 */ |
|
147 TFloatFixPt Ry(); |
|
148 |
|
149 // SVG Implementation |
|
150 |
|
151 |
|
152 /** |
|
153 * Need method description |
|
154 * |
|
155 * @since 1.0 |
|
156 * @param |
|
157 * @return |
|
158 */ |
|
159 TInt GetAttributeFloat( const TInt aNameId, |
|
160 TFloatFixPt& aValue ); |
|
161 |
|
162 /** |
|
163 * Need method description |
|
164 * |
|
165 * @since 1.0 |
|
166 * @param |
|
167 * @return |
|
168 */ |
|
169 TInt SetAttributeFloatL( const TInt aNameId, |
|
170 const TFloatFixPt aValue ); |
|
171 |
|
172 // From MXmlElement API |
|
173 |
|
174 |
|
175 /** |
|
176 * Need method description |
|
177 * |
|
178 * @since 1.0 |
|
179 * @param |
|
180 * @return |
|
181 */ |
|
182 TInt SetAttributeL( const TDesC& aName, |
|
183 const TDesC& aValue ); |
|
184 |
|
185 |
|
186 |
|
187 |
|
188 /** |
|
189 * Need method description |
|
190 * |
|
191 * @since 1.0 |
|
192 * @param |
|
193 * @return |
|
194 */ |
|
195 TBool DrawL( CGfx2dGc* aGc, |
|
196 CSvgElementImpl* aElement ); |
|
197 |
|
198 |
|
199 /** |
|
200 * Need method description |
|
201 * |
|
202 * @since 1.0 |
|
203 * @param |
|
204 * @return |
|
205 */ |
|
206 void GetBBox( TGfxRectangle2D& aBbox ); |
|
207 |
|
208 void GetFourPointBBox( TSvgFourPointRect& aFourPointBBox); |
|
209 /** |
|
210 * Need method description |
|
211 * |
|
212 * @since 1.0 |
|
213 * @param |
|
214 * @return |
|
215 */ |
|
216 virtual void GetUnscaledBBox( TGfxRectangle2D& /*aBbox*/ ); |
|
217 |
|
218 /** |
|
219 * Need method description |
|
220 * |
|
221 * @since 1.0 |
|
222 * @param |
|
223 * @return |
|
224 */ |
|
225 void SetRectValues(TFloatFixPt aX, TFloatFixPt aY, TFloatFixPt aWidth, TFloatFixPt aHeight); |
|
226 |
|
227 /** |
|
228 * Return wether an svg element is displayable, such as <rect>, <circle>, or |
|
229 * an abstract element, such as <g>, <animate>. |
|
230 * |
|
231 * @since 1.0 |
|
232 * @param None |
|
233 * @return ETrue if element is viewable. |
|
234 */ |
|
235 TBool IsViewable() { return ETrue; } |
|
236 |
|
237 private: |
|
238 |
|
239 TGfxRoundRectangle2D iRectangle; |
|
240 |
|
241 |
|
242 |
|
243 /** |
|
244 * Need method description |
|
245 * |
|
246 * @since 1.0 |
|
247 * @param |
|
248 * @return |
|
249 */ |
|
250 CSvgRectElementImpl( CSvgDocumentImpl* aDoc ); |
|
251 |
|
252 public: |
|
253 |
|
254 /** |
|
255 * Need method description |
|
256 * |
|
257 * @since 1.0 |
|
258 * @param |
|
259 * @return |
|
260 */ |
|
261 MXmlElement* CloneL(MXmlElement* aParentElement); |
|
262 |
|
263 void Print( TBool aIsEncodeOn ); |
|
264 |
|
265 protected: |
|
266 |
|
267 /** |
|
268 * Need method description |
|
269 * |
|
270 * @since 1.0 |
|
271 * @param |
|
272 * @return |
|
273 */ |
|
274 void CopyL( CSvgRectElementImpl* aDestElement ); |
|
275 |
|
276 }; |
|
277 |
|
278 #endif /* _INC_CSVGLINEELEMENT_3C61A6080051_INCLUDED */ |