|
1 /* |
|
2 * Copyright (c) 2004 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 Engine header file |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _INC_SVGJAVAINTERFACEIMPL_ |
|
20 #define _INC_SVGJAVAINTERFACEIMPL_ |
|
21 |
|
22 #if !defined(__E32BASE_H__) |
|
23 #include <e32base.h> |
|
24 #endif |
|
25 |
|
26 #include <SVGEngineInterfaceImpl.h> |
|
27 #include <SVGListener.h> |
|
28 |
|
29 typedef int SvgEngineHandle; |
|
30 typedef int SvgDocumentHandle; |
|
31 typedef int SvgElementHandle; |
|
32 typedef int SvgSurfaceHandle; |
|
33 typedef int SvgPathHandle; |
|
34 typedef short SvgAttrType; |
|
35 |
|
36 class CSvgEngineImpl; |
|
37 class CSvgDocumentImpl; |
|
38 class CFbsBitmap; |
|
39 |
|
40 // ***************************************************/ |
|
41 //Find a way to get these values from SvgEngine and defined here in JavaInterface. |
|
42 const TInt KSvgUnknownElement = -1; |
|
43 |
|
44 const TInt KSvgSvgElement = 0; |
|
45 |
|
46 const TInt KSvgAltglyphElement = 1; |
|
47 const TInt KSvgAltglyphdefElement = 2; |
|
48 |
|
49 const TInt KSvgDefsElement = 3; |
|
50 const TInt KSvgDescElement = 4; |
|
51 |
|
52 const TInt KSvgMetadataElement = 6; |
|
53 const TInt KSvgTitleElement = 7; |
|
54 |
|
55 const TInt KSvgFontfacenameElement = 8; |
|
56 const TInt KSvgFontfacesrcElement = 9; |
|
57 const TInt KSvgFontfaceuriElement = 10; |
|
58 const TInt KSvgGElement = 11; |
|
59 const TInt KSvgGlyphrefElement = 12; |
|
60 const TInt KSvgVkernElement = 13; |
|
61 // const TInt KSvgScriptElement = 14; |
|
62 const TInt KSvgSwitchElement = 15; |
|
63 |
|
64 const TInt KSvgViewElement = 16; |
|
65 |
|
66 const TInt KSvgHkernElement = 17; |
|
67 |
|
68 const TInt KSvgAElement = 18; |
|
69 const TInt KSvgFontElement = 19; |
|
70 const TInt KSvgFontfaceElement = 20; |
|
71 const TInt KSvgGlyphElement = 21; |
|
72 const TInt KSvgImageElement = 22; |
|
73 const TInt KSvgMissingglyphElement = 23; |
|
74 const TInt KSvgStyleElement = 24; |
|
75 const TInt KSvgTextElement = 25; |
|
76 const TInt KSvgUseElement = 26; |
|
77 const TInt KSvgCircleElement = 27; |
|
78 const TInt KSvgEllipseElement = 28; |
|
79 const TInt KSvgLineElement = 29; |
|
80 const TInt KSvgPathElement = 30; |
|
81 const TInt KSvgPolygonElement = 31; |
|
82 const TInt KSvgPolylineElement = 32; |
|
83 const TInt KSvgRectElement = 33; |
|
84 const TInt KSvgAnimateElement = 34; |
|
85 const TInt KSvgAnimateColorElement = 35; |
|
86 const TInt KSvgAnimateMotionElement = 36; |
|
87 const TInt KSvgAnimateTransformElement = 37; |
|
88 const TInt KSvgSetElement = 38; |
|
89 const TInt KSvgMpathElement = 39; |
|
90 const TInt KSvgLinearGradientElement = 40; |
|
91 const TInt KSvgRadialGradientElement = 41; |
|
92 const TInt KSvgStopElement = 42; |
|
93 const TInt KSvgScriptElement = 43; |
|
94 const TInt KSvgTextAreaElement = 44; |
|
95 const TInt KSvgDiscardElement = 45; |
|
96 const TInt KSvgSolidColorElement = 46; |
|
97 const TInt KSvgAnimationElement = 47; |
|
98 const TInt KSvgVideoElement = 48; |
|
99 const TInt KSvgForeignObjectElement = 49; |
|
100 |
|
101 |
|
102 /*************************************************/ |
|
103 /*************************************************/ |
|
104 const TInt KSvgUnknownAttribute = -1; |
|
105 const TUint16 KSvgOffset =25; |
|
106 //AA: Length or number type: range is 0 to +max & set using SetAttributeFloatL |
|
107 const TUint16 KAtrTextLength = 0 + KSvgOffset; |
|
108 const TUint16 KAtrWidth = 1 + KSvgOffset; |
|
109 const TUint16 KAtrHeight = 2 + KSvgOffset; |
|
110 const TUint16 KAtrR = 3 + KSvgOffset ; |
|
111 |
|
112 |
|
113 |
|
114 const TUint8 KSvgCoordAttrStartIndex = 4 + KSvgOffset; |
|
115 const TUint16 KAtrRx = 4 + KSvgOffset; |
|
116 const TUint16 KAtrRy = 5 + KSvgOffset; |
|
117 const TUint16 KAtrHorizAdvX = 6 + KSvgOffset; |
|
118 const TUint16 KAtrHorizOriginX = 7 + KSvgOffset; |
|
119 const TUint16 KAtrHorizOriginY = 8 + KSvgOffset; |
|
120 const TUint16 KAtrAscent = 9 + KSvgOffset; |
|
121 const TUint16 KAtrDescent = 10 + KSvgOffset; |
|
122 |
|
123 const TUint16 KAtrAlphabetic = 11 + KSvgOffset; |
|
124 const TUint16 KAtrUnderlinePosition = 12 + KSvgOffset; |
|
125 const TUint16 KAtrUnderlineThickness = 13 + KSvgOffset; |
|
126 const TUint16 KAtrOverlinePosition = 14 + KSvgOffset; |
|
127 const TUint16 KAtrOverlineThickness = 15 + KSvgOffset; |
|
128 const TUint16 KAtrStrikethroughPosition = 16 + KSvgOffset; |
|
129 const TUint16 KAtrStrikethroughThickness = 17 + KSvgOffset; |
|
130 const TUint16 KAtrUnitsPerEm = 18 + KSvgOffset; |
|
131 |
|
132 const TUint16 KAtrWordSpacing = 19 + KSvgOffset; |
|
133 const TUint16 KAtrLetterSpacing = 20 + KSvgOffset; |
|
134 |
|
135 |
|
136 |
|
137 //AA: Coordinate datatype: range is -max to +max & set using SetAttributeFloatL |
|
138 const TUint16 KAtrCx = 21 + KSvgOffset; |
|
139 const TUint16 KAtrCy = 22 + KSvgOffset; |
|
140 const TUint16 KAtrY = 23 + KSvgOffset; |
|
141 const TUint16 KAtrX = 24 + KSvgOffset; |
|
142 const TUint16 KAtrY1 = 25 + KSvgOffset; |
|
143 const TUint16 KAtrY2 = 26 + KSvgOffset; |
|
144 const TUint16 KAtrX1 = 27 + KSvgOffset; |
|
145 const TUint16 KAtrX2 = 28 + KSvgOffset; |
|
146 |
|
147 const TUint8 KSvgCoordAttrEndIndex = 28 + KSvgOffset; |
|
148 const TUint8 KSvgDesAttrsIndex = 29 + KSvgOffset; |
|
149 |
|
150 |
|
151 //AA: Descriptor type set using SetAttributeDesL |
|
152 const TUint16 KAtrK = 29 + KSvgOffset; |
|
153 const TUint8 KSvgFloatAttrEndIndex = 29 + KSvgOffset; |
|
154 const TUint16 KAtrG1 = 30 + KSvgOffset; |
|
155 const TUint16 KAtrG2 = 31 + KSvgOffset; |
|
156 const TUint16 KAtrU1 = 32 + KSvgOffset; |
|
157 const TUint16 KAtrU2 = 33 + KSvgOffset; |
|
158 const TUint16 KAtrUnicode = 34 + KSvgOffset; |
|
159 const TUint16 KAtrGlyphName = 35 + KSvgOffset; |
|
160 const TUint16 KAtrLang = 36 + KSvgOffset; |
|
161 const TUint8 KSvgDesAttrEndIndex = 36 + KSvgOffset; |
|
162 |
|
163 const TUint16 KAtrTextDecoration = 37 + KSvgOffset; |
|
164 const TUint16 KAtrTextAnchor = 38 + KSvgOffset; |
|
165 const TUint16 KAtrRotate = 39 + KSvgOffset; |
|
166 const TUint16 KAtrCdata = 40 + KSvgOffset; |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 const TUint16 KAtrTransform = 41 + KSvgOffset; |
|
172 const TUint16 KAtrStyle = 42 + KSvgOffset; |
|
173 const TUint16 KAtrFill = 43 + KSvgOffset; |
|
174 const TUint16 KAtrStroke = 44 + KSvgOffset; |
|
175 const TUint16 KAtrColor = 45 + KSvgOffset; |
|
176 const TUint16 KAtrFrom = 46 + KSvgOffset; |
|
177 const TUint16 KAtrTo = 47 + KSvgOffset; |
|
178 const TUint16 KAtrBy = 48 + KSvgOffset; |
|
179 const TUint16 KAtrAttributeName = 49 + KSvgOffset; |
|
180 |
|
181 |
|
182 |
|
183 const TUint8 KSvgNotHandledAttrsIndex = 50 + KSvgOffset; |
|
184 |
|
185 const TUint16 KAtrPathLength = 50 + KSvgOffset; |
|
186 const TUint16 KAtrVersion = 51 + KSvgOffset; |
|
187 const TUint16 KAtrStrokeWidth = 52 + KSvgOffset; |
|
188 const TUint16 KAtrPoints = 53 + KSvgOffset; |
|
189 const TUint16 KAtrD = 54 + KSvgOffset; |
|
190 const TUint16 KAtrType = 55 + KSvgOffset; |
|
191 const TUint16 KAtrStopColor = 56 + KSvgOffset; |
|
192 const TUint16 KAtrFx = 57 + KSvgOffset; |
|
193 const TUint16 KAtrFy = 58 + KSvgOffset; |
|
194 |
|
195 const TUint16 KAtrOffset = 59+ KSvgOffset; |
|
196 const TUint16 KAtrSpreadMethods = 60 + KSvgOffset; |
|
197 const TUint16 KAtrGradientUnits = 61 + KSvgOffset; |
|
198 const TUint16 KAtrStopOpacity = 62 + KSvgOffset; |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 // special attributes for encoding |
|
204 const TUint16 KAtrViewBox = 63 + KSvgOffset; |
|
205 const TUint16 KAtrBaseProfile = 64 + KSvgOffset; |
|
206 const TUint16 KAtrZoomAndPan = 65 + KSvgOffset; |
|
207 const TUint16 KAtrPreserveAspectRatio = 66 + KSvgOffset; |
|
208 |
|
209 const TUint8 KSvgSVGAttrEndIndex = KAtrPreserveAspectRatio; |
|
210 |
|
211 const TUint16 KAtrId = 67 + KSvgOffset; |
|
212 const TUint16 KAtrXmlBase = 68 + KSvgOffset; |
|
213 |
|
214 const TUint8 KSvgIdAndXmlAttrEndIndex = 68 + KSvgOffset; |
|
215 |
|
216 const TUint16 KAtrXmlLang = 69 + KSvgOffset; |
|
217 const TUint16 KAtrXmlSpace = 70 + KSvgOffset; |
|
218 |
|
219 const TUint8 KSvgLangAttrEndIndex = 70 + KSvgOffset; |
|
220 |
|
221 const TUint16 KAtrRequiredExtensions = 71 + KSvgOffset; |
|
222 const TUint16 KAtrRequiredFeatures = 72 + KSvgOffset; |
|
223 const TUint16 KAtrSystemLanguage = 73 + KSvgOffset; |
|
224 |
|
225 const TUint8 KSvgTestAttrEndIndex = 73 + KSvgOffset; |
|
226 |
|
227 const TUint16 KAtrDx = 74 + KSvgOffset; |
|
228 const TUint16 KAtrDy = 75 + KSvgOffset; |
|
229 const TUint16 KAtrMedia = 76 + KSvgOffset; |
|
230 const TUint16 KAtrTitle = 77 + KSvgOffset; |
|
231 |
|
232 const TUint16 KAtrXlinkactuate = 78 + KSvgOffset; |
|
233 const TUint16 KAtrXlinkarcrole = 79 + KSvgOffset; |
|
234 |
|
235 const TUint16 KAtrXlinkrole = 80 + KSvgOffset; |
|
236 const TUint16 KAtrXlinkshow = 81 + KSvgOffset; |
|
237 const TUint16 KAtrXlinktitle = 82 + KSvgOffset; |
|
238 const TUint16 KAtrXlinktype = 83 + KSvgOffset; |
|
239 const TUint16 KAtrXlinkhref = 84 + KSvgOffset; |
|
240 |
|
241 const TUint8 KSvgUriAttrEndIndex = 84 + KSvgOffset; |
|
242 |
|
243 const TUint16 KAtrBegin = 85 + KSvgOffset; |
|
244 const TUint16 KAtrDur = 86 + KSvgOffset; |
|
245 const TUint16 KAtrRepeatCount = 87 + KSvgOffset; |
|
246 const TUint16 KAtrRepeatDur = 88 + KSvgOffset; |
|
247 const TUint16 KAtrEnd = 89 + KSvgOffset; |
|
248 const TUint16 KAtrRestart = 90 + KSvgOffset; |
|
249 const TUint16 KAtrAccumulate = 91 + KSvgOffset; |
|
250 const TUint16 KAtrAdditive = 92 + KSvgOffset; |
|
251 const TUint16 KAtrKeySplines = 93 + KSvgOffset; |
|
252 const TUint16 KAtrKeyTimes = 94 + KSvgOffset; |
|
253 const TUint16 KAtrCalcMode = 95 + KSvgOffset; |
|
254 const TUint16 KAtrPath = 96 + KSvgOffset; |
|
255 const TUint16 KAtrAnimateMotion = 97 + KSvgOffset; |
|
256 const TUint16 KAtrGradientTransform = 98 + KSvgOffset; |
|
257 const TUint16 KAtrAnimateTransformAttrId = 99 + KSvgOffset; |
|
258 const TUint16 KAtrTarget = 100 + KSvgOffset; |
|
259 |
|
260 |
|
261 |
|
262 #define KSVG_MAX_ATTRIBUTES KAtrTarget |
|
263 #define KSVG_ATTRIBUTE_NOT_SUPPORTED KSVG_MAX_ATTRIBUTES+1 |
|
264 |
|
265 // special Ids for Animation attribute Values |
|
266 |
|
267 const TUint16 KAnimFreeze = 110 + KSvgOffset; |
|
268 |
|
269 // special Id for Embedded image XLink:href attribute . |
|
270 |
|
271 const TUint16 KXlinkhrefImageEmbedded = 111 + KSvgOffset; |
|
272 |
|
273 // special Id for multiple end times.Used for the Binary compatibility of the encoder |
|
274 |
|
275 const TUint16 KMultipleEndTime = 112 + KSvgOffset; |
|
276 |
|
277 |
|
278 |
|
279 #define KSVG_ANIMATE_ELEMFLAG KAtrAttributeName |
|
280 #define KSVG_SET_ELEMFLAG KAtrAttributeName |
|
281 #define KSVG_ANIMATETRANSFORM_ELEMFLAG KAtrSVGTrf |
|
282 #define KSVG_CIRCLE_ELEMFLAG KAtrR |
|
283 #define KSVG_ELLIPSE_ELEMFLAG KAtrSVGElp |
|
284 #define KSVG_RECT_ELEMFLAG KAtrSVGRec |
|
285 #define KSVG_IMAGE_ELEMFLAG KAtrSVGRec |
|
286 #define KSVG_HKERN_ELEMFLAG KAtrK |
|
287 #define KSVG_PATH_ELEMFLAG KAtrD |
|
288 #define KSVG_POLYLINE_ELEMFLAG KAtrPoints |
|
289 #define KSVG_AMINATEMO_ELEMFLAG KAtrSVGAmo |
|
290 |
|
291 const TUint16 KAtrSVGRec = 120 + KSvgOffset; |
|
292 const TUint16 KAtrSVGElp = 121 + KSvgOffset; |
|
293 const TUint16 KAtrSVGTrf = 122 + KSvgOffset; |
|
294 const TUint16 KAtrSVGAmo = 123 + KSvgOffset; |
|
295 const TUint16 KAtrToBy = 124 + KSvgOffset; |
|
296 const TUint16 KAtrAdditiveSet = 125 + KSvgOffset; |
|
297 |
|
298 |
|
299 |
|
300 const TUint16 KTiny = 0; |
|
301 |
|
302 // Display Enumeration Constants. take care |
|
303 const TUint KDisplayEnumNone = 16; |
|
304 const TUint KPresentationAttrDisplay = 10; |
|
305 |
|
306 const TUint16 KAtrUnicodeRange = 135 + KSvgOffset; |
|
307 const TUint16 KAtrValues = 138 + KSvgOffset; |
|
308 |
|
309 |
|
310 // SPECIAL (APPLICATION DEFINED) ATTRIBUTE CONSTANTS |
|
311 const TUint16 KAtrData = KAtrD; // So KAtrData can still be used |
|
312 const TUint16 KAtrRadius = KAtrR; // So KAtrRadius can still be used |
|
313 |
|
314 const TUint16 KAtrRefX = 1001; |
|
315 const TUint16 KAtrRefY = 1002; |
|
316 const TUint16 KAtrAnimMotionMatrixIndex = 5000; |
|
317 const TUint16 KAtrAnimTransformMatrixIndex = 5001; |
|
318 |
|
319 const TInt KErrReferencedElementNotFound = -1000; |
|
320 const TInt KErrAnimateReferenceElementNotFound = -1001; |
|
321 |
|
322 // start of new element in encoding. |
|
323 const TUint16 KStartNewElem = 1000; |
|
324 |
|
325 // SVG TINY DEFINED ENUMERATIONS |
|
326 const TUint16 KEnumPercent = 0; // '%' sign |
|
327 const TUint16 KEnum100 = 1; |
|
328 const TUint16 KEnum200 = 2; |
|
329 const TUint16 KEnum300 = 3; |
|
330 const TUint16 KEnum400 = 4; |
|
331 const TUint16 KEnum500 = 5; |
|
332 const TUint16 KEnum600 = 6; |
|
333 const TUint16 KEnum700 = 7; |
|
334 const TUint16 KEnum800 = 8; |
|
335 const TUint16 KEnum900 = 9; |
|
336 const TUint16 KEnumAlways = 10; |
|
337 const TUint16 KEnumAuto = 11; |
|
338 const TUint16 KEnumBevel = 12; |
|
339 const TUint16 KEnumBlink = 13; |
|
340 const TUint16 KEnumBlock = 14; |
|
341 const TUint16 KEnumBold = 15; |
|
342 const TUint16 KEnumBolder = 16; |
|
343 const TUint16 KEnumButt = 17; |
|
344 const TUint16 KEnumCdata = 18; |
|
345 const TUint16 KEnumCm = 19; |
|
346 const TUint16 KEnumCompact = 20; |
|
347 const TUint16 KEnumCondensed = 21; |
|
348 const TUint16 KEnumCss = 22; |
|
349 const TUint16 KEnumDasharray = 23; |
|
350 const TUint16 KEnumDisable = 24; |
|
351 const TUint16 KEnumDiscrete = 25; |
|
352 const TUint16 KEnumEnd = 26; |
|
353 const TUint16 KEnumEvenodd = 27; |
|
354 const TUint16 KEnumExpanded = 28; |
|
355 const TUint16 KEnumExtraCondensed = 29; |
|
356 const TUint16 KEnumExtraExpanded = 30; |
|
357 const TUint16 KEnumFreeze = 31; |
|
358 const TUint16 KEnumHidden = 32; |
|
359 const TUint16 KEnumIn = 33; |
|
360 const TUint16 KEnumInherit = 34; |
|
361 const TUint16 KEnumInline = 35; |
|
362 const TUint16 KEnumInlineTable = 36; |
|
363 const TUint16 KEnumInterger = 37; |
|
364 const TUint16 KEnumItalic = 38; |
|
365 const TUint16 KEnumLenght = 39; |
|
366 const TUint16 KEnumLighter = 40; |
|
367 const TUint16 KEnumLinear = 41; |
|
368 const TUint16 KEnumLineThrough = 42; |
|
369 const TUint16 KEnumListItem = 43; |
|
370 const TUint16 KEnumMagnify = 44; |
|
371 const TUint16 KEnumMarker = 45; |
|
372 const TUint16 KEnumMiddle = 46; |
|
373 const TUint16 KEnumMiter = 47; |
|
374 const TUint16 KEnumMm = 48; |
|
375 const TUint16 KEnumNarrower = 49; |
|
376 const TUint16 KEnumNever = 50; |
|
377 const TUint16 KEnumNone = 51; |
|
378 const TUint16 KEnumNonzero = 52; |
|
379 const TUint16 KEnumNormal = 53; |
|
380 const TUint16 KEnumOblique = 54; |
|
381 const TUint16 KEnumOverline = 55; |
|
382 const TUint16 KEnumPaced = 56; |
|
383 const TUint16 KEnumPc = 57; |
|
384 const TUint16 KEnumPt = 58; |
|
385 const TUint16 KEnumPx = 59; |
|
386 const TUint16 KEnumRemove = 60; |
|
387 const TUint16 KEnumReplace = 61; |
|
388 const TUint16 KEnumRotate = 62; |
|
389 const TUint16 KEnumRound = 63; |
|
390 const TUint16 KEnumRunIn = 64; |
|
391 const TUint16 KEnumScale = 65; |
|
392 const TUint16 KEnumSemiCondensed = 66; |
|
393 const TUint16 KEnumSemiExpanded = 67; |
|
394 const TUint16 KEnumSkewX = 68; |
|
395 const TUint16 KEnumSkewY = 69; |
|
396 const TUint16 KEnumSpline = 70; |
|
397 const TUint16 KEnumSquare = 71; |
|
398 const TUint16 KEnumStart = 72; |
|
399 const TUint16 KEnumSum = 73; |
|
400 const TUint16 KEnumTable = 74; |
|
401 const TUint16 KEnumTableCaption = 75; |
|
402 const TUint16 KEnumTableCell = 76; |
|
403 const TUint16 KEnumTableColumn = 77; |
|
404 const TUint16 KEnumTableColumnGroup = 78; |
|
405 const TUint16 KEnumTableFooterGroup = 79; |
|
406 const TUint16 KEnumTableHeaderGroup = 80; |
|
407 const TUint16 KEnumTableRow = 81; |
|
408 const TUint16 KEnumTableRowGroup = 82; |
|
409 const TUint16 KEnumTranslate = 83; |
|
410 const TUint16 KEnumUltraCondensed = 84; |
|
411 const TUint16 KEnumUltraExpanded = 85; |
|
412 const TUint16 KEnumUnderline = 86; |
|
413 const TUint16 KEnumVisible = 87; |
|
414 const TUint16 KEnumWhenNotActive = 88; |
|
415 const TUint16 KEnumWider = 89; |
|
416 const TUint16 KEnumXMaxYMax = 90; |
|
417 const TUint16 KEnumXMaxYMid = 91; |
|
418 const TUint16 KEnumXMaxYMin = 92; |
|
419 const TUint16 KEnumXMidYMax = 93; |
|
420 const TUint16 KEnumXMidYMid = 94; |
|
421 const TUint16 KEnumXMidYMin = 95; |
|
422 const TUint16 KEnumXMinYMax = 96; |
|
423 const TUint16 KEnumXMinYMid = 97; |
|
424 const TUint16 KEnumXMinYMin = 98; |
|
425 const TUint16 KEnumXml = 99; |
|
426 |
|
427 |
|
428 #define KCSS_ATTR_FILL 0 |
|
429 #define KCSS_ATTR_STROKE 1 |
|
430 #define KCSS_ATTR_STROKEWIDTH 2 |
|
431 #define KCSS_ATTR_VISIBILITY 3 |
|
432 #define KCSS_ATTR_FONTFAMILY 4 |
|
433 #define KCSS_ATTR_FONTSIZE 5 |
|
434 #define KCSS_ATTR_FONTSTYLE 6 |
|
435 #define KCSS_ATTR_FONTWEIGHT 7 |
|
436 #define KCSS_ATTR_STROKE_DASHARRAY 8 |
|
437 #define KCSS_ATTR_DISPLAY 9 |
|
438 #define KCSS_ATTR_FILLRULE 10 |
|
439 #define KCSS_ATTR_STROKE_LINECAP 11 |
|
440 #define KCSS_ATTR_STROKE_LINEJOIN 12 |
|
441 #define KCSS_ATTR_STROKE_DASHOFFSET 13 |
|
442 #define KCSS_ATTR_STROKE_MITERLIMIT 14 |
|
443 #define KCSS_ATTR_COLOR 15 |
|
444 #define KCSS_ATTR_TEXTANCHOR 16 |
|
445 #define KCSS_ATTR_TEXTDECORATION 17 |
|
446 #define KCSS_ATTR_COLORINTERPOLATION 18 |
|
447 #define KCSS_ATTR_COLORRENDERING 19 |
|
448 #define KCSS_ATTR_LETTERSPACING 20 |
|
449 #define KCSS_ATTR_WORDSPACING 21 |
|
450 |
|
451 #define KCSS_ATTR_FILL_OPACITY 22 |
|
452 #define KCSS_ATTR_STROKE_OPACITY 23 |
|
453 #define KCSS_ATTR_FONT 24 |
|
454 /***************************************************/ |
|
455 /***************************************************/ |
|
456 const TInt KSvgTypeTransform = 30; |
|
457 const TInt KSvgTypeTranslate = 31; |
|
458 const TInt KSvgTypeRotate = 32; |
|
459 const TInt KSvgTypeScale = 33; |
|
460 const TInt KSvgTypeSkewX = 34; |
|
461 const TInt KSvgTypeSkewY = 35; |
|
462 const TInt KSvgType2DMatrix = 36; |
|
463 |
|
464 /////////////EVENT MASKS//////////////////// |
|
465 const TUint8 KSvgEventMaskNone = 0x0; |
|
466 const TUint8 KSvgEventMaskExternalUI = 0x1; |
|
467 const TUint8 KSvgEventMaskTimer = 0x2; |
|
468 const TUint8 KSvgEventMaskInternal = 0x4; |
|
469 const TUint8 KSvgEventMaskExternalSystem = 0x8; |
|
470 ////////////////////////////////////////////////// taken from event.h |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 ////////////////////////////////////////////////// taken from event.h |
|
476 // these are taken from gfxgeneralPath.h |
|
477 const TUint32 KSvgSegMoveTo = 2; |
|
478 const TUint32 KSvgSegLineTo = 4; |
|
479 const TUint32 KSvgSegQuadTo = 10; |
|
480 const TUint32 KSvgSegCubicTo = 12; |
|
481 const TUint32 KSvgSegClose = 0; |
|
482 const TUint32 KSvgHorizontal = 5; |
|
483 const TUint32 KSvgVertical = 6; |
|
484 ///////////////////////////////////////////////////// |
|
485 |
|
486 class MJavaError |
|
487 { |
|
488 public: |
|
489 /** |
|
490 * Dtor |
|
491 * @since 1.0 |
|
492 */ |
|
493 virtual ~MJavaError() |
|
494 { |
|
495 } |
|
496 |
|
497 /** |
|
498 * Determine wether an error is indicated by this object. |
|
499 * |
|
500 * @since 1.0 |
|
501 * @return : ETrue, if ErrorCode() != ESvgNoError |
|
502 */ |
|
503 virtual TBool HasError() const = 0; |
|
504 |
|
505 /** |
|
506 * Determine wether an error is only a warning. |
|
507 * This should be a state when the svg may be display, despite |
|
508 * a conflict. |
|
509 * |
|
510 * @since 1.0 |
|
511 * @return ETrue if HasError() is only a warning. |
|
512 */ |
|
513 virtual TBool IsWarning() const = 0; |
|
514 |
|
515 /** |
|
516 * Get the error code contained by this object. |
|
517 * |
|
518 * @since 1.0 |
|
519 * @return : the TSvgErrorCode value |
|
520 */ |
|
521 virtual TInt ErrorCode() const = 0; |
|
522 |
|
523 /** |
|
524 * Get the error description string for this object. |
|
525 * |
|
526 * @since 1.0 |
|
527 * @return : error description string. |
|
528 */ |
|
529 virtual TDesC8& Description() = 0; |
|
530 }; |
|
531 |
|
532 |
|
533 /** |
|
534 * This class implements the interface for a MJavaError object, which contains |
|
535 * an error code and a description of the error if one exists. |
|
536 * |
|
537 * @since 1.0 |
|
538 */ |
|
539 class CJavaError : public CBase, public MJavaError |
|
540 { |
|
541 public: |
|
542 |
|
543 /** |
|
544 * Two-phase constructor. |
|
545 * Creates an integer 'handle' from C++ object for referencing them inside Java. |
|
546 * The shift garauntees a positive integer. |
|
547 * Unhanding the integer requires the destination type to be known and bit shifting. |
|
548 * |
|
549 * @since 1.0 |
|
550 * @return : CJavaError object |
|
551 */ |
|
552 static TInt NewL( CSvgErrorImpl& aError ); |
|
553 |
|
554 /** |
|
555 * Destructor |
|
556 */ |
|
557 virtual ~CJavaError(); |
|
558 |
|
559 /** |
|
560 * Determine wether an error is indicated by this object. |
|
561 * |
|
562 * @since 1.0 |
|
563 * @return : ETrue, if ErrorCode() != ESvgNoError |
|
564 */ |
|
565 virtual TBool HasError() const; |
|
566 |
|
567 /** |
|
568 * Determine wether an error is only a warning. |
|
569 * This should be a state when the svg may be display, despite |
|
570 * a conflict. |
|
571 * |
|
572 * @since 1.0 |
|
573 * @return ETrue if HasError() is only a warning. |
|
574 */ |
|
575 virtual TBool IsWarning() const; |
|
576 |
|
577 /** |
|
578 * Get the error code contained by this object. |
|
579 * |
|
580 * @since 1.0 |
|
581 * @return : the TSvgErrorCode value |
|
582 */ |
|
583 virtual TInt ErrorCode() const; |
|
584 |
|
585 /** |
|
586 * Get the error description string for this object. |
|
587 * |
|
588 * @since 1.0 |
|
589 * @return : error description string. |
|
590 */ |
|
591 virtual TDesC8& Description(); |
|
592 |
|
593 protected: |
|
594 /** |
|
595 * Second phase of constructor |
|
596 * |
|
597 * @since 1.0 |
|
598 */ |
|
599 void ConstructL( CSvgErrorImpl& aError ); |
|
600 |
|
601 /** |
|
602 * Ctor. |
|
603 * |
|
604 * @since 1.0 |
|
605 */ |
|
606 CJavaError(); |
|
607 |
|
608 private: |
|
609 TInt iErrorCode; |
|
610 TBool iIsWarning; |
|
611 HBufC8* iDescription; |
|
612 }; |
|
613 |
|
614 // *********************************************************************** |
|
615 // SVG Engine |
|
616 // *********************************************************************** |
|
617 /** |
|
618 * The SVG Engine is fundamental object for 2D rendering. The rendering can |
|
619 * only be achieved through the render method provided by the SVG Engine object. |
|
620 * NOTE: Java MIDlet can uses multiple SVG Engine objects. |
|
621 * NOTE: Java side cannot provide the SVG Engine object for: |
|
622 * <ul> |
|
623 * <li>the SVG Document operations</li> |
|
624 * <li>the SVG Element operations</li> |
|
625 * </ul> |
|
626 */ |
|
627 |
|
628 // ***************************************************************************** |
|
629 // SVG Rendering Surface Functions |
|
630 // ***************************************************************************** |
|
631 /** |
|
632 * The SVG Rendering Surface functions are not used in java side. |
|
633 * |
|
634 |
|
635 // *********************************************************************** |
|
636 // SVG Document |
|
637 // *********************************************************************** |
|
638 /** |
|
639 * The SVG Document represents an XML Document. |
|
640 * <p>The SVG Document is a subset of the Document interface defined |
|
641 * in the <a href="http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html"> |
|
642 * DOM Level 3 Core</a>.</p> |
|
643 */ |
|
644 |
|
645 // *********************************************************************** |
|
646 // SVG Element |
|
647 // *********************************************************************** |
|
648 /** |
|
649 * Description of an SVG element in the document tree. Element's id can be set only |
|
650 * if it does not already have an id. Elements with non-null id can be inserted, but |
|
651 * <b>cannot be removed</b> from the DOM tree. |
|
652 * |
|
653 * <p> |
|
654 * An SVG element's "traits" value can be read and manipulated. Each <i>trait</i> |
|
655 * corresponds to an attribute or property,which is parsed and understood by the element |
|
656 * and in most cases animatable. Unlike attributes, each element has a |
|
657 * well-defined set of traits and attempting to access undefined trait is an error. Also unlike |
|
658 * attributes traits are typed and their values are normalized; for instance SVG path specification |
|
659 * is parsed and all path commands are converted to their absolute variants, it is not possible to |
|
660 * say through the value of the trait if a path command was absolute or relative. When getting and |
|
661 * setting trait values, accessor of the correct type must be used or exception will be thrown. |
|
662 * </p> |
|
663 * <p> |
|
664 * Initial trait values come from parsing corresponding attributes. If value is not specified, but |
|
665 * corresponing attribute (or property for environments where styling is supported) is inherited, |
|
666 * inherited value is returned as a result of the trait query method. If it is not inherited, default |
|
667 * value is returned. Default values are also returned in the case when there is no parent to inherit |
|
668 * from, for ex: when you create a new element, set a trait value to 'inherit', but there is no parent for |
|
669 * inheritance. It is important to note that the value which is returned is always a base value (i.e. before animation |
|
670 * is applied), and this is true for both static and animated content. |
|
671 * </p> |
|
672 * <p> |
|
673 * Setting a trait value has the same effect as changing a corresponding attribute, but trait |
|
674 * setters can operate on typed values. The value which is modified is always a base value. |
|
675 * For inheritable traits the trait value can always be set to "inherit" |
|
676 * (but querying the value will always return the actual inherited value as explained above). |
|
677 * </p> |
|
678 * |
|
679 * <h3>Traits supported in this specification, SVG Tiny 1.1 DOM</h3> |
|
680 * |
|
681 * <p>The table below shows the list of attributes and properties that SVG Tiny |
|
682 * DOM 1.1 implementations must support. Each light gray section lists one or |
|
683 * multiple elements for which the subsequent attributes or properties |
|
684 * apply. Each attribute row lists the allowed getter and setter (s). The last |
|
685 * column specifies the default values that must be used for each attribute or |
|
686 * property.</p> |
|
687 * <p><b>Note:</b> For 'REQUIRED' attributes, there are two cases: |
|
688 * |
|
689 * <ul> |
|
690 * <li>i) The document is in error, if this attribute was not present at the time of loading.</li> |
|
691 * <li>ii) When using uDOM API, the specified default value (in parenthesis) must be used.</li> |
|
692 * </ul> |
|
693 * </p> |
|
694 * |
|
695 * <table height="1586" cellpadding="2" cellspacing="2" border="1" |
|
696 * width="825" style="border-collapse: collapse;"> |
|
697 * <tbody> |
|
698 * <tr> |
|
699 * <th width="150" valign="top" bgcolor="#999999"><b>Property<br> |
|
700 * </b> </th> |
|
701 * <th valign="top" bgcolor="#999999"><b>Trait Getter <br>[possible return value(s)]<br> |
|
702 * </b> </th> |
|
703 * <th bgcolor="#999999" valign="top"><b>Trait Setter <br>[allowed value(s)]<br> |
|
704 * </b> </th> |
|
705 * <th bgcolor="#999999" valign="top"><b>Default Values<br> |
|
706 * </b> </th> |
|
707 * </tr> |
|
708 * <tr> |
|
709 * <td valign="top"><br> |
|
710 * </td> |
|
711 * <td valign="top"><br> |
|
712 * </td> |
|
713 * <td valign="top"><br> |
|
714 * </td> |
|
715 * <td valign="top"><br> |
|
716 * </td> |
|
717 * </tr> |
|
718 * <tr> |
|
719 * <td bgcolor="#cccccc" colspan="4" rowspan="1" valign="top"><svg>, |
|
720 * <rect>, <circle>, <ellipse>, <line>, |
|
721 * <path>, <g>, <image>, <text>, <a>, and <use></td> |
|
722 * </tr> |
|
723 * <tr> |
|
724 * <td width="150" valign="top">color <br> |
|
725 * </td> |
|
726 * <td valign="top">getRGBColorTrait [SVGRGBColor]<br> |
|
727 * </td> |
|
728 * <td valign="top">setTrait [inherit]<br>setRGBColorTrait [SVGRGBColor]<br> |
|
729 * </td> |
|
730 * <td valign="top" align="center">rgb(0,0,0)<br> |
|
731 * </td> |
|
732 * </tr> |
|
733 * <tr> |
|
734 * <td width="150" valign="top">display<br> |
|
735 * </td> |
|
736 * <td valign="top">getTrait [inline | none ] <br> |
|
737 * </td> |
|
738 * <td valign="top">setTrait [inline | none | inherit ] </td> |
|
739 * <td valign="top" align="center">"inline"<br> |
|
740 * </td> |
|
741 * </tr> |
|
742 * <tr> |
|
743 * <td width="150" valign="top">fill<br> |
|
744 * </td> |
|
745 * <td valign="top">getRGBColorTrait [null, SVGRGBColor]<br> |
|
746 * </td> |
|
747 * <td valign="top">setRGBColorTrait [SVGRGBColor]<br>setTrait(none | currentColor | inherit)<br> |
|
748 * </td> |
|
749 * <td valign="top" align="center">rgb(0,0,0)<br> |
|
750 * </td> |
|
751 * </tr> |
|
752 * <tr> |
|
753 * <td width="150" valign="top">fill-rule<br> |
|
754 * </td> |
|
755 * <td valign="top">getTrait [nonzero | evenodd] <br> |
|
756 * </td> |
|
757 * <td valign="top">setTrait [nonzero | evenodd | inherit] </td> |
|
758 * <td valign="top" align="center">"nonzero"<br> |
|
759 * </td> |
|
760 * </tr> |
|
761 * <tr> |
|
762 * <td width="150" valign="top">stroke</td> |
|
763 * <td valign="top">getRGBColorTrait [null, SVGRGBColor]</td> |
|
764 * <td valign="top">setRGBColorTrait [SVGRGBColor]<br>setTrait [none | currentColor | inherit]</td> |
|
765 * <td valign="top" align="center">"none"<br> |
|
766 * </td> |
|
767 * </tr> |
|
768 * <tr> |
|
769 * <td valign="top">stroke-dashoffset</td> |
|
770 * <td valign="top">getFloatTrait </td> |
|
771 * <td valign="top">setTrait [inherit]<br>setFloatTrait </td> |
|
772 * <td valign="top" align="center">0.0f<br> |
|
773 * </td> |
|
774 * </tr> |
|
775 * <tr> |
|
776 * <td valign="top">stroke-linecap</td> |
|
777 * <td valign="top">getTrait [butt | round | square]</td> |
|
778 * <td valign="top">setTrait [butt | round | square | inherit]</td> |
|
779 * <td valign="top" align="center">"butt"<br> |
|
780 * </td> |
|
781 * </tr> |
|
782 * <tr> |
|
783 * <td valign="top">stroke-linejoin</td> |
|
784 * <td valign="top">getTrait [miter | round | bevel ]</td> |
|
785 * <td valign="top">setTrait [miter | round | bevel | inherit]</td> |
|
786 * <td valign="top" align="center">"miter"<br> |
|
787 * </td> |
|
788 * </tr> |
|
789 * <tr> |
|
790 * <td valign="top">stroke-miterlimit</td> |
|
791 * <td valign="top">getFloatTrait [ value >= 1]</td> |
|
792 * <td valign="top">setTrait [inherit]<br>setFloatTrait [value >= 1]</td> |
|
793 * <td valign="top" align="center">4.0f<br> |
|
794 * </td> |
|
795 * </tr> |
|
796 * <tr> |
|
797 * <td valign="top">stroke-width</td> |
|
798 * <td valign="top">getFloatTrait [value >= 0]</td> |
|
799 * <td valign="top">setTrait [inherit]<br> setFloatTrait [value >= 0]</td> |
|
800 * <td valign="top" align="center">1.0f<br> |
|
801 * </td> |
|
802 * </tr> |
|
803 * <tr> |
|
804 * <td valign="top">visibility</td> |
|
805 * <td valign="top">getTrait [visible | hidden]</td> |
|
806 * <td valign="top">setTrait [visible | hidden | inherit]</td> |
|
807 * <td valign="top" align="center">"visible"<br> |
|
808 * </td> |
|
809 * </tr> |
|
810 * <tr> |
|
811 * <td valign="top"><br> |
|
812 * </td> |
|
813 * <td valign="top"><br> |
|
814 * </td> |
|
815 * <td valign="top"><br> |
|
816 * </td> |
|
817 * <td valign="top"><br> |
|
818 * </td> |
|
819 * </tr> |
|
820 * <tr> |
|
821 * <td bgcolor="#cccccc" colspan="4" rowspan="1" valign="top"><svg>, <text>, <g>, <a>, and <use>;<br> |
|
822 * </td> |
|
823 * </tr> |
|
824 * <tr> |
|
825 * <td valign="top">font-family<br> |
|
826 * </td> |
|
827 * <td valign="top">getTrait [single, computed font-family value]<br> |
|
828 * </td> |
|
829 * <td valign="top">setTrait [same syntax as font-family attribute]<br> |
|
830 * </td> |
|
831 * <td valign="top" align="center"> User-Agent <br> |
|
832 * </td> |
|
833 * </tr> |
|
834 * <tr> |
|
835 * <td width="150" valign="top">font-size<br> |
|
836 * </td> |
|
837 * <td valign="top">getFloatTrait [value >= 0]<br> |
|
838 * </td> |
|
839 * <td valign="top">setFloatTrait [value >= 0]<br>setTrait [inherit]<br> |
|
840 * </td> |
|
841 * <td valign="top" align="center"> User-Agent <br> |
|
842 * </td> </tr> |
|
843 * <tr> |
|
844 * <td width="150" valign="top">font-style<br> |
|
845 * </td> |
|
846 * <td valign="top">getTrait [normal | italic | oblique ] </td> |
|
847 * <td valign="top">setTrait [normal | italic | oblique | inherit] </td> |
|
848 * <td valign="top" align="center">"normal"<br> |
|
849 * </td> </tr> |
|
850 * <tr> |
|
851 * <td width="150" valign="top">font-weight<br> |
|
852 * </td> |
|
853 * <td valign="top">getTrait [100 | 200 | 300 <br> | 400 | 500 | 600 | 700 | 800 | 900 ] </td> |
|
854 * <td valign="top">setTrait [normal | bold | bolder | lighter | 100 | 200 | 300 <br /> |
|
855 * | 400 | 500 | 600 | 700 | 800 | 900 | inherit] </td> |
|
856 * <td valign="top" align="center">"normal"<br> |
|
857 * </td> </tr> |
|
858 * <tr> |
|
859 * <td width="150" valign="top">text-anchor<br> |
|
860 * </td> |
|
861 * <td valign="top">getTrait [start | middle | end]<br> |
|
862 * </td> |
|
863 * <td valign="top">setTrait [start | middle | end | inherit ]<br> |
|
864 * </td> |
|
865 * <td valign="top" align="center">"start"<br> |
|
866 * </td> </tr> |
|
867 * <tr> |
|
868 * <td width="150" colspan="4" rowspan="1" valign="top"><br> |
|
869 * </td> |
|
870 * </tr> |
|
871 * <tr> |
|
872 * <td width="150" bgcolor="#999999" valign="top"><b>Attribute<br> |
|
873 * </b></td> |
|
874 * <td bgcolor="#999999" valign="top"><b>Trait Getter<br> |
|
875 * </b></td> |
|
876 * <td bgcolor="#999999" valign="top"><b>Trait Setter<br> |
|
877 * </b></td> |
|
878 * <td bgcolor="#999999" valign="top"><b>Default Values<br> |
|
879 * </b></td> |
|
880 * </tr> |
|
881 * <tr> |
|
882 * <td width="150" valign="top"><br> |
|
883 * </td> |
|
884 * <td valign="top"><br> |
|
885 * </td> |
|
886 * <td valign="top"><br> |
|
887 * </td> |
|
888 * <td valign="top"><br> |
|
889 * </td> |
|
890 * </tr> |
|
891 * <tr> |
|
892 * <td width="150" bgcolor="#cccccc" colspan="4" rowspan="1" valign="top"> |
|
893 * <rect>, <circle>, <ellipse>, <line>, <path>, <g>, |
|
894 * <image>, <text>, <a>, and <use></td> |
|
895 * </tr> |
|
896 * <tr> |
|
897 * <td width="150" valign="top">transform<br> |
|
898 * </td> |
|
899 * <td valign="top">getMatrixTrait [SVGMatrix]<br> |
|
900 * </td> |
|
901 * <td valign="top">setMatrixTrait [SVGMatrix]<br> |
|
902 * </td> |
|
903 * <td valign="top" align="center">Identity matrix<br> |
|
904 * (1,0,0,1,0,0)<br> |
|
905 * </tr> |
|
906 * <tr> |
|
907 * <td width="150" valign="top"><br> |
|
908 * </td> |
|
909 * <td valign="top"><br> |
|
910 * </td> |
|
911 * <td valign="top"><br> |
|
912 * </td> |
|
913 * <td valign="top"><br> |
|
914 * </td> |
|
915 * </tr> |
|
916 * <tr> |
|
917 * <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top"><rect><br> |
|
918 * </td> |
|
919 * </tr> |
|
920 * <tr> |
|
921 * <td width="150" valign="top">height<br> |
|
922 * </td> |
|
923 * <td valign="top">getFloatTrait [ value >= 0]<br> |
|
924 * </td> |
|
925 * <td valign="top">setFloatTrait [ value >= 0]<br> |
|
926 * </td> |
|
927 * <td valign="top" align="center">REQUIRED<br>(0.0f)<br> |
|
928 * </td> |
|
929 * </tr> |
|
930 * <tr> |
|
931 * <td width="150" valign="top">width<br> |
|
932 * </td> |
|
933 * <td valign="top">getFloatTrait [ value >= 0]</td> |
|
934 * <td valign="top">setFloatTrait [ value >= 0]</td> |
|
935 * <td valign="top" align="center">REQUIRED<br>(0.0f)<br> |
|
936 * </td> |
|
937 * </tr> |
|
938 * <tr> |
|
939 * <td width="150" valign="top">x<br> |
|
940 * </td> |
|
941 * <td valign="top">getFloatTrait<br> |
|
942 * </td> |
|
943 * <td valign="top">setFloatTrait<br> |
|
944 * </td> |
|
945 * <td valign="top" align="center">0.0f<br> |
|
946 * </td> |
|
947 * </tr> |
|
948 * <tr> |
|
949 * <td width="150" valign="top">y<br> |
|
950 * </td> |
|
951 * <td valign="top">getFloatTrait<br> |
|
952 * </td> |
|
953 * <td valign="top">setFloatTrait<br> |
|
954 * </td> |
|
955 * <td valign="top" align="center">0.0f<br> |
|
956 * </td> |
|
957 * </tr> |
|
958 * <tr> |
|
959 * <td width="150" valign="top">rx<br> |
|
960 * </td> |
|
961 * <td valign="top">getFloatTrait [value >= 0]</td> |
|
962 * <td valign="top">setFloatTrait [value >= 0]</td> |
|
963 * <td valign="top" align="center">0.0f<br> |
|
964 * </td> |
|
965 * </tr> |
|
966 * <tr> |
|
967 * <td width="150" valign="top">ry<br> |
|
968 * </td> |
|
969 * <td valign="top">getFloatTrait [value >= 0]<br> |
|
970 * </td> |
|
971 * <td valign="top">setFloatTrait [value >= 0]<br> |
|
972 * </td> |
|
973 * <td valign="top" align="center">0.0f<br> |
|
974 * </td> |
|
975 * </tr> |
|
976 * <tr> |
|
977 * <td width="150" valign="top"><br> |
|
978 * </td> |
|
979 * <td valign="top"><br> |
|
980 * </td> |
|
981 * <td valign="top"><br> |
|
982 * </td> |
|
983 * <td valign="top"><br> |
|
984 * </td> |
|
985 * </tr> |
|
986 * <tr> |
|
987 * <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top"><circle><br> |
|
988 * </td> |
|
989 * </tr> |
|
990 * <tr> |
|
991 * <td width="150" valign="top">cx<br> |
|
992 * </td> |
|
993 * <td valign="top">getFloatTrait<br> |
|
994 * </td> |
|
995 * <td valign="top">setFloatTrait<br> |
|
996 * </td> |
|
997 * <td valign="top" align="center">0.0f<br> |
|
998 * </td> |
|
999 * </tr> |
|
1000 * <tr> |
|
1001 * <td width="150" valign="top">cy<br> |
|
1002 * </td> |
|
1003 * <td valign="top">getFloatTrait<br> |
|
1004 * </td> |
|
1005 * <td valign="top">setFloatTrait<br> |
|
1006 * </td> |
|
1007 * <td valign="top" align="center">0.0f<br> |
|
1008 * </td> |
|
1009 * </tr> |
|
1010 * <tr> |
|
1011 * <td width="150" valign="top">r<br> |
|
1012 * </td> |
|
1013 * <td valign="top">getFloatTrait [ value >= 0]<br> |
|
1014 * </td> |
|
1015 * <td valign="top">setFloatTrait [value >= 0]<br> |
|
1016 * </td> |
|
1017 * <td valign="top" align="center">REQUIRED<br>(0.0f)<br> |
|
1018 * </td> |
|
1019 * </tr> |
|
1020 * <tr> |
|
1021 * <td width="150" valign="top"><br> |
|
1022 * </td> |
|
1023 * <td valign="top"><br> |
|
1024 * </td> |
|
1025 * <td valign="top"><br> |
|
1026 * </td> |
|
1027 * <td valign="top"><br> |
|
1028 * </td> |
|
1029 * </tr> |
|
1030 * <tr> |
|
1031 * <td width="150" bgcolor="#cccccc" colspan="4" rowspan="1" valign="top"><ellipse><br> |
|
1032 * </td> |
|
1033 * </tr> |
|
1034 * <tr> |
|
1035 * <td width="150" valign="top">cx<br> |
|
1036 * </td> |
|
1037 * <td valign="top">getFloatTrait<br> |
|
1038 * </td> |
|
1039 * <td valign="top">setFloatTrait<br> |
|
1040 * </td> |
|
1041 * <td valign="top" align="center">0.0f<br> |
|
1042 * </td> |
|
1043 * </tr> |
|
1044 * <tr> |
|
1045 * <td width="150" valign="top">cy<br> |
|
1046 * </td> |
|
1047 * <td valign="top">getFloatTrait<br> |
|
1048 * </td> |
|
1049 * <td valign="top">setFloatTrait<br> |
|
1050 * </td> |
|
1051 * <td valign="top" align="center">0.0f<br> |
|
1052 * </td> |
|
1053 * </tr> |
|
1054 * <tr> |
|
1055 * <td width="150" valign="top">rx<br> |
|
1056 * </td> |
|
1057 * <td valign="top">getFloatTrait [value >= 0]<br> |
|
1058 * </td> |
|
1059 * <td valign="top">setFloatTrait [value >= 0]<br> |
|
1060 * </td> |
|
1061 * <td valign="top" align="center">REQUIRED<br>(0.0f)<br> |
|
1062 * </td> |
|
1063 * </tr> |
|
1064 * <tr> |
|
1065 * <td width="150" valign="top">ry<br> |
|
1066 * </td> |
|
1067 * <td valign="top">getFloatTrait [value >= 0]<br> |
|
1068 * </td> |
|
1069 * <td valign="top">setFloatTrait [value >= 0]<br> |
|
1070 * </td> |
|
1071 * <td valign="top" align="center">REQUIRED<br>(0.0f)<br> |
|
1072 * </td> |
|
1073 * </tr> |
|
1074 * <tr> |
|
1075 * <td width="150" valign="top"><br> |
|
1076 * </td> |
|
1077 * <td valign="top"><br> |
|
1078 * </td> |
|
1079 * <td valign="top"><br> |
|
1080 * </td> |
|
1081 * <td valign="top"><br> |
|
1082 * </td> |
|
1083 * </tr> |
|
1084 * <tr> |
|
1085 * <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top"><line><br> |
|
1086 * </td> |
|
1087 * </tr> |
|
1088 * <tr> |
|
1089 * <td width="150" valign="top">x1<br> |
|
1090 * </td> |
|
1091 * <td valign="top">getFloatTrait<br> |
|
1092 * </td> |
|
1093 * <td valign="top">setFloatTrait<br> |
|
1094 * </td> |
|
1095 * <td valign="top" align="center">0.0f<br> |
|
1096 * </td> |
|
1097 * </tr> |
|
1098 * <tr> |
|
1099 * <td width="150" valign="top">x2<br> |
|
1100 * </td> |
|
1101 * <td valign="top">getFloatTrait<br> |
|
1102 * </td> |
|
1103 * <td valign="top">setFloatTrait<br> |
|
1104 * </td> |
|
1105 * <td valign="top" align="center">0.0f<br> |
|
1106 * </td> |
|
1107 * </tr> |
|
1108 * <tr> |
|
1109 * <td width="150" valign="top">y1<br> |
|
1110 * </td> |
|
1111 * <td valign="top">getFloatTrait<br> |
|
1112 * </td> |
|
1113 * <td valign="top">setFloatTrait<br> |
|
1114 * </td> |
|
1115 * <td valign="top" align="center">0.0f<br> |
|
1116 * </td> |
|
1117 * </tr> |
|
1118 * <tr> |
|
1119 * <td width="150" valign="top">y2<br> |
|
1120 * </td> |
|
1121 * <td valign="top">getFloatTrait<br> |
|
1122 * </td> |
|
1123 * <td valign="top">setFloatTrait<br> |
|
1124 * </td> |
|
1125 * <td valign="top" align="center">0.0f<br> |
|
1126 * </td> |
|
1127 * </tr> |
|
1128 * <tr> |
|
1129 * <td width="150" valign="top"><br> |
|
1130 * </td> |
|
1131 * <td valign="top"><br> |
|
1132 * </td> |
|
1133 * <td valign="top"><br> |
|
1134 * </td> |
|
1135 * <td valign="top"><br> |
|
1136 * </td> |
|
1137 * </tr> |
|
1138 * <tr> |
|
1139 * <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top"><path> (path-length is not supported)<br> |
|
1140 * </td> |
|
1141 * </tr> |
|
1142 * <tr> |
|
1143 * <td width="150" valign="top">d<br> |
|
1144 * </td> |
|
1145 * <td valign="top">getPathTrait [SVGPath]<br> |
|
1146 * </td> |
|
1147 * <td valign="top">setPathTrait [SVGPath]<br> |
|
1148 * </td> |
|
1149 * <td valign="top" align="center">REQUIRED<br>(Empty SVGPath)<br> |
|
1150 * </td> |
|
1151 * </tr> |
|
1152 * <tr> |
|
1153 * <td width="150" valign="top"><br> |
|
1154 * </td> |
|
1155 * <td valign="top"><br> |
|
1156 * </td> |
|
1157 * <td valign="top"><br> |
|
1158 * </td> |
|
1159 * <td valign="top"><br> |
|
1160 * </td> |
|
1161 * </tr> |
|
1162 * <tr> |
|
1163 * <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top"><image><br> |
|
1164 * </td> |
|
1165 * </tr> |
|
1166 * <tr> |
|
1167 * <td width="150" valign="top">x<br> |
|
1168 * </td> |
|
1169 * <td valign="top">getFloatTrait <br> |
|
1170 * </td> |
|
1171 * <td valign="top">setFloatTrait<br> |
|
1172 * </td> |
|
1173 * <td valign="top" align="center">0.0f<br> |
|
1174 * </td> |
|
1175 * </tr> |
|
1176 * <tr> |
|
1177 * <td width="150" valign="top">y<br> |
|
1178 * </td> |
|
1179 * <td valign="top">getFloatTrait<br> |
|
1180 * </td> |
|
1181 * <td valign="top">setFloatTrait<br> |
|
1182 * </td> |
|
1183 * <td valign="top" align="center">0.0f<br> |
|
1184 * </td> |
|
1185 * </tr> |
|
1186 * <tr> |
|
1187 * <td width="150" valign="top">width<br> |
|
1188 * </td> |
|
1189 * <td valign="top">getFloatTrait [value >= 0]<br> |
|
1190 * </td> |
|
1191 * <td valign="top">setFloatTrait [value >= 0]<br> |
|
1192 * </td> |
|
1193 * <td valign="top" align="center">REQUIRED<br>(0.0f)<br> |
|
1194 * </td> |
|
1195 * </tr> |
|
1196 * <tr> |
|
1197 * <td width="150" valign="top">height<br> |
|
1198 * </td> |
|
1199 * <td valign="top">getFloatTrait [value >= 0]<br> |
|
1200 * </td> |
|
1201 * <td valign="top">setFloatTrait [value >= 0]<br> |
|
1202 * </td> |
|
1203 * <td valign="top" align="center">REQUIRED<br>(0.0f)<br> |
|
1204 * </td> |
|
1205 * </tr> |
|
1206 * <tr> |
|
1207 * <td width="150" valign="top">xlink:href<br> |
|
1208 * </td> |
|
1209 * <td valign="top">getTrait NS[absolute URI]<br> |
|
1210 * </td> |
|
1211 * <td valign="top">setTraitNS [non local-URI value]<br> |
|
1212 * </td> |
|
1213 * <td valign="top" align="center">REQUIRED<br>( "" )<br> |
|
1214 * </td> |
|
1215 * </tr> |
|
1216 * <tr> |
|
1217 * <td width="150" valign="top"><br> |
|
1218 * </td> |
|
1219 * <td valign="top"><br> |
|
1220 * </td> |
|
1221 * <td valign="top"><br> |
|
1222 * </td> |
|
1223 * <td valign="top"><br> |
|
1224 * </td> |
|
1225 * </tr> |
|
1226 * <tr> |
|
1227 * <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top"><use><br> |
|
1228 * </td> |
|
1229 * </tr> |
|
1230 * <tr> |
|
1231 * <td width="150" valign="top">x<br> |
|
1232 * </td> |
|
1233 * <td valign="top">getFloatTrait<br> |
|
1234 * </td> |
|
1235 * <td valign="top">setFloatTrait<br> |
|
1236 * </td> |
|
1237 * <td valign="top" align="center">0.0f<br> |
|
1238 * </td> |
|
1239 * </tr> |
|
1240 * <tr> |
|
1241 * <td width="150" valign="top">y<br> |
|
1242 * </td> |
|
1243 * <td valign="top">getFloatTrait<br> |
|
1244 * </td> |
|
1245 * <td valign="top">setFloatTrait<br> |
|
1246 * </td> |
|
1247 * <td valign="top" align="center">0.0f<br> |
|
1248 * </td> |
|
1249 * </tr> |
|
1250 * <tr> |
|
1251 * <td valign="top">xlink:href<br> |
|
1252 * </td> |
|
1253 * <td valign="top">getTraitNS[absolute URI]<br> |
|
1254 * </td> |
|
1255 * <td valign="top">setTraitNS<br> |
|
1256 * </td> |
|
1257 * <td valign="top" align="center">""<br> |
|
1258 * </td> |
|
1259 * </tr> |
|
1260 * <tr> |
|
1261 * <td width="150" valign="top"><br> |
|
1262 * </td> |
|
1263 * <td valign="top"><br> |
|
1264 * </td> |
|
1265 * <td valign="top"><br> |
|
1266 * </td> |
|
1267 * <td valign="top"><br> |
|
1268 * </td> |
|
1269 * </tr> |
|
1270 * <tr> |
|
1271 * <tr> |
|
1272 * <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top"><a><br> |
|
1273 * </td> |
|
1274 * </tr> |
|
1275 * <tr> |
|
1276 * <td width="150" valign="top">target<br> |
|
1277 * </td> |
|
1278 * <td valign="top">getTrait<br> |
|
1279 * </td> |
|
1280 * <td valign="top">setTrait<br> |
|
1281 * </td> |
|
1282 * <td valign="top" align="center">""<br> |
|
1283 * </td> |
|
1284 * </tr> |
|
1285 * <tr> |
|
1286 * <td valign="top">xlink:href<br> |
|
1287 * </td> |
|
1288 * <td valign="top">getTraitNS[absolute URI]<br> |
|
1289 * </td> |
|
1290 * <td valign="top">setTraitNS<br> |
|
1291 * </td> |
|
1292 * <td valign="top" align="center">""<br> |
|
1293 * </td> |
|
1294 * </tr> |
|
1295 * <tr> |
|
1296 * <td width="150" valign="top"><br> |
|
1297 * </td> |
|
1298 * <td valign="top"><br> |
|
1299 * </td> |
|
1300 * <td valign="top"><br> |
|
1301 * </td> |
|
1302 * <td valign="top"><br> |
|
1303 * </td> |
|
1304 * </tr> |
|
1305 * <tr> |
|
1306 * <td width="*" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top"><text><br />(Notes: |
|
1307 * For 'x' and 'y', it is only possible |
|
1308 * to provide floating point scalar values; an array of x or y values is not supported. <br /> |
|
1309 * 'rotate' attribute is not supported.)<br/> |
|
1310 * </td> |
|
1311 * </tr> |
|
1312 * <tr> |
|
1313 * <td width="150" valign="top">x<br> |
|
1314 * </td> |
|
1315 * <td valign="top">getFloatTrait<br> |
|
1316 * </td> |
|
1317 * <td valign="top">setFloatTrait<br> |
|
1318 * </td> |
|
1319 * <td valign="top" align="center">0.0f<br> |
|
1320 * </td> |
|
1321 * </tr> |
|
1322 * <tr> |
|
1323 * <td width="150" valign="top">y<br> |
|
1324 * </td> |
|
1325 * <td valign="top">getFloatTrait<br> |
|
1326 * </td> |
|
1327 * <td valign="top">setFloatTrait<br> |
|
1328 * </td> |
|
1329 * <td valign="top" align="center">0.0f<br> |
|
1330 * </td> |
|
1331 * </tr> |
|
1332 * <tr> |
|
1333 * <td width="150" valign="top">#text<br> |
|
1334 * </td> |
|
1335 * <td valign="top">getTrait [not null]<br> |
|
1336 * </td> |
|
1337 * <td valign="top">setTrait [not null]<br> |
|
1338 * </td> |
|
1339 * <td valign="top" align="center">""<br> |
|
1340 * </td> |
|
1341 * </tr> |
|
1342 * <tr> |
|
1343 * <td width="150" valign="top"><br> |
|
1344 * </td> |
|
1345 * <td valign="top"><br> |
|
1346 * </td> |
|
1347 * <td valign="top"><br> |
|
1348 * </td> |
|
1349 * <td valign="top"><br> |
|
1350 * </td> |
|
1351 * </tr> |
|
1352 * <tr> |
|
1353 * <td width="150" colspan="4" rowspan="1" bgcolor="#cccccc" valign="top"><svg><br> |
|
1354 * </td> |
|
1355 * </tr> |
|
1356 * <tr> |
|
1357 * <td width="150" valign="top">version<br> |
|
1358 * </td> |
|
1359 * <td valign="top">getTrait<br> |
|
1360 * </td> |
|
1361 * <td valign="top">Not available (readonly)<br> |
|
1362 * </td> |
|
1363 * <td valign="top" align="center">"1.1"<br> |
|
1364 * </td> |
|
1365 * </tr> |
|
1366 * <tr> |
|
1367 * <td width="150" valign="top">baseProfile<br> |
|
1368 * </td> |
|
1369 * <td valign="top">getTrait<br> |
|
1370 * </td> |
|
1371 * <td valign="top">Not available (readonly)<br> |
|
1372 * </td> |
|
1373 * <td valign="top" align="center">"tiny"<br> |
|
1374 * </td> |
|
1375 * </tr> |
|
1376 * <tr> |
|
1377 * <td width="150" valign="top">viewBox<br> |
|
1378 * </td> |
|
1379 * <td valign="top">getRectTrait [null, SVGRect]<br> |
|
1380 * </td> |
|
1381 * <td valign="top">setRectTrait [SVGRect]<br> |
|
1382 * </td> |
|
1383 * <td valign="top" align="center">null<br> |
|
1384 * </td> |
|
1385 * </tr> |
|
1386 * <tr> |
|
1387 * <td width="150" valign="top">zoomAndPan<br> |
|
1388 * </td> |
|
1389 * <td valign="top">getTrait [disable | magnify]<br> |
|
1390 * </td> |
|
1391 * <td valign="top">setTrait [disable | magnify]<br> |
|
1392 * </td> |
|
1393 * <td valign="top" align="center">"magnify"<br> |
|
1394 * </td> |
|
1395 * </tr> |
|
1396 * <tr> |
|
1397 * <td width="150" valign="top"><br> |
|
1398 * </td> |
|
1399 * <td valign="top"><br> |
|
1400 * </td> |
|
1401 * <td valign="top"><br> |
|
1402 * </td> |
|
1403 * <td valign="top"><br> |
|
1404 * </td> |
|
1405 * </tr> |
|
1406 * </tbody> |
|
1407 * </table> |
|
1408 */ |
|
1409 |
|
1410 // *********************************************************************** |
|
1411 // SVG Path |
|
1412 // *********************************************************************** |
|
1413 /** |
|
1414 * An SVG Path datatype is used to define the path geometry. |
|
1415 * Corresponds to SVG path specification or the "d" attribute. |
|
1416 * |
|
1417 * <p>The native implementations must support the following simplifications or |
|
1418 * canonicalization of path segments. Any simplifications should be lossless. |
|
1419 * |
|
1420 * <ul> |
|
1421 * <li>Relative commands (c, h, l, m, q, s, t, and v) must be converted to their absolute |
|
1422 * counterparts·</li> |
|
1423 * <li>Horizontal and Vertical lines (H, h, V, and v) must be converted to general |
|
1424 * lines (L and l)·</li> |
|
1425 * <li>Translate command S to command C·</li> |
|
1426 * <li>Translate command T to command Q.</li> |
|
1427 * </ul> |
|
1428 * </p> |
|
1429 */ |
|
1430 |
|
1431 /** |
|
1432 * The CSvgJavaInterfaceImpl class specializes the CSvgEngineInterfaceImpl class |
|
1433 */ |
|
1434 class CSvgJavaInterfaceImpl : public CSvgEngineInterfaceImpl, public MSvgMouseListener |
|
1435 { |
|
1436 public: |
|
1437 /** |
|
1438 * Construct an instance of CSvgJavaInterfaceImpl |
|
1439 */ |
|
1440 IMPORT_C static CSvgJavaInterfaceImpl* NewL( TFontSpec& aFontSpec ); |
|
1441 IMPORT_C static CSvgJavaInterfaceImpl* NewL(); |
|
1442 |
|
1443 /** |
|
1444 * Destruct an instance of CSvgJavaInterfaceImpl |
|
1445 */ |
|
1446 IMPORT_C ~CSvgJavaInterfaceImpl(); |
|
1447 |
|
1448 // *********************************************************************** |
|
1449 // SVG Engine |
|
1450 // *********************************************************************** |
|
1451 /** |
|
1452 * Create an SvgEngine instance. |
|
1453 * NOTE: Java side uses engine only during rendering phase. |
|
1454 * |
|
1455 * @since 1.0 |
|
1456 * @see javax.microedition.m2g.ScalableGraphics#render() |
|
1457 * @return Pointer to CSvgEngineImpl object if creation is succesful, otherwise 0 is returned. |
|
1458 */ |
|
1459 IMPORT_C SvgEngineHandle SvgEngineCreate(); |
|
1460 |
|
1461 /** |
|
1462 * Request to set render quality. |
|
1463 * Set the quality of rendering. It can take one of the values, |
|
1464 * <code>RENDERING_QUALITY_LOW</code> (=1) or <code>RENDERING_QUALITY_HIGH</code> (=2). |
|
1465 * Default value is <code>RENDERING_QUALITY_HIGH</code>. |
|
1466 * The implementation of these quality levels is implementation dependent and should |
|
1467 * be mapped to definitions in SVG spec (shape, text, image and color rendering) |
|
1468 * |
|
1469 * @since 1.0 |
|
1470 * @see javax.microedition.m2g.ScalableGraphics#setRenderingQuality() |
|
1471 * @param aEngineHandle Engine handle. |
|
1472 * @param aQuality This value indicates the quality of rendering required. |
|
1473 */ |
|
1474 IMPORT_C void SvgEngineSetRenderQuality( SvgEngineHandle aEngineHandle, TInt aQuality ); |
|
1475 |
|
1476 /** |
|
1477 * Request to render the SVG document. |
|
1478 * |
|
1479 * @since 1.0 |
|
1480 * @see javax.microedition.m2g.ScalableGraphics#render() |
|
1481 * @param aEngineHandle Svg engine handle |
|
1482 * @param aDocumentHandle Svg document handle |
|
1483 * @param aSurfaceHandle Svg surface handle |
|
1484 * @param aSurfaceMaskHandle Mask that defines what pixels should be thrown and what not. |
|
1485 * @param aCurrentTime Current frame time. NOTE might be obsolete since the |
|
1486 */ |
|
1487 IMPORT_C void SvgEngineRenderDocument( |
|
1488 SvgEngineHandle aEngineHandle, SvgDocumentHandle aDocumentHandle, |
|
1489 TInt aSurfaceHandle, TInt aSurfaceMaskHandle = NULL, TReal32 aCurrentTime = 0.0f ) __SOFTFP; |
|
1490 |
|
1491 IMPORT_C void SvgEngineRenderDocumentL( |
|
1492 SvgEngineHandle aEngineHandle, SvgDocumentHandle aDocumentHandle, |
|
1493 TInt aSurfaceHandle, const TPoint& aAnchor, const TRect& aRenderArea, TReal32 aCurrentTime, TReal32 aAlpha ) __SOFTFP; |
|
1494 |
|
1495 /** |
|
1496 * Request to destroy the given engine by handle. |
|
1497 * NOTE: Java MIDlet could use multiple engines. |
|
1498 * |
|
1499 * @since 1.0 |
|
1500 * @param aEngineHandle Engine |
|
1501 */ |
|
1502 IMPORT_C void SvgEngineDestroy( SvgEngineHandle aEngineHandle ); |
|
1503 |
|
1504 /* |
|
1505 * Sets the animation back to time 0 and then starts the internal engine timer |
|
1506 * NOTE: Java doesn't use this method. Java uses own timer(s). |
|
1507 * |
|
1508 * @since 1.0 |
|
1509 * @param aEngineHandle Engine |
|
1510 */ |
|
1511 IMPORT_C void SvgEngineStart( SvgEngineHandle aEngineHandle ); |
|
1512 |
|
1513 /* |
|
1514 * Stops the internal SVG engine timer |
|
1515 * NOTE: Java doesn't use this method. Java uses own timer. |
|
1516 * |
|
1517 * @since 1.0 |
|
1518 * @param aEngineHandle Engine |
|
1519 */ |
|
1520 IMPORT_C void SvgEngineStop( SvgEngineHandle aEngineHandle ); |
|
1521 |
|
1522 /* |
|
1523 * Resumes the internal SVG engine timer |
|
1524 * NOTE: Java doesn't use this method. Java uses own timer. |
|
1525 * |
|
1526 * @since 1.0 |
|
1527 * @param aEngineHandle Engine |
|
1528 */ |
|
1529 IMPORT_C void SvgEngineResume( SvgEngineHandle aEngineHandle ); |
|
1530 |
|
1531 // ***************************************************************************** |
|
1532 // SVG Rendering Surface Functions |
|
1533 // ***************************************************************************** |
|
1534 /** |
|
1535 * Create a Svg Rendering Surface. |
|
1536 * NOTE: Java doesn't use this method. |
|
1537 * |
|
1538 * @since 1.0 |
|
1539 * @param aWidth Width |
|
1540 * @param aHeight Height |
|
1541 * @return Surface |
|
1542 */ |
|
1543 IMPORT_C SvgSurfaceHandle SvgRenderingSurfaceCreate( TInt aWidth, TInt aHeight ); |
|
1544 |
|
1545 /** |
|
1546 * Destroy a Svg Rendering Surface. |
|
1547 * NOTE: Java doesn't use this method. |
|
1548 * |
|
1549 * @since 1.0 |
|
1550 * @param aSurface Surface |
|
1551 */ |
|
1552 IMPORT_C void SvgRenderingSurfaceDestroy( SvgSurfaceHandle aSurface ); |
|
1553 |
|
1554 /** |
|
1555 * Get a pointer to the Svg Rendering surface. |
|
1556 * NOTE: Java doesn't use this method. |
|
1557 * |
|
1558 * @since 1.0 |
|
1559 * @param aSurface Surface |
|
1560 * @return CFbsBitmap object |
|
1561 */ |
|
1562 IMPORT_C TUint* SvgRenderingSurfaceGetBuffer( SvgSurfaceHandle aSurface ); |
|
1563 |
|
1564 /** |
|
1565 * Get the width of the Svg Rendering Surface. |
|
1566 * NOTE: Java doesn't use this method. |
|
1567 * |
|
1568 * @since 1.0 |
|
1569 * @param aSurface Surface |
|
1570 * @return Width |
|
1571 */ |
|
1572 IMPORT_C TInt SvgRenderingSurfaceGetWidth( SvgSurfaceHandle aSurface ); |
|
1573 /** |
|
1574 * Get the height of the Svg Rendering Surface. |
|
1575 * NOTE: Java doesn't use this method. |
|
1576 * |
|
1577 * @since 1.0 |
|
1578 * @param aSurface Surface |
|
1579 * @return Height |
|
1580 */ |
|
1581 IMPORT_C TInt SvgRenderingSurfaceGetHeight( SvgSurfaceHandle aSurface ); |
|
1582 |
|
1583 /** |
|
1584 * Clear the Svg Rendering Surface. |
|
1585 * NOTE: Java doesn't use this method. |
|
1586 * |
|
1587 * @since 1.0 |
|
1588 * @param aSurface Surface |
|
1589 */ |
|
1590 IMPORT_C void SvgRenderingSurfaceClearBuffer( SvgSurfaceHandle aSurface ); |
|
1591 |
|
1592 // *********************************************************************** |
|
1593 // SVG Document |
|
1594 // *********************************************************************** |
|
1595 /** |
|
1596 * Create an empty svg document. |
|
1597 * NOTE: Java doesn't use this method. |
|
1598 * Java side uses the <code>SvgDocumentCreateL</code> method to create an empty SVG document |
|
1599 * that contains a root <svg> element with default viewport size of 100x100. |
|
1600 * |
|
1601 * @since 1.0 |
|
1602 * @see javax.microedition.m2g.SVGImage#createEmptyImage() |
|
1603 * @return Svg Document. |
|
1604 */ |
|
1605 IMPORT_C SvgDocumentHandle SvgDocumentCreateEmpty(); |
|
1606 |
|
1607 /** |
|
1608 * Create a svg document by parsing the given string. |
|
1609 * The image size is determined by the content specification |
|
1610 * (eg: width/height attributes on root SVG element). The default viewport size |
|
1611 * of 100-by-100 pixels is used when the size is unspecified. This method will throw an exception |
|
1612 * when the document is in error: |
|
1613 * <ul> |
|
1614 * <li>the SVG document does not conform to the XML 1.0 specification</li> |
|
1615 * <li>an element has an attribute or property value which is not permissible according to the SVG specification </li> |
|
1616 * <li>the required or mandatory attributes according to the SVG specification are missing</li> |
|
1617 * <li>the document contains circular references on the <use> element</li> |
|
1618 * <li>the document contains <image> element(s) with local references </li> |
|
1619 * <li>the document contains elements with duplicate Id's</li> |
|
1620 * <li>the document contains animation(s) in error</li> |
|
1621 * </ul> |
|
1622 * |
|
1623 * The native engine might be invoked for any external resource referenced in the document |
|
1624 * by calling the <code>SvgDocumentRequestCompleted</code>. |
|
1625 * However, please note that data URIs (for ex: base64 encoded images |
|
1626 * like <image xlink:href="data:image/png;base64,/9j/4AAQ..."/>) |
|
1627 * are required to be decoded by the native engine. |
|
1628 * The engine must only make one call if there exist multiple resources with the same URI. |
|
1629 * |
|
1630 * If a svg document contains external resources and <code>SvgDocumentRequestCompleted</code> is not called |
|
1631 * then the engine's default implementation is used automatically, but it might not be able to load all of |
|
1632 * external resources. For example, if the svg document is loaded from a file in a Jar file, |
|
1633 * the implementation will not be able to load images that have relative |
|
1634 * URIs (ex; <image xlink:href="myImage.png" />). |
|
1635 * |
|
1636 * <p>Note that <code>SvgDocumentRequestCompleted</code> is also called when the xlink:href attribute on |
|
1637 * <image> is set or changed by the application, but the call is made only when the |
|
1638 * element is hooked into the document tree i.e. when the ancestors go all the way up to |
|
1639 * the root <svg> element. There are two cases: |
|
1640 * <ul> |
|
1641 * <li>When changing the xlink:href attribute of an existing <image> element that is already hooked or part of the tree.</li> |
|
1642 * <li>When creating a new <image>, setting its xlink:href and hooking it to the document tree.</li> |
|
1643 * </ul> |
|
1644 * </p> |
|
1645 * |
|
1646 * @since 1.0 |
|
1647 * @see javax.microedition.m2g.ScalableImage#createImage() |
|
1648 * @param aString The string from which the SVG content should be read |
|
1649 * @return Svg Document if successful, otherwise the function leaves. |
|
1650 * @throws MJavaError if an error occurs while loading the content. |
|
1651 */ |
|
1652 IMPORT_C SvgDocumentHandle SvgDocumentCreateL( const TPtrC16& aString ); |
|
1653 |
|
1654 /** |
|
1655 * Destroy the given svg document (by handle). |
|
1656 * NOTE: Java MIDlet could use multiple documents. |
|
1657 * |
|
1658 * @since 1.0 |
|
1659 * @param aDocumentHandle Document handle. |
|
1660 */ |
|
1661 IMPORT_C void SvgDocumentDestroy( SvgDocumentHandle aDocumentHandle ); |
|
1662 |
|
1663 /** |
|
1664 * Svg Document request complete. |
|
1665 * Once the requested external resource is available, the application forwards this information |
|
1666 * (data) to the SVG engine. If this method is called a second time for a same URL (uri) of a |
|
1667 * same SVG document, the engine will replace the current resource data with the new |
|
1668 * one. <b>Note:</b> Setting <code>NULL</code> for data (<code>0</code> for data_size) indicates |
|
1669 * that the requested resource could not be fetched by java side, and in this event the SVG engine |
|
1670 * will not make further attempts to load this resource. |
|
1671 * |
|
1672 * @since 1.0 |
|
1673 * @see javax.microedition.m2g.ScalableImage#requestCompleted() |
|
1674 * @param hDocument SVG document handle |
|
1675 * @param uri External resource URI |
|
1676 * @param data External resource data |
|
1677 * @param data_size External resource data size |
|
1678 * @return TODO |
|
1679 */ |
|
1680 EXPORT_C TInt SvgDocumentRequestCompleted( SvgDocumentHandle hDocument, const TPtrC16& aUri, const TPtrC8& ); |
|
1681 |
|
1682 /** |
|
1683 * Get an external item indicated in a SVG document. |
|
1684 * Java side might request an external resouce and once the requested external resource is available, |
|
1685 * java side forwards this information (<code>SvgDocumentGetExternalListItem</code>) to the SVG engine. |
|
1686 * <b>Note:</b> Returning <code>null</code> indicates that the SVG engine tryes to handle the requested resource. |
|
1687 * |
|
1688 * @since 1.0 |
|
1689 * @param aDocumentHandle SVG document handle |
|
1690 * @param index External resource item index. Scale: |
|
1691 * <li>0 <= <code>index</code> < <code>SvgDocumentGetExternalListSize</code></li> |
|
1692 * @return External resource URI |
|
1693 */ |
|
1694 IMPORT_C TInt SvgDocumentGetExternalListItem(SvgDocumentHandle aDocumentHandle, TInt aIndex, TPtrC16& aItem); |
|
1695 |
|
1696 /** |
|
1697 * Get number of external list items in a SVG document. |
|
1698 * After the SVG document is created (see <code>SvgDocumentCreateL</code>) java side checks if |
|
1699 * the SVG document contains external item(s) |
|
1700 * |
|
1701 * @since 1.0 |
|
1702 * @param aDocumentHandle SVG document handle |
|
1703 * @return Number of external resource items |
|
1704 */ |
|
1705 IMPORT_C TInt SvgDocumentGetExternalListSize( SvgDocumentHandle aDocumentHandle ); |
|
1706 |
|
1707 /** |
|
1708 * Increments the animation or media timeline for the specified document aDocumentHandle |
|
1709 * (in seconds). |
|
1710 * This method is intended to move only forward in the timeline. |
|
1711 * It is important to note that setting large increments of time would result in |
|
1712 * skipping parts of the animation as per the SVG animation model. |
|
1713 * |
|
1714 * @since 1.0 |
|
1715 * @see javax.microedition.m2g.SVGImage#incrementTime() |
|
1716 * @see org.w3c.dom.svg.SVGSVGElement#setCurrentTime() |
|
1717 * @param aDocumentHandle SVG document handle. |
|
1718 * @param seconds the value of time to be set in seconds. |
|
1719 */ |
|
1720 IMPORT_C void SvgDocumentSetMediaTime( SvgDocumentHandle aDocumentHandle, TReal32 seconds ) __SOFTFP; |
|
1721 |
|
1722 /** |
|
1723 * Get current animation or media timeline time for the specified document. |
|
1724 * |
|
1725 * @since 1.0 |
|
1726 * @see org.w3c.dom.svg.SVGSVGElement#getCurrentTime() |
|
1727 * @param aDocumentHandle SVG document handle |
|
1728 * @return Returns current animation timeline time in seconds |
|
1729 */ |
|
1730 IMPORT_C TReal32 SvgDocumentGetMediaTime( SvgDocumentHandle aDocumentHandle ) __SOFTFP; |
|
1731 |
|
1732 /** |
|
1733 * Get the viewport width of the given SVG document. |
|
1734 * The value returned is always in pixels. If the specified width is defined in percentages, the |
|
1735 * values are mapped to the default view port size of 100x100. If the viewport width |
|
1736 * is explicitly changed by the java application, then the percentages are ignored and the content |
|
1737 * is made to fit to this new viewport width. |
|
1738 * |
|
1739 * @since 1.0 |
|
1740 * @see javax.microedition.m2g.ScalableImage#getViewportWidth() |
|
1741 * @see SvgDocumentSetViewportWidth |
|
1742 * @param aDocumentHandle SVG document handle |
|
1743 * @return the current width of the given SVG document. |
|
1744 */ |
|
1745 IMPORT_C TInt SvgDocumentGetViewportWidth( SvgDocumentHandle aDocumentHandle ); |
|
1746 |
|
1747 /** |
|
1748 * Get the viewport height of the given SVG document. |
|
1749 * The value returned is always in pixels. If the specified height is defined in percentages, the |
|
1750 * values are mapped to the default view port size of 100x100. If the viewport height |
|
1751 * is explicitly changed by the java application, then the percentages are ignored and the content |
|
1752 * is made to fit to this new viewport height. |
|
1753 * |
|
1754 * @since 1.0 |
|
1755 * @see javax.microedition.m2g.ScalableImage#getViewportHeight() |
|
1756 * @see SvgDocumentSetViewportHeight |
|
1757 * @param aDocumentHandle SVG document handle |
|
1758 * @return the current height of the given SVG document. |
|
1759 */ |
|
1760 IMPORT_C TInt SvgDocumentGetViewportHeight( SvgDocumentHandle aDocumentHandle ); |
|
1761 |
|
1762 /** |
|
1763 * Set the new (viewport) width for the given SVG document. |
|
1764 * |
|
1765 * @since 1.0 |
|
1766 * @see javax.microedition.m2g.ScalableImage#setViewportWidth() |
|
1767 * @see SvgDocumentGetViewportWidth |
|
1768 * @param aDocumentHandle SVG document handle |
|
1769 * @param aWidth The new width to be set. |
|
1770 */ |
|
1771 IMPORT_C void SvgDocumentSetViewportWidth( SvgDocumentHandle aDocumentHandle, TInt aWidth ); |
|
1772 |
|
1773 /** |
|
1774 * Set the new (viewport) height for the given SVG document. |
|
1775 * |
|
1776 * @since 1.0 |
|
1777 * @see javax.microedition.m2g.ScalableImage#setViewportHeight() |
|
1778 * @see SvgDocumentGetViewportHeight |
|
1779 * @param aDocumentHandle SVG document handle |
|
1780 * @param aHeight The new height to be set. |
|
1781 */ |
|
1782 IMPORT_C void SvgDocumentSetViewportHeight( SvgDocumentHandle aDocumentHandle, TInt aHeight ); |
|
1783 |
|
1784 /** |
|
1785 * Set the default viewport size for the given SVG document. |
|
1786 * The default viewport size of 100-by-100 pixels is used when the size is unspecified. |
|
1787 * |
|
1788 * @since 1.0 |
|
1789 * @param aDocumentHandle Document |
|
1790 */ |
|
1791 IMPORT_C void SvgDocumentViewportInit( SvgDocumentHandle aDocumentHandle ); |
|
1792 |
|
1793 /** |
|
1794 * Get the viewport width units for the given document. |
|
1795 * NOTE: Java side is not actually need this method. |
|
1796 * |
|
1797 * @since 1.0 |
|
1798 * @param aDocumentHandle Document |
|
1799 * @return <code>1</code> if pixels or <code>0</code> if percentages |
|
1800 */ |
|
1801 IMPORT_C TInt SvgDocumentGetViewportWidthUnits( SvgDocumentHandle aDocumentHandle ); |
|
1802 |
|
1803 /** |
|
1804 * Get the viewport height units for the given document. |
|
1805 * NOTE: Java side is not actually need this method. |
|
1806 * |
|
1807 * @since 1.0 |
|
1808 * @param aDocumentHandle Document |
|
1809 * @return <code>1</code> if pixels or <code>0</code> if percentages |
|
1810 */ |
|
1811 IMPORT_C TInt SvgDocumentGetViewportHeightUnits( SvgDocumentHandle aDocumentHandle ); |
|
1812 |
|
1813 /** |
|
1814 * Return a child element of the given SVG document Node which corresponds to the top-most |
|
1815 * tag in XML file. For SVG files it must be <code>SVGSVGElement</code>. |
|
1816 * |
|
1817 * @since 1.0 |
|
1818 * @see org.w3c.dom.Document#getDocumentElement() |
|
1819 * @param aDocumentHandle SVG document handle |
|
1820 * @return The root element associated with the given SVG document. |
|
1821 */ |
|
1822 IMPORT_C SvgElementHandle SvgDocumentGetRootElement( SvgDocumentHandle aDocumentHandle ); |
|
1823 |
|
1824 /** |
|
1825 * Get the svg element in the given SVG document with |
|
1826 * the given unique ID string.If no such element exists, this returns NULL. |
|
1827 * |
|
1828 * @since 1.0 |
|
1829 * @see org.w3c.dom.Document#getElementById() |
|
1830 * @param aDocumentHandle SVG document handle |
|
1831 * @param aId the ID of the element to be retrieved. |
|
1832 * @return An element handle that matches with the given ID or |
|
1833 * <code>NULL</code> if the ID is not present. |
|
1834 */ |
|
1835 IMPORT_C SvgElementHandle SvgDocumentGetElementById( SvgDocumentHandle aDocumentHandle, const TPtrC16& aID ); |
|
1836 |
|
1837 /** |
|
1838 * Get the number of ids in the current SVG document. |
|
1839 * NOTE: Java doesn't use this method. |
|
1840 * |
|
1841 * @since 1.0 |
|
1842 * @param aDocumentHandle SVG document handle |
|
1843 */ |
|
1844 IMPORT_C TInt SvgDocumentGetNumberOfIds(SvgDocumentHandle aDocumentHandle ); |
|
1845 |
|
1846 /** |
|
1847 * Get an id (at index) from the current SVG document. |
|
1848 * NOTE: Java doesn't use this method. |
|
1849 * |
|
1850 * @since 1.0 |
|
1851 * @param aDocumentHandle SVG document handle |
|
1852 * @param index ID index |
|
1853 * @return ID string |
|
1854 */ |
|
1855 IMPORT_C TInt SvgDocumentGetId(SvgDocumentHandle aDocumentHandle, TInt index, TPtrC16& aId); |
|
1856 |
|
1857 /** |
|
1858 * Set the begin animation time for the given element in the given SVG document. |
|
1859 * The new time is added to the <a href="http://www.w3.org/TR/2001/REC-smil20-20010807/smil20.html#smil-timing-Timing-BeginEnd-InstanceTimesLists"> |
|
1860 * begin instance times list</a>. |
|
1861 * |
|
1862 * @since 1.0 |
|
1863 * @see org.w3c.dom.svg.SVGAnimationElement#beginElementAt() |
|
1864 * @param aDocumentHandle SVG document handle |
|
1865 * @param aElementHandle Element handle |
|
1866 * @param aOffsetTime The time in seconds at which to begin the element. |
|
1867 */ |
|
1868 IMPORT_C void SvgDocumentBeginElementAt( SvgDocumentHandle aDocumentHandle, |
|
1869 SvgElementHandle aElementHandle, |
|
1870 TReal32 aOffsetTime ) __SOFTFP; |
|
1871 |
|
1872 /** |
|
1873 * Set the end animation time for the given element in the given SVG document. |
|
1874 * The new time is added to the <a href="http://www.w3.org/TR/2001/REC-smil20-20010807/smil20.html#smil-timing-Timing-BeginEnd-InstanceTimesLists"> |
|
1875 * end instance times list</a>. |
|
1876 * NOTE: Native engine checks the element is active before set the new end time. |
|
1877 * |
|
1878 * @since 1.0 |
|
1879 * @see org.w3c.dom.svg.SVGAnimationElement#endElementAt() |
|
1880 * @param aDocumentHandle SVG document handle |
|
1881 * @param aElementHandle Element handle |
|
1882 * @param aOffsetTime The time in seconds at which to end the element. |
|
1883 */ |
|
1884 IMPORT_C void SvgDocumentEndElementAt( SvgDocumentHandle aDocumentHandle, |
|
1885 SvgElementHandle aElementHandle, |
|
1886 TReal32 aOffsetTime ) __SOFTFP; |
|
1887 |
|
1888 /** |
|
1889 * Set the given element to have the focus in the given SVG document. |
|
1890 * The initial focus is always <code>null</code> and setting |
|
1891 * <code>NULL</code> will remove the current focus. |
|
1892 * NOTE: Java doesn't use this method. |
|
1893 * |
|
1894 * @since 1.0 |
|
1895 * @see javax.microedition.m2g.SVGImage#focusOn() |
|
1896 * @param aDocumentHandle SVG document handle |
|
1897 * @param aElementHandle The element to set the focus on. |
|
1898 |
|
1899 * changes made for Focus-in/focus-out bug(AMIA-6T8EEG) |
|
1900 */ |
|
1901 IMPORT_C void SvgDocumentFocusOn( SvgDocumentHandle aDocumentHandle, |
|
1902 SvgElementHandle aElementHandle ); |
|
1903 |
|
1904 /** |
|
1905 * Get the element having the focus. |
|
1906 * NOTE: Java doesn't use this method. |
|
1907 * |
|
1908 * @since 1.0 |
|
1909 * @see javax.microedition.m2g.SVGImage#focusOn() |
|
1910 * @param aDocumentHandle SVG document handle |
|
1911 * @return The element focused. |
|
1912 */ |
|
1913 IMPORT_C SvgElementHandle SvgDocumentGetFocus( SvgDocumentHandle aDocumentHandle ); |
|
1914 |
|
1915 /** |
|
1916 * Activate the element that has the focus. |
|
1917 * NOTE: Java doesn't use this method. |
|
1918 * |
|
1919 * @since 1.0 |
|
1920 * @see javax.microedition.m2g.SVGImage#activate() |
|
1921 * @param aDocumentHandle SVG document handle |
|
1922 */ |
|
1923 IMPORT_C void SvgDocumentActivate( SvgDocumentHandle aDocumentHandle ); |
|
1924 |
|
1925 /** |
|
1926 * Request a mouse event at the given coordinate. |
|
1927 * This method is used to dispatch a mouse "click" event to the given |
|
1928 * document. The mouse position is given as screen coordinates <code>aMouseX, aMouseY</code>. |
|
1929 * If the aMouseX, aMouseY values are outside the viewport area or no target is available |
|
1930 * for the aMouseX, aMouseY coordinates, the event is not dispatched. |
|
1931 * |
|
1932 * @since 1.0 |
|
1933 * @see javax.microedition.m2g.SVGImage#dispatchMouseEvent() |
|
1934 * @param aDocumentHandle SVG document handle |
|
1935 * @param aMouseX The x location of the mouse/pointer in viewport coordinate system. |
|
1936 * @param aMouseX The y location of the mouse/pointer in viewport coordinate system. |
|
1937 * @return Element handle to where mouse was clicked. Return null if no hit. |
|
1938 */ |
|
1939 IMPORT_C SvgElementHandle SvgDocumentDispatchMouseEvent( SvgDocumentHandle aDocumentHandle, |
|
1940 TInt aMouseX, TInt aMouseY ); |
|
1941 |
|
1942 /** |
|
1943 * Check if document has animation. |
|
1944 * NOTE: Java doesn't use this method. |
|
1945 * |
|
1946 * @since 1.0 |
|
1947 * @param aDocumentHandle SVG document handle |
|
1948 * @param TBool . ETrue if animation present otherwise EFalse. |
|
1949 */ |
|
1950 IMPORT_C TInt SvgDocumentHasAnimation( SvgDocumentHandle aDocumentHandle ); |
|
1951 |
|
1952 |
|
1953 // *********************************************************************** |
|
1954 // SVG Element |
|
1955 // *********************************************************************** |
|
1956 /** |
|
1957 * Create a new svg element based on the specified |
|
1958 * (<code>aType</code>) SVG tag name. Only the following elements must be supported: |
|
1959 * <rect>, <circle>, <ellipse>, <line>, |
|
1960 * <path> <use> <image> <text>, |
|
1961 * <a> and <g>. |
|
1962 * |
|
1963 * @since 1.0 |
|
1964 * @see org.w3c.dom.Document#createElementNS() |
|
1965 * @param aType |
|
1966 * @return handle to the newly created SVG Element. |
|
1967 */ |
|
1968 IMPORT_C SvgElementHandle SvgElementCreate( SvgAttrType aType ); |
|
1969 |
|
1970 /** |
|
1971 * Destroy svg element of the given handle. |
|
1972 * NOTE: Java doesn't use this method. |
|
1973 * |
|
1974 * @since 1.0 |
|
1975 * @param hElement Element handle |
|
1976 */ |
|
1977 IMPORT_C void SvgElementDestroy( SvgElementHandle hElement ); |
|
1978 |
|
1979 /** |
|
1980 * Returns a parent element of the given element. |
|
1981 * |
|
1982 * @since 1.0 |
|
1983 * @see org.w3c.dom.svg.SVGElement#getParentNode() |
|
1984 * @param aElementHandle Element handle |
|
1985 * @return The parent element or <code>NULL</code> if there is no parent |
|
1986 * (i.e. if a element has just been created and not yet added to the tree, |
|
1987 * or if it has been removed from the tree, this is null). |
|
1988 */ |
|
1989 IMPORT_C SvgElementHandle SvgElementGetParent( SvgElementHandle aElementHandle ); |
|
1990 |
|
1991 /** |
|
1992 * Returns the first child element node of the given element. |
|
1993 * Return <code>NULL</code> if this element has no child elements. |
|
1994 * |
|
1995 * @since 1.0 |
|
1996 * @see org.w3c.dom.svg.SVGElement#getFirstElementChild() |
|
1997 * @param aElementHandle Element handle |
|
1998 * @return The first child element node of the given element. |
|
1999 */ |
|
2000 IMPORT_C SvgElementHandle SvgElementGetFirstElementChild( SvgElementHandle aElementHandle ); |
|
2001 |
|
2002 /** |
|
2003 * Returns the next sibling element of the given element. |
|
2004 * Return <code>NULL</code> if the given element has no element sibling |
|
2005 * nodes that come after this one in the document tree. |
|
2006 * |
|
2007 * @since 1.0 |
|
2008 * @see org.w3c.dom.svg.SVGElement#getNextElementSibling() |
|
2009 * @param aElementHandle Element handle |
|
2010 * @return The next sibling element node of this element. |
|
2011 */ |
|
2012 IMPORT_C SvgElementHandle SvgElementGetNextElementSibling( SvgElementHandle aElementHandle ); |
|
2013 |
|
2014 /** |
|
2015 * Append the given child element to the given svg element. |
|
2016 * |
|
2017 * @since 1.0 |
|
2018 * @see org.w3c.dom.Node#appendChild() |
|
2019 * @param aElementHandle Element handle |
|
2020 * @param aChildElementHandle New child element handle |
|
2021 * @return Next sibling element |
|
2022 */ |
|
2023 IMPORT_C void SvgElementAppendChild( SvgElementHandle aElementHandle, |
|
2024 SvgElementHandle aChildElementHandle ); |
|
2025 |
|
2026 /** |
|
2027 * Remove the given child element from the given svg element. |
|
2028 * Elements that have ids cannot be removed from the tree. |
|
2029 * |
|
2030 * @since 1.0 |
|
2031 * @see org.w3c.dom.Node#removeChild() |
|
2032 * @param aElementHandle The parent element. |
|
2033 * @param aChildElementHandle The element that is to be removed |
|
2034 * TODO @return Handle to the removed element. Return <code>NULL</NULL> |
|
2035 * if operation failed. |
|
2036 */ |
|
2037 IMPORT_C SvgElementHandle SvgElementRemoveChild( SvgElementHandle aElementHandle, |
|
2038 SvgElementHandle aChildElementHandle ); |
|
2039 |
|
2040 /** |
|
2041 * Inserts <code>aChildElementHandle</code> before <code>aReferenceElementHandle</code> |
|
2042 * in the child list for the <code>aElementHandle</code>. If <code>aReferenceElementHandle</code> |
|
2043 * is <code>NULL</code>, <code>aChildElementHandle</code> is inserted at the end of the list. |
|
2044 * If the <code>aChildElementHandle</code> is already part of the tree, it is first removed. |
|
2045 * |
|
2046 * @since 1.0 |
|
2047 * @see org.w3c.dom.Node#insertBefore() |
|
2048 * @param aElementHandle The parent element. |
|
2049 * @param aChildElementHandle The child to add |
|
2050 * @param aReferenceElementHandle The child before which the new child should be added. |
|
2051 * @throws TODO Should throw exception if the <code>aChildElementHandle</code> would cause |
|
2052 * the SVG document to go into error, for ex: when the newChild contains a <use> |
|
2053 * element with an invalid xlink:href attribute. |
|
2054 */ |
|
2055 IMPORT_C void SvgElementInsertBefore( SvgElementHandle aElementHandle, |
|
2056 SvgElementHandle aChildElementHandle, |
|
2057 SvgElementHandle aReferenceElementHandle ); |
|
2058 |
|
2059 /** |
|
2060 * Request element type. The following element type are supported: |
|
2061 * <a>, <animate>, <animateColor>, <animateMotion>, |
|
2062 * <animateTransform> <circle> <defs> <ellipse>, |
|
2063 * <font>, <font-face>, <font-face-name>, <font-face-src>, |
|
2064 * <foreignObject>, <g>, <glyph>, <hkern>, <image>, |
|
2065 * <line>, <metadata>, <missing-glyph>, <metadata>, <mpath>. |
|
2066 * <path>, <polygon>, <polyline>, <rect>, <set>, |
|
2067 * <svg>, <switch>, <text>, <title>, <use>. |
|
2068 * |
|
2069 * @since 1.0 |
|
2070 * @see org.w3c.dom.svg.SVGElement |
|
2071 * @param aElementHandle The element. |
|
2072 * @return Element type. |
|
2073 */ |
|
2074 IMPORT_C TInt SvgElementGetType( SvgElementHandle aElementHandle ); |
|
2075 |
|
2076 /** |
|
2077 * Check if document has animation. |
|
2078 * NOTE: Java doesn't use this method. |
|
2079 * |
|
2080 * @since 1.0 |
|
2081 * @param aElementHandle SVG element handle |
|
2082 * @param TBool . ETrue if animation present otherwise EFalse. |
|
2083 */ |
|
2084 IMPORT_C TInt SvgElementHasAnimation( SvgElementHandle aElementHandle ); |
|
2085 |
|
2086 /** |
|
2087 * Get a string attribute from the given element. |
|
2088 * |
|
2089 * @since 1.0 |
|
2090 * @see org.w3c.dom.svg.SVGElement |
|
2091 * @param aElementHandle The element. |
|
2092 * @param aAttributeName Attribute's name |
|
2093 * @return Attribute value. |
|
2094 */ |
|
2095 IMPORT_C TInt SvgElementGetStringAttribute( SvgElementHandle aElementHandle, |
|
2096 SvgAttrType aAttributeName, TPtrC16& aStrAttribute ); |
|
2097 |
|
2098 /** |
|
2099 * Set a string attribute in the given element. |
|
2100 * |
|
2101 * @since 1.0 |
|
2102 * @see org.w3c.dom.svg.SVGElement |
|
2103 * @param aElementHandle The SVG element handle. |
|
2104 * @param aAttributeName Attribute's name |
|
2105 * @param aAttributeValue Atribute's value. |
|
2106 */ |
|
2107 IMPORT_C void SvgElementSetStringAttribute( SvgElementHandle aElementHandle, |
|
2108 SvgAttrType aAttributeName, |
|
2109 const TPtrC16& aAttributeValue ); |
|
2110 |
|
2111 /** |
|
2112 * Get a color attribute from the given element. |
|
2113 * The values are copied into the color components given. |
|
2114 * |
|
2115 * @since 1.0 |
|
2116 * @see org.w3c.dom.svg.SVGRGBColor |
|
2117 * @param aElementHandle The element handle. |
|
2118 * @param aAttributeName Attribute's name |
|
2119 * @param aRedValue The red value |
|
2120 * @param aGreenValue The green value |
|
2121 * @param aBlueValue The blue value |
|
2122 * @return Integer containing the RGB value for the color. |
|
2123 */ |
|
2124 IMPORT_C TInt SvgElementGetColorAttribute( SvgElementHandle aElementHandle, |
|
2125 SvgAttrType aAttribute, |
|
2126 TInt* aRedValue, TInt* aGreenValue, TInt* aBlueValue ); |
|
2127 |
|
2128 /** |
|
2129 * Set a color attribute for the given element. |
|
2130 * |
|
2131 * @since 1.0 |
|
2132 * @see org.w3c.dom.svg.SVGRGBColor |
|
2133 * @param aElementHandle The element. |
|
2134 * @param aAttribute Attribute's name |
|
2135 * @param aRedValue The red value |
|
2136 * @param aGreenValue The green value |
|
2137 * @param aBlueValue The blue value |
|
2138 */ |
|
2139 IMPORT_C void SvgElementSetColorAttribute( SvgElementHandle aElementHandle, |
|
2140 SvgAttrType aAttribute, |
|
2141 TInt aRedValue, TInt aGreenValue, TInt aBlueValue ); |
|
2142 |
|
2143 |
|
2144 /** |
|
2145 * Return a attribute (trait) value as float. |
|
2146 * |
|
2147 * @since 1.0 |
|
2148 * @see org.w3c.dom.svg.SVGElement#getFloatTrait() |
|
2149 * @param aElementHandle The element. |
|
2150 * @param aAttribute Attribute's (or trait's) name |
|
2151 * @return The attribute (or trait) value as float for the specified name. |
|
2152 */ |
|
2153 IMPORT_C TReal32 SvgElementGetFloatAttribute( SvgElementHandle aElementHandle, |
|
2154 SvgAttrType aAttribute ) __SOFTFP; |
|
2155 |
|
2156 /** |
|
2157 * Set the attribute (trait) value as float. |
|
2158 * |
|
2159 * @since 1.0 |
|
2160 * @see org.w3c.dom.svg.SVGElement#getFloatTrait() |
|
2161 * @param aElementHandle The element handle. |
|
2162 * @param aAttribute The name of the attribute (trait) to be set. |
|
2163 * @param aFloatValue The value of the attribute (trait) to be set as float. |
|
2164 */ |
|
2165 IMPORT_C void SvgElementSetFloatAttribute( SvgElementHandle aElementHandle, |
|
2166 SvgAttrType aAttribute, |
|
2167 TReal32 aFloatValue ) __SOFTFP; |
|
2168 |
|
2169 /** |
|
2170 * Set enum attribute (trait) value. |
|
2171 * |
|
2172 * @since 1.0 |
|
2173 * @see org.w3c.dom.svg.SVGElement |
|
2174 * @param aElementHandle The element handle. |
|
2175 * @param aAttribute The name of the attribute (trait) to be set. |
|
2176 * @param aValue The value of the attribute (trait) to be set. |
|
2177 */ |
|
2178 IMPORT_C void SvgElementSetEnumAttribute( SvgElementHandle aElementHandle, |
|
2179 SvgAttrType aAttribute, short aValue ); |
|
2180 |
|
2181 /** |
|
2182 * Get enum attribute (trait) value. |
|
2183 * |
|
2184 * @since 1.0 |
|
2185 * @see org.w3c.dom.svg.SVGElement |
|
2186 * @param aElementHandle The element handle. |
|
2187 * @param aAttribute The name of the attribute (trait). |
|
2188 * @return The value of the attribute (trait). |
|
2189 */ |
|
2190 IMPORT_C short SvgElementGetEnumAttribute( SvgElementHandle aElementHandle, |
|
2191 SvgAttrType aAttribute ); |
|
2192 |
|
2193 /** |
|
2194 * Return the rectangle attribute (trait) values. |
|
2195 * NOTE: The returned values are copies of the actual attribute (trait) values and |
|
2196 * will not change if the corresponding trait changes. |
|
2197 * |
|
2198 * @since 1.0 |
|
2199 * @see org.w3c.dom.svg.SVGElement#getRectTrait() |
|
2200 * @param aElementHandle The element handle. |
|
2201 * @param aRectAttribute The name of the attribute (trait) to retrieve. |
|
2202 * @param aX X coordinate. |
|
2203 * @param aY Y coordinate. |
|
2204 * @param aWidth Width. |
|
2205 * @param aHeight Height. |
|
2206 * @return <code>-1</code> if failed otherwise returns positive integer. |
|
2207 */ |
|
2208 IMPORT_C TInt SvgElementGetRectAttribute( SvgElementHandle aElementHandle, |
|
2209 SvgAttrType aRectAttribute, |
|
2210 TReal32* aX, TReal32* aY, TReal32* aWidth, TReal32* aHeight ) __SOFTFP; |
|
2211 |
|
2212 /** |
|
2213 * Set the rectangle attribute (trait) values. |
|
2214 * |
|
2215 * @since 1.0 |
|
2216 * @see org.w3c.dom.svg.SVGElement#setRectTrait() |
|
2217 * @param aElementHandle The element handle. |
|
2218 * @param aRectAttribute The name of the attribute (trait) to be set. |
|
2219 * @param aX X coordinate. |
|
2220 * @param aY Y coordinate. |
|
2221 * @param aWidth Width. |
|
2222 * @param aHeight Height. |
|
2223 */ |
|
2224 IMPORT_C void SvgElementSetRectAttribute( SvgElementHandle aElementHandle, |
|
2225 SvgAttrType aRectAttribute, |
|
2226 TReal32 aX, TReal32 aY, TReal32 aWidth, TReal32 aHeight ) __SOFTFP; |
|
2227 |
|
2228 /** |
|
2229 * Get the matrix attribute (trait) values. |
|
2230 * NOTE: The returned values are copies of the actual attribute (trait) values and |
|
2231 * will not change if the corresponding trait changes. |
|
2232 * <pre> |
|
2233 * [aAVal aCVal aEVal] |
|
2234 * [aBVal aDVal aFVal] |
|
2235 * </pre> |
|
2236 * |
|
2237 * @since 1.0 |
|
2238 * @see org.w3c.dom.svg.SVGElement#getMatrixTrait() |
|
2239 * @param aElementHandle The element handle. |
|
2240 * @param aMatrixAttribute The name of the attribute (trait) to retrieve. |
|
2241 * @param aAVal The x scaling component |
|
2242 * @param aBVal The y shearing component |
|
2243 * @param aCVal The x shearing component |
|
2244 * @param aDVal The y scaling component |
|
2245 * @param aEVal The x translation component |
|
2246 * @param aFVal The y translation component |
|
2247 * @return TODO |
|
2248 */ |
|
2249 IMPORT_C TInt SvgElementGetMatrixAttribute( SvgElementHandle aElementHandle, |
|
2250 SvgAttrType aMatrixAttribute, |
|
2251 TReal32* aAVal, TReal32* aBVal, TReal32* aCVal, |
|
2252 TReal32* aDVal, TReal32* aEVal, TReal32* aFVal ) __SOFTFP; |
|
2253 |
|
2254 /** |
|
2255 * Set the matrix attribute (trait) values. |
|
2256 * <pre> |
|
2257 * [aAVal aCVal aEVal] |
|
2258 * [aBVal aDVal aFVal] |
|
2259 * </pre> |
|
2260 * |
|
2261 * @since 1.0 |
|
2262 * @see org.w3c.dom.svg.SVGElement#setMatrixTrait() |
|
2263 * @param aElementHandle The element handle. |
|
2264 * @param aMatrixAttribute The name of the attribute (trait) to be set. |
|
2265 * @param aAVal The x scaling component |
|
2266 * @param aBVal The y shearing component |
|
2267 * @param aCVal The x shearing component |
|
2268 * @param aDVal The y scaling component |
|
2269 * @param aEVal The x translation component |
|
2270 * @param aFVal The y translation component |
|
2271 */ |
|
2272 IMPORT_C void SvgElementSetMatrixAttribute( SvgElementHandle aElementHandle, |
|
2273 SvgAttrType aMatrixAttribute, |
|
2274 TReal32 aAVal, TReal32 aBVal, TReal32 aCVal, |
|
2275 TReal32 aDVal, TReal32 aEVal, TReal32 aFVal ) __SOFTFP; |
|
2276 |
|
2277 /** |
|
2278 * Get the path attribute (trait)value. |
|
2279 * NOTE: The returned values are copies of the actual attribute values and will not change if |
|
2280 * the corresponding trait changes. |
|
2281 * |
|
2282 * @since 1.0 |
|
2283 * @see org.w3c.dom.svg.SVGElement#getPathTrait() |
|
2284 * @see org.w3c.dom.svg.SVGPath |
|
2285 * @param aElementHandle The element handle. |
|
2286 * @param aPathAttribute The name of the attribute (trait) to retrieve. |
|
2287 * @return The handle to path object. <code>NULL</code> if not successed. |
|
2288 */ |
|
2289 IMPORT_C TInt SvgElementGetPathAttribute( SvgElementHandle aElementHandle, |
|
2290 SvgAttrType aPathAttribute ); |
|
2291 |
|
2292 /** |
|
2293 * Set the path attribute (trait) value. |
|
2294 * NOTE: Value is a copy in the trait so subsequent changes to the given |
|
2295 * <code>aPathHandle</code> have no effect on the value of the attribute (trait). |
|
2296 * |
|
2297 * @since 1.0 |
|
2298 * @see org.w3c.dom.svg.SVGElement#setPathTrait() |
|
2299 * @see org.w3c.dom.svg.SVGPath |
|
2300 * @param aElementHandle The element handle. |
|
2301 * @param aPathAttribute The name of the attribute (trait) to be set. |
|
2302 * @param aPathHandle The value of the attribute (trait) to be set as. |
|
2303 */ |
|
2304 IMPORT_C void SvgElementSetPathAttribute( SvgElementHandle aElementHandle, |
|
2305 SvgAttrType aPathAttribute , SvgPathHandle aPathHandle); |
|
2306 |
|
2307 /** |
|
2308 * Returns the tight bounding box in current user coordinate space. |
|
2309 * Tight bounding box is the smallest possible rectangle that includes the geometry |
|
2310 * of all contained graphics elements excluding stroke. |
|
2311 * The calculation is done in the user coordinate space of the element. When bounding box |
|
2312 * is calculated elements with display property (trait) set to none are ignored. |
|
2313 * Exact rules for the bounding box calculation are given in the |
|
2314 * <a href="http://www.w3.org/TR/SVG/coords.html#ObjectBoundingBox">SVG spec</a>. |
|
2315 * |
|
2316 * @since 1.0 |
|
2317 * @see org.w3c.dom.svg.SVGLocatableElement#getBBox() |
|
2318 * @param aElementHandle The element handle. |
|
2319 * @param aAttributeType The name of the attribute (trait) to retrieve. |
|
2320 * @param aX X coordinate. |
|
2321 * @param aY Y coordinate. |
|
2322 * @param aWidth Width. |
|
2323 * @param aHeight Height. |
|
2324 */ |
|
2325 IMPORT_C void SvgElementGetBBox( SvgElementHandle aElementHandle, |
|
2326 SvgAttrType aAttributeType, |
|
2327 TReal32* aX, TReal32* aY, TReal32* aWidth, TReal32* aHeight ) __SOFTFP; |
|
2328 |
|
2329 /** |
|
2330 * Add event listener to the given element. |
|
2331 * Note: need to replace void* with specific class |
|
2332 * NOTE: Java doesn't use this method. |
|
2333 * |
|
2334 * @since 1.0 |
|
2335 * @param aElementHandle The element handle. |
|
2336 * @param aListener Listener |
|
2337 * @param aType Type |
|
2338 */ |
|
2339 IMPORT_C void SvgElementAddEventListener( SvgElementHandle aElementHandle, |
|
2340 TInt aListener, SvgAttrType aType ); |
|
2341 |
|
2342 /** |
|
2343 * Remove event listener from the given element. |
|
2344 * Note: need to replace void* with specific class |
|
2345 * NOTE: Java doesn't use this method. |
|
2346 * |
|
2347 * @since 1.0 |
|
2348 * @param aElementHandle The element handle. |
|
2349 * @param aListener Listener |
|
2350 * @param aType Type |
|
2351 */ |
|
2352 IMPORT_C void SvgElementRemoveEventListener( SvgElementHandle aElementHandle, |
|
2353 TInt aListener, SvgAttrType aType ); |
|
2354 /** |
|
2355 * Check if element is active. |
|
2356 * i.e. an animation element is active in these cases: |
|
2357 * <ul> |
|
2358 * <li> |
|
2359 * A media time is 1s. |
|
2360 * <pre> |
|
2361 * <rect id=<element> x=<0> y=<20> width=<20> height=<20>> |
|
2362 <animate id=<animationElement> attributeName=<x> attributeType=<XML> |
|
2363 begin=<1s> dur=<4s> end=<2s> fill=<freeze> |
|
2364 from=<0> to=<80> |
|
2365 </animate> |
|
2366 </rect> |
|
2367 * </pre> |
|
2368 * </li> |
|
2369 * <li> |
|
2370 * A media time is 2s. |
|
2371 * <pre> |
|
2372 * <rect id=<element> x=<0> y=<20> width=<20> height=<20>> |
|
2373 <animate id=<animationElement> attributeName=<x> attributeType=<XML> |
|
2374 begin=<1s> dur=<4s> end=<2s> fill=<freeze> |
|
2375 from=<0> to=<80> |
|
2376 </animate> |
|
2377 </rect> |
|
2378 * </pre> |
|
2379 * </li> |
|
2380 * </ul> |
|
2381 * |
|
2382 * @since 1.0 |
|
2383 * @see org.w3c.dom.svg.SVGAnimationElement#endElementAt() |
|
2384 * @param aElementHandle The element handle. |
|
2385 * @return Positive integer if element is active. |
|
2386 */ |
|
2387 IMPORT_C TInt SvgElementIsActive( SvgElementHandle aElementHandle ); |
|
2388 |
|
2389 /** |
|
2390 * Check if the given element is removable (no id or children with ids). |
|
2391 * |
|
2392 * @since 1.0 |
|
2393 * @see org.w3c.dom.Node#removeChild() |
|
2394 * @param aElementHandle The element handle. |
|
2395 * @return Positive integer if element is removeable. |
|
2396 */ |
|
2397 IMPORT_C TInt SvgElementCheckRemoveable( SvgElementHandle aElementHandle ); |
|
2398 |
|
2399 // *********************************************************************** |
|
2400 // SVG Path |
|
2401 // *********************************************************************** |
|
2402 /** |
|
2403 * Creates new path object that is empty. |
|
2404 * This object can be used to modify value of path traits |
|
2405 * |
|
2406 * @since 1.0 |
|
2407 * @see org.w3c.dom.svg.SVGSVGElement#createSVGPath() |
|
2408 * @see org.w3c.dom.svg.SVGPath |
|
2409 * @return The newly created path object handle with empty path commands. |
|
2410 */ |
|
2411 IMPORT_C SvgPathHandle SvgPathCreate(); |
|
2412 |
|
2413 /** |
|
2414 * Destroy the specified path path |
|
2415 * |
|
2416 * @since 1.0 |
|
2417 * @see org.w3c.dom.svg.SVGPath |
|
2418 * @param aPathHandle Handle to the path to be deleted. |
|
2419 */ |
|
2420 IMPORT_C void SvgPathDestroy( SvgPathHandle aPathHandle ); |
|
2421 |
|
2422 /** |
|
2423 * Get the segment count of the given path. |
|
2424 * |
|
2425 * @since 1.0 |
|
2426 * @see org.w3c.dom.svg.SVGPath#getNumberOfSegments() |
|
2427 * @param aPathHandle The path handle. |
|
2428 * @return Segment count |
|
2429 */ |
|
2430 IMPORT_C TInt SvgPathGetSegmentCount( SvgPathHandle aPathHandle ); |
|
2431 |
|
2432 /** |
|
2433 * Returns segment command by zero-based command index. |
|
2434 * Returns one of <code>MOVE_TO</code>, <code>LINE_TO</code>, |
|
2435 * <code>CURVE_TO</code>, <code>QUAD_TO</code> or <code>CLOSE</code>. |
|
2436 * |
|
2437 * @since 1.0 |
|
2438 * @see org.w3c.dom.svg.SVGPath#getSegment() |
|
2439 * @param aPathHandle The path handle. |
|
2440 * @param aSegmentIndex The command index for the segment command to retrieve. |
|
2441 * @return The segment command for the specified aSegmentIndex. |
|
2442 */ |
|
2443 IMPORT_C TInt SvgPathGetSegmentType( SvgPathHandle aPathHandle, TInt aSegmentIndex ); |
|
2444 |
|
2445 /** |
|
2446 * Returns segment parameter by zero-based command index and zero-based parametr index. |
|
2447 * |
|
2448 * @since 1.0 |
|
2449 * @see org.w3c.dom.svg.SVGPath#getSegmentParameter() |
|
2450 * @param aPathHandle The path handle. |
|
2451 * @param aSegmentIndex The command index for the segment command to retrieve. |
|
2452 * @param aSegmentParameterIndex The parameter index for the segment parameter to retrieve. |
|
2453 * @return the segment parameter for the specified aSegmentIndex and aSegmentParameterIndex. |
|
2454 */ |
|
2455 IMPORT_C TReal32 SvgPathGetSegmentParameter( SvgPathHandle aPathHandle, |
|
2456 TInt aSegmentIndex, |
|
2457 TInt aSegmentParameterIndex ) __SOFTFP; |
|
2458 |
|
2459 /** |
|
2460 * Appends 'M' (absolute move) segment to the path with the specified coordinates. |
|
2461 * |
|
2462 * @since 1.0 |
|
2463 * @see org.w3c.dom.svg.SVGPath#moveTo() |
|
2464 * @param aPathHandle The path handle. |
|
2465 * @param aX The x-axis coordinate for the specified point. |
|
2466 * @param aY The y-axis coordinate for the specified point. |
|
2467 */ |
|
2468 IMPORT_C void SvgPathAddMoveTo( SvgPathHandle aPathHandle, TReal32 aX, TReal32 aY ) __SOFTFP; |
|
2469 |
|
2470 /** |
|
2471 * Appends 'L' (absolute line) segment to the path with the specified coordinates. |
|
2472 * |
|
2473 * @since 1.0 |
|
2474 * @see org.w3c.dom.svg.SVGPath#moveTo() |
|
2475 * @param aPathHandle The path handle. |
|
2476 * @param aX The x-axis coordinate for the specified point. |
|
2477 * @param aY The y-axis coordinate for the specified point. |
|
2478 */ |
|
2479 IMPORT_C void SvgPathAddLineTo( SvgPathHandle aPathHandle, TReal32 aX, TReal32 aY ) __SOFTFP; |
|
2480 |
|
2481 /** |
|
2482 * Appends 'Q' (absolute quadratic curve) segment to the path. |
|
2483 * |
|
2484 * @since 1.0 |
|
2485 * @see org.w3c.dom.svg.SVGPath#quadTo() |
|
2486 * @param aPathHandle The path handle. |
|
2487 * @param aX1 the x-axis coordinate of the first control point. |
|
2488 * @param aY1 the y-axis coordinate of the first control point. |
|
2489 * @param aX2 the x-axis coordinate of the final end point. |
|
2490 * @param aY2 the y-axis coordinate of the final end point. |
|
2491 * |
|
2492 */ |
|
2493 IMPORT_C void SvgPathAddQuadTo( SvgPathHandle aPathHandle, |
|
2494 TReal32 aX1, TReal32 aY1, |
|
2495 TReal32 aX2, TReal32 aY2 ) __SOFTFP; |
|
2496 |
|
2497 /** |
|
2498 * Appends 'C' (absolute cubic curve) segment to the path. |
|
2499 * |
|
2500 * @since 1.0 |
|
2501 * @see org.w3c.dom.svg.SVGPath#curveTo() |
|
2502 * @param aPathHandle The path handle. |
|
2503 * @param aX1 the x-axis coordinate of the first control point. |
|
2504 * @param aY1 the y-axis coordinate of the first control point. |
|
2505 * @param aX2 the x-axis coordinate of the second end point. |
|
2506 * @param aY2 the y-axis coordinate of the second end point. |
|
2507 * @param aX3 the x-axis coordinate of the final end point. |
|
2508 * @param aY3 the y-axis coordinate of the final end point. |
|
2509 * |
|
2510 */ |
|
2511 IMPORT_C void SvgPathAddCurveTo( SvgPathHandle aPathHandle, |
|
2512 TReal32 aX1, TReal32 aY1, |
|
2513 TReal32 aX2, TReal32 aY2, |
|
2514 TReal32 aX3, TReal32 aY3 ) __SOFTFP; |
|
2515 /** |
|
2516 * Appends 'Z' (close path) segment to the path |
|
2517 * |
|
2518 * @since 1.0 |
|
2519 * @see org.w3c.dom.svg.SVGPath#close() |
|
2520 * @param aPathHandle The path handle. |
|
2521 */ |
|
2522 IMPORT_C void SvgPathAddClose( SvgPathHandle aPathHandle ); |
|
2523 |
|
2524 /** |
|
2525 * Update path info. |
|
2526 * NOTE: Java doesn't use this method. |
|
2527 * |
|
2528 * @since 1.0 |
|
2529 * @param aElementHandle The element handle. |
|
2530 * @param aPathHandle The path handle. |
|
2531 */ |
|
2532 IMPORT_C void SvgElementUpdatePath( SvgElementHandle aElementHandle, SvgPathHandle aPathHandle ); |
|
2533 |
|
2534 /** |
|
2535 * Find whether the element is present in a document. |
|
2536 * |
|
2537 * @since 1.0 |
|
2538 * @param hDocument The SVG document handle. |
|
2539 * @param hElement The element handle. |
|
2540 * @return Positive integer if the element presents in the given SVG document. |
|
2541 */ |
|
2542 IMPORT_C TInt SvgElementElementInDOM ( TInt hDocument, TInt hElement ); |
|
2543 |
|
2544 /** |
|
2545 * Checks whether this element is child of a use element. |
|
2546 * |
|
2547 * @since 1.0 |
|
2548 * @see javax.microedition.m2g.SVGImage#dispatchMouseEvent() |
|
2549 * @param hElement The element handle. |
|
2550 * @return Postivive integer if the element is child of a use element. |
|
2551 */ |
|
2552 IMPORT_C TInt SvgElementIsUsed ( TInt hElement ); |
|
2553 |
|
2554 /** |
|
2555 * Finds the handle to the actual cloned element. |
|
2556 * |
|
2557 * @since 1.0 |
|
2558 * @see javax.microedition.m2g.SVGImage#dispatchMouseEvent() |
|
2559 * @param hElement aElement This is handle to the cloned element. this is child of the |
|
2560 * <use> element. |
|
2561 * @return Element handle to the actual element, which is cloned. |
|
2562 */ |
|
2563 IMPORT_C TInt SvgElementGetUsedFromElement ( TInt hElement ); |
|
2564 |
|
2565 /** |
|
2566 * Gets a screen bounding box for the given element. |
|
2567 * Returns the tight bounding box in screen coordinate space. Tight bounding box is the smallest |
|
2568 * possible rectangle that includes the geometry of all contained graphics elements excluding |
|
2569 * stroke. The box coordinates are in the screen coordinate space, which is connected to the |
|
2570 * current user coordinate space by the matrix returned by <code>SvgElementGetMatrixAttribute</code> |
|
2571 * (with attribute id=<svg>). |
|
2572 * |
|
2573 * @since 1.0 |
|
2574 * @see org.w3c.dom.svg.SVGLocatableElement#getScreenBBox() |
|
2575 * @see org.w3c.dom.svg.SVGLocatableElement#getScreenCTM() |
|
2576 * @param hElement The element handle. |
|
2577 */ |
|
2578 IMPORT_C void SvgElementGetScreenBBox( TInt hElement, TReal32* x,TReal32* y, TReal32* w, TReal32* h ) __SOFTFP; |
|
2579 |
|
2580 /** |
|
2581 * Set the focus out of the given element. |
|
2582 * The initial focus is always <code>null</code> and setting |
|
2583 * <code>NULL</code> will remove the current focus. |
|
2584 * NOTE: Java doesn't use this method. |
|
2585 * |
|
2586 * @since 1.0 |
|
2587 * @see javax.microedition.m2g.SVGImage#focusOut() |
|
2588 * @param aDocumentHandle SVG document handle |
|
2589 * @param aElementHandle The element for which to set the focus out. |
|
2590 |
|
2591 * changes made for Focus-in/focus-out bug(AMIA-6T8EEG) |
|
2592 */ |
|
2593 IMPORT_C void CSvgJavaInterfaceImpl::SvgDocumentFocusOut( SvgDocumentHandle aDocumentHandle, |
|
2594 SvgElementHandle aElementHandle); |
|
2595 |
|
2596 /* |
|
2597 * Maps the PATH segment type from SVG to JSR. |
|
2598 */ |
|
2599 |
|
2600 TInt MapSegmentType(TInt aSvgSegmentType); |
|
2601 |
|
2602 /* |
|
2603 * LISTENER IMPLEMENTATIONS FROM THE ENGINE |
|
2604 */ |
|
2605 |
|
2606 TBool MouseEntered( RPointerArray<CSvgElementImpl>& aElements, TInt aX, TInt aY ); |
|
2607 |
|
2608 TBool MouseExited( RPointerArray<CSvgElementImpl>& aElements, TInt aX, TInt aY ); |
|
2609 |
|
2610 TBool MouseMoved( RPointerArray<CSvgElementImpl>& aElements, TInt aX, TInt aY ); |
|
2611 |
|
2612 TBool MousePressed( RPointerArray<CSvgElementImpl>& aElements, TInt aX, TInt aY ); |
|
2613 |
|
2614 TBool MouseReleased( RPointerArray<CSvgElementImpl>& aElements, TInt aX, TInt aY ); |
|
2615 |
|
2616 public: |
|
2617 CSvgDocumentImpl* iTempDoc; |
|
2618 |
|
2619 private: |
|
2620 |
|
2621 TBool IsAnimationElemId( const TInt aElementId ); |
|
2622 /** |
|
2623 * Gets The corresponding JSR-to-SVG element id. Ids of the elements differ in the svg |
|
2624 * engine and the JSR-API's. |
|
2625 */ |
|
2626 TInt SvgGetElementTypeMappingJSRtoSVG( SvgAttrType aType ); |
|
2627 /** |
|
2628 * Gets The corresponding SVG-to-JSR element id. Ids of the elements differ in the svg |
|
2629 * engine and the JSR-API's. |
|
2630 */ |
|
2631 SvgAttrType SvgGetElementTypeMappingSVGtoJSR( const TInt aElementId); |
|
2632 |
|
2633 /** |
|
2634 * Gets the attribute type mapping from SVG to JSR. Attribute t |
|
2635 * |
|
2636 */ |
|
2637 SvgAttrType SvgGetAttributeTypeMappingSVGtoJSR( const TInt aElementId); |
|
2638 /** |
|
2639 * Gets the attribute type mapping from JSR to SVG. Attribute t |
|
2640 * |
|
2641 */ |
|
2642 TInt SvgGetAttributeTypeMappingJSRtoSVG( SvgAttrType aType ); |
|
2643 /** |
|
2644 * Gets the Enumeration value mapping from JSR to SVG. Attribute t |
|
2645 * |
|
2646 */ |
|
2647 TInt SvgEnumerationMappingJSRtoSVG(const TInt aAttributeId, TInt aJsrEnumValue); |
|
2648 /** |
|
2649 * Gets the Enumeration value to string mapping from JSR to SVG. Attribute t |
|
2650 * |
|
2651 */ |
|
2652 TInt SvgEnumerationtoStringMappingJSRtoSVG(const TInt aAttributeId, short aJsrEnumValue, TDes& aValue); |
|
2653 /** |
|
2654 * Gets the string to enumeration value mapping from SVG to JSR. Attribute t |
|
2655 * |
|
2656 */ |
|
2657 TInt SvgStringtoEnumerationMappingSVGtoJSR(const TInt aAttrbuteId , TPtrC16 aValue); |
|
2658 /** |
|
2659 * Gets the Enumeration value mapping from JSR to SVG. Attribute t |
|
2660 * |
|
2661 */ |
|
2662 TInt SvgEnumerationMappingSVGtoJSR(const TInt aAttributeId, TInt32 aSvgEnumValue); |
|
2663 |
|
2664 private: |
|
2665 CSvgJavaInterfaceImpl(); |
|
2666 void ConstructL( TFontSpec& aFontSpec ); |
|
2667 void ConstructL(); |
|
2668 |
|
2669 private: |
|
2670 |
|
2671 }; |
|
2672 |
|
2673 #endif |