class CSvgJavaInterfaceImpl : public CSvgEngineInterfaceImpl |
the SVG Document operations
the SVG Element operations
SVG Document
/** The SVG Document represents an XML Document.
The SVG Document is a subset of the Document interface defined in the DOM Level 3 Core. Description of an SVG element in the document tree. Element's id can be set only if it does not already have an id. Elements with non-null id can be inserted, but cannot be removed from the DOM tree.
An SVG element's "traits" value can be read and manipulated. Each trait corresponds to an attribute or property,which is parsed and understood by the element and in most cases animatable. Unlike attributes, each element has a well-defined set of traits and attempting to access undefined trait is an error. Also unlike attributes traits are typed and their values are normalized; for instance SVG path specification is parsed and all path commands are converted to their absolute variants, it is not possible to say through the value of the trait if a path command was absolute or relative. When getting and setting trait values, accessor of the correct type must be used or exception will be thrown.
Initial trait values come from parsing corresponding attributes. If value is not specified, but corresponing attribute (or property for environments where styling is supported) is inherited, inherited value is returned as a result of the trait query method. If it is not inherited, default value is returned. Default values are also returned in the case when there is no parent to inherit from, for ex: when you create a new element, set a trait value to 'inherit', but there is no parent for inheritance. It is important to note that the value which is returned is always a base value (i.e. before animation is applied), and this is true for both static and animated content.
Setting a trait value has the same effect as changing a corresponding attribute, but trait setters can operate on typed values. The value which is modified is always a base value. For inheritable traits the trait value can always be set to "inherit" (but querying the value will always return the actual inherited value as explained above).
Traits supported in this specification, SVG Tiny 1.1 DOM
The table below shows the list of attributes and properties that SVG Tiny DOM 1.1 implementations must support. Each light gray section lists one or multiple elements for which the subsequent attributes or properties apply. Each attribute row lists the allowed getter and setter (s). The last column specifies the default values that must be used for each attribute or property.
Note: For 'REQUIRED' attributes, there are two cases:
i) The document is in error, if this attribute was not present at the time of loading.
ii) When using uDOM API, the specified default value (in parenthesis) must be used.
Property
Trait Getter [possible return value(s)]
Trait Setter [allowed value(s)]
Default Values
<svg>, <rect>, <circle>, <ellipse>, <line>, <path>, <g>, <image>, <text>, <a>, and <use>
color
getRGBColorTrait [SVGRGBColor]
setTrait [inherit]setRGBColorTrait [SVGRGBColor]
rgb(0,0,0)
display
getTrait [inline | none ]
setTrait [inline | none | inherit ]
"inline"
fill
getRGBColorTrait [null, SVGRGBColor]
setRGBColorTrait [SVGRGBColor]setTrait(none | currentColor | inherit)
rgb(0,0,0)
fill-rule
getTrait [nonzero | evenodd]
setTrait [nonzero | evenodd | inherit]
"nonzero"
stroke
getRGBColorTrait [null, SVGRGBColor]
setRGBColorTrait [SVGRGBColor]setTrait [none | currentColor | inherit]
"none"
stroke-dashoffset
getFloatTrait
setTrait [inherit]setFloatTrait
0.0f
stroke-linecap
getTrait [butt | round | square]
setTrait [butt | round | square | inherit]
"butt"
stroke-linejoin
getTrait [miter | round | bevel ]
setTrait [miter | round | bevel | inherit]
"miter"
stroke-miterlimit
getFloatTrait [ value >= 1]
setTrait [inherit]setFloatTrait [value >= 1]
4.0f
stroke-width
getFloatTrait [value >= 0]
setTrait [inherit] setFloatTrait [value >= 0]
1.0f
visibility
getTrait [visible | hidden]
setTrait [visible | hidden | inherit]
"visible"
<svg>, <text>, <g>, <a>, and <use>;
font-family
getTrait [single, computed font-family value]
setTrait [same syntax as font-family attribute]
User-Agent
font-size
getFloatTrait [value >= 0]
setFloatTrait [value >= 0]setTrait [inherit]
User-Agent
font-style
getTrait [normal | italic | oblique ]
setTrait [normal | italic | oblique | inherit]
"normal"
font-weight
getTrait [100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 ]
setTrait [normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit]
"normal"
text-anchor
getTrait [start | middle | end]
setTrait [start | middle | end | inherit ]
"start"
Attribute
Trait Getter
Trait Setter
Default Values
<rect>, <circle>, <ellipse>, <line>, <path>, <g>, <image>, <text>, <a>, and <use>
transform
getMatrixTrait [SVGMatrix]
setMatrixTrait [SVGMatrix]
Identity matrix (1,0,0,1,0,0)
<rect>
height
getFloatTrait [ value >= 0]
setFloatTrait [ value >= 0]
REQUIRED(0.0f)
width
getFloatTrait [ value >= 0]
setFloatTrait [ value >= 0]
REQUIRED(0.0f)
x
getFloatTrait
setFloatTrait
0.0f
y
getFloatTrait
setFloatTrait
0.0f
rx
getFloatTrait [value >= 0]
setFloatTrait [value >= 0]
0.0f
ry
getFloatTrait [value >= 0]
setFloatTrait [value >= 0]
0.0f
<circle>
cx
getFloatTrait
setFloatTrait
0.0f
cy
getFloatTrait
setFloatTrait
0.0f
r
getFloatTrait [ value >= 0]
setFloatTrait [value >= 0]
REQUIRED(0.0f)
<ellipse>
cx
getFloatTrait
setFloatTrait
0.0f
cy
getFloatTrait
setFloatTrait
0.0f
rx
getFloatTrait [value >= 0]
setFloatTrait [value >= 0]
REQUIRED(0.0f)
ry
getFloatTrait [value >= 0]
setFloatTrait [value >= 0]
REQUIRED(0.0f)
<line>
x1
getFloatTrait
setFloatTrait
0.0f
x2
getFloatTrait
setFloatTrait
0.0f
y1
getFloatTrait
setFloatTrait
0.0f
y2
getFloatTrait
setFloatTrait
0.0f
<path> (path-length is not supported)
d
getPathTrait [SVGPath]
setPathTrait [SVGPath]
REQUIRED<br>(Empty SVGPath)
<image>
x
getFloatTrait
setFloatTrait
0.0f
y
getFloatTrait
setFloatTrait
0.0f
width
getFloatTrait [value >= 0]
setFloatTrait [value >= 0]
REQUIRED(0.0f)
height
getFloatTrait [value >= 0]
setFloatTrait [value >= 0]
REQUIRED(0.0f)
xlink:href
getTrait NS[absolute URI]
setTraitNS [non local-URI value]
REQUIRED( "" )
<use>
x
getFloatTrait
setFloatTrait
0.0f
y
getFloatTrait
setFloatTrait
0.0f
xlink:href
getTraitNS[absolute URI]
setTraitNS
""
<a>
target
getTrait
setTrait
""
xlink:href
getTraitNS[absolute URI]
setTraitNS
""
<text>(Notes: For 'x' and 'y', it is only possible to provide floating point scalar values; an array of x or y values is not supported. 'rotate' attribute is not supported.)
x
getFloatTrait
setFloatTrait
0.0f
y
getFloatTrait
setFloatTrait
0.0f
text
getTrait [not null]
setTrait [not null]
""
<svg>
version
getTrait
Not available (readonly)
"1.1"
baseProfile
getTrait
Not available (readonly)
"tiny"
viewBox
getRectTrait [null, SVGRect]
setRectTrait [SVGRect]
null
zoomAndPan
getTrait [disable | magnify]
setTrait [disable | magnify]
"magnify"
</tbody>
An SVG Path datatype is used to define the path geometry. Corresponds to SVG path specification or the "d" attribute.
The native implementations must support the following simplifications or canonicalization of path segments. Any simplifications should be lossless.
Relative commands (c, h, l, m, q, s, t, and v) must be converted to their absolute counterparts
Horizontal and Vertical lines (H, h, V, and v) must be converted to general lines (L and l)
Translate command S to command C
Translate command T to command Q.
Private Member Functions | |
---|---|
CSvgJavaInterfaceImpl() | |
void | ConstructL(TFontSpec &) |
void | ConstructL() |
TBool | IsAnimationElemId(const TInt) |
TInt | SvgEnumerationMappingJSRtoSVG(const TInt, TInt) |
TInt | SvgEnumerationMappingSVGtoJSR(const TInt, TInt32) |
TInt | SvgEnumerationtoStringMappingJSRtoSVG(const TInt, short, TDes &) |
TInt | SvgGetAttributeTypeMappingJSRtoSVG(SvgAttrType) |
SvgAttrType | SvgGetAttributeTypeMappingSVGtoJSR(const TInt) |
TInt | SvgGetElementTypeMappingJSRtoSVG(SvgAttrType) |
SvgAttrType | SvgGetElementTypeMappingSVGtoJSR(const TInt) |
TInt | SvgStringtoEnumerationMappingSVGtoJSR(const TInt, TPtrC16) |
Public Attributes | |
---|---|
CSvgDocumentImpl * | iTempDoc |
IMPORT_C | ~CSvgJavaInterfaceImpl | ( | ) |
Destruct an instance of CSvgJavaInterfaceImpl
void | ConstructL | ( | TFontSpec & | aFontSpec | ) | [private] |
TFontSpec & aFontSpec |
void | ConstructL | ( | ) | [private] |
This method is a special case "ConstructL" method used for polymorphic DLL loading, which enforces this method to be public.
TBool | IsAnimationElemId | ( | const TInt | aElementId | ) | [private] |
Tells if the element id is an animation or not.
const TInt aElementId |
TBool | MouseEntered | ( | RPointerArray< CSvgElementImpl > & | aElements, |
TInt | aX, | |||
TInt | aY | |||
) |
RPointerArray< CSvgElementImpl > & aElements | |
TInt aX | |
TInt aY |
TBool | MouseExited | ( | RPointerArray< CSvgElementImpl > & | aElements, |
TInt | aX, | |||
TInt | aY | |||
) |
RPointerArray< CSvgElementImpl > & aElements | |
TInt aX | |
TInt aY |
TBool | MouseMoved | ( | RPointerArray< CSvgElementImpl > & | aElements, |
TInt | aX, | |||
TInt | aY | |||
) |
RPointerArray< CSvgElementImpl > & aElements | |
TInt aX | |
TInt aY |
TBool | MousePressed | ( | RPointerArray< CSvgElementImpl > & | aElements, |
TInt | aX, | |||
TInt | aY | |||
) |
RPointerArray< CSvgElementImpl > & aElements | |
TInt aX | |
TInt aY |
TBool | MouseReleased | ( | RPointerArray< CSvgElementImpl > & | aElements, |
TInt | aX, | |||
TInt | aY | |||
) |
RPointerArray< CSvgElementImpl > & aElements | |
TInt aX | |
TInt aY |
IMPORT_C CSvgJavaInterfaceImpl * | NewL | ( | TFontSpec & | aFontSpec | ) | [static] |
Construct an instance of CSvgJavaInterfaceImpl
TFontSpec & aFontSpec |
IMPORT_C void | SvgDocumentActivate | ( | SvgDocumentHandle | aDocumentHandle | ) |
Activate the element that has the focus. NOTE: Java doesn't use this method.
SvgDocumentHandle aDocumentHandle | SVG document handle |
IMPORT_C void | SvgDocumentBeginElementAt | ( | SvgDocumentHandle | aDocumentHandle, |
SvgElementHandle | aElementHandle, | |||
TReal32 | aOffsetTime | |||
) |
Set the begin animation time for the given element in the given SVG document. The new time is added to the begin instance times list.
SvgDocumentHandle aDocumentHandle | SVG document handle |
SvgElementHandle aElementHandle | Element handle |
TReal32 aOffsetTime | The time in seconds at which to begin the element. |
IMPORT_C SvgDocumentHandle | SvgDocumentCreateEmpty | ( | ) |
Create an empty svg document. NOTE: Java doesn't use this method. Java side uses the SvgDocumentCreateL method to create an empty SVG document that contains a root <svg> element with default viewport size of 100x100.
IMPORT_C SvgDocumentHandle | SvgDocumentCreateL | ( | const TPtrC16 & | aString | ) |
the SVG document does not conform to the XML 1.0 specification
an element has an attribute or property value which is not permissible according to the SVG specification
the required or mandatory attributes according to the SVG specification are missing
the document contains circular references on the <use> element
the document contains <image> element(s) with local references
the document contains elements with duplicate Id's
the document contains animation(s) in error
The native engine might be invoked for any external resource referenced in the document by calling the SvgDocumentRequestCompleted. However, please note that data URIs (for ex: base64 encoded images like <image xlink:href="data:image/png;base64,/9j/4AAQ..."/>) are required to be decoded by the native engine. The engine must only make one call if there exist multiple resources with the same URI.
If a svg document contains external resources and SvgDocumentRequestCompleted is not called then the engine's default implementation is used automatically, but it might not be able to load all of external resources. For example, if the svg document is loaded from a file in a Jar file, the implementation will not be able to load images that have relative URIs (ex; <image xlink:href="myImage.png" />).
When changing the xlink:href attribute of an existing <image> element that is already hooked or part of the tree.
When creating a new <image>, setting its xlink:href and hooking it to the document tree.
MJavaError | if an error occurs while loading the content. |
const TPtrC16 & aString | The string from which the SVG content should be read |
IMPORT_C void | SvgDocumentDestroy | ( | SvgDocumentHandle | aDocumentHandle | ) |
Destroy the given svg document (by handle). NOTE: Java MIDlet could use multiple documents.
SvgDocumentHandle aDocumentHandle | Document handle. |
IMPORT_C SvgElementHandle | SvgDocumentDispatchMouseEvent | ( | SvgDocumentHandle | aDocumentHandle, |
TInt | aMouseX, | |||
TInt | aMouseY | |||
) |
Request a mouse event at the given coordinate. This method is used to dispatch a mouse "click" event to the given document. The mouse position is given as screen coordinates aMouseX, aMouseY. If the aMouseX, aMouseY values are outside the viewport area or no target is available for the aMouseX, aMouseY coordinates, the event is not dispatched.
SvgDocumentHandle aDocumentHandle | SVG document handle |
TInt aMouseX | The y location of the mouse/pointer in viewport coordinate system. |
TInt aMouseY |
IMPORT_C void | SvgDocumentEndElementAt | ( | SvgDocumentHandle | aDocumentHandle, |
SvgElementHandle | aElementHandle, | |||
TReal32 | aOffsetTime | |||
) |
Set the end animation time for the given element in the given SVG document. The new time is added to the end instance times list. NOTE: Native engine checks the element is active before set the new end time.
SvgDocumentHandle aDocumentHandle | SVG document handle |
SvgElementHandle aElementHandle | Element handle |
TReal32 aOffsetTime | The time in seconds at which to end the element. |
IMPORT_C void | SvgDocumentFocusOn | ( | SvgDocumentHandle | aDocumentHandle, |
SvgElementHandle | aElementHandle | |||
) |
Set the given element to have the focus in the given SVG document. The initial focus is always null and setting NULL will remove the current focus. NOTE: Java doesn't use this method.
Set the given element to have the focus.
SvgDocumentHandle aDocumentHandle | SVG document handle |
SvgElementHandle aElementHandle | The element to set the focus on. |
IMPORT_C void | SvgDocumentFocusOut | ( | SvgDocumentHandle | aDocumentHandle, |
SvgElementHandle | aElementHandle | |||
) |
Set the focus out of the given element. The initial focus is always null and setting NULL will remove the current focus. NOTE: Java doesn't use this method.
Unset the focus from the given element passed as parameter.
SvgDocumentHandle aDocumentHandle | SVG document handle |
SvgElementHandle aElementHandle | The element for which to set the focus out. |
IMPORT_C SvgElementHandle | SvgDocumentGetElementById | ( | SvgDocumentHandle | aDocumentHandle, |
const TPtrC16 & | aID | |||
) |
Get the svg element in the given SVG document with the given unique ID string.If no such element exists, this returns NULL.
SvgDocumentHandle aDocumentHandle | SVG document handle |
const TPtrC16 & aID |
IMPORT_C TInt | SvgDocumentGetExternalListItem | ( | SvgDocumentHandle | aDocumentHandle, |
TInt | aIndex, | |||
TPtrC16 & | aItem | |||
) |
Get an external item indicated in a SVG document. Java side might request an external resouce and once the requested external resource is available, java side forwards this information (SvgDocumentGetExternalListItem) to the SVG engine. Note: Returning null indicates that the SVG engine tryes to handle the requested resource.
SvgDocumentHandle aDocumentHandle | SVG document handle |
TInt aIndex | |
TPtrC16 & aItem |
IMPORT_C TInt | SvgDocumentGetExternalListSize | ( | SvgDocumentHandle | aDocumentHandle | ) |
Get number of external list items in a SVG document. After the SVG document is created (see SvgDocumentCreateL) java side checks if the SVG document contains external item(s)
SvgDocumentHandle aDocumentHandle | SVG document handle |
IMPORT_C SvgElementHandle | SvgDocumentGetFocus | ( | SvgDocumentHandle | aDocumentHandle | ) |
Get the element having the focus. NOTE: Java doesn't use this method.
SvgDocumentHandle aDocumentHandle | SVG document handle |
IMPORT_C TInt | SvgDocumentGetId | ( | SvgDocumentHandle | aDocumentHandle, |
TInt | index, | |||
TPtrC16 & | aId | |||
) |
Get an id (at index) from the current SVG document. NOTE: Java doesn't use this method.
SvgDocumentHandle aDocumentHandle | SVG document handle |
TInt index | ID index |
TPtrC16 & aId |
IMPORT_C TReal32 | SvgDocumentGetMediaTime | ( | SvgDocumentHandle | aDocumentHandle | ) |
Get current animation or media timeline time for the specified document.
SvgDocumentHandle aDocumentHandle | SVG document handle |
IMPORT_C TInt | SvgDocumentGetNumberOfIds | ( | SvgDocumentHandle | aDocumentHandle | ) |
Get the number of ids in the current SVG document. NOTE: Java doesn't use this method.
SvgDocumentHandle aDocumentHandle | SVG document handle |
IMPORT_C SvgElementHandle | SvgDocumentGetRootElement | ( | SvgDocumentHandle | aDocumentHandle | ) |
Return a child element of the given SVG document Node which corresponds to the top-most tag in XML file. For SVG files it must be SVGSVGElement.
SvgDocumentHandle aDocumentHandle | SVG document handle |
IMPORT_C TInt | SvgDocumentGetViewportHeight | ( | SvgDocumentHandle | aDocumentHandle | ) |
Get the viewport height of the given SVG document. The value returned is always in pixels. If the specified height is defined in percentages, the values are mapped to the default view port size of 100x100. If the viewport height is explicitly changed by the java application, then the percentages are ignored and the content is made to fit to this new viewport height.
SvgDocumentHandle aDocumentHandle | SVG document handle |
IMPORT_C TInt | SvgDocumentGetViewportHeightUnits | ( | SvgDocumentHandle | aDocumentHandle | ) |
Get the viewport height units for the given document. NOTE: Java side is not actually need this method.
SvgDocumentHandle aDocumentHandle | Document |
IMPORT_C TInt | SvgDocumentGetViewportWidth | ( | SvgDocumentHandle | aDocumentHandle | ) |
Get the viewport width of the given SVG document. The value returned is always in pixels. If the specified width is defined in percentages, the values are mapped to the default view port size of 100x100. If the viewport width is explicitly changed by the java application, then the percentages are ignored and the content is made to fit to this new viewport width.
SvgDocumentHandle aDocumentHandle | SVG document handle |
IMPORT_C TInt | SvgDocumentGetViewportWidthUnits | ( | SvgDocumentHandle | aDocumentHandle | ) |
Get the viewport width units for the given document. NOTE: Java side is not actually need this method.
SvgDocumentHandle aDocumentHandle | Document |
IMPORT_C TInt | SvgDocumentHasAnimation | ( | SvgDocumentHandle | aDocumentHandle | ) |
Check if document has animation. NOTE: Java doesn't use this method.
SvgDocumentHandle aDocumentHandle | SVG document handle |
EXPORT_C TInt | SvgDocumentRequestCompleted | ( | SvgDocumentHandle | hDocument, |
const TPtrC16 & | aUri, | |||
const TPtrC8 & | ||||
) |
Svg Document request complete. Once the requested external resource is available, the application forwards this information (data) to the SVG engine. If this method is called a second time for a same URL (uri) of a same SVG document, the engine will replace the current resource data with the new one. Note: Setting NULL for data (0 for data_size) indicates that the requested resource could not be fetched by java side, and in this event the SVG engine will not make further attempts to load this resource.
SvgDocumentHandle hDocument | SVG document handle |
const TPtrC16 & aUri | |
const TPtrC8 & |
IMPORT_C void | SvgDocumentSetMediaTime | ( | SvgDocumentHandle | aDocumentHandle, |
TReal32 | seconds | |||
) |
Increments the animation or media timeline for the specified document aDocumentHandle (in seconds). This method is intended to move only forward in the timeline. It is important to note that setting large increments of time would result in skipping parts of the animation as per the SVG animation model.
SvgDocumentHandle aDocumentHandle | SVG document handle. |
TReal32 seconds | the value of time to be set in seconds. |
IMPORT_C void | SvgDocumentSetViewportHeight | ( | SvgDocumentHandle | aDocumentHandle, |
TInt | aHeight | |||
) |
Set the new (viewport) height for the given SVG document.
SvgDocumentHandle aDocumentHandle | SVG document handle |
TInt aHeight | The new height to be set. |
IMPORT_C void | SvgDocumentSetViewportWidth | ( | SvgDocumentHandle | aDocumentHandle, |
TInt | aWidth | |||
) |
Set the new (viewport) width for the given SVG document.
SvgDocumentHandle aDocumentHandle | SVG document handle |
TInt aWidth | The new width to be set. |
IMPORT_C void | SvgDocumentViewportInit | ( | SvgDocumentHandle | aDocumentHandle | ) |
Set the default viewport size for the given SVG document. The default viewport size of 100-by-100 pixels is used when the size is unspecified.
SvgDocumentHandle aDocumentHandle | Document |
IMPORT_C void | SvgElementAddEventListener | ( | SvgElementHandle | aElementHandle, |
TInt | aListener, | |||
SvgAttrType | aType | |||
) |
Add event listener to the given element. Note: need to replace void* with specific class NOTE: Java doesn't use this method.
SvgElementHandle aElementHandle | The element handle. |
TInt aListener | Listener |
SvgAttrType aType | Type |
IMPORT_C void | SvgElementAppendChild | ( | SvgElementHandle | aElementHandle, |
SvgElementHandle | aChildElementHandle | |||
) |
Append the given child element to the given svg element.
SvgElementHandle aElementHandle | Element handle |
SvgElementHandle aChildElementHandle | New child element handle |
IMPORT_C TInt | SvgElementCheckRemoveable | ( | SvgElementHandle | aElementHandle | ) |
Check if the given element is removable (no id or children with ids).
SvgElementHandle aElementHandle | The element handle. |
IMPORT_C SvgElementHandle | SvgElementCreate | ( | SvgAttrType | aType | ) |
Create a new svg element based on the specified (aType) SVG tag name. Only the following elements must be supported: <rect>, <circle>, <ellipse>, <line>, <path> <use> <image> <text>, <a> and <g>.
SvgAttrType aType |
IMPORT_C void | SvgElementDestroy | ( | SvgElementHandle | hElement | ) |
Destroy svg element of the given handle. NOTE: Java doesn't use this method.
SvgElementHandle hElement | Element handle |
IMPORT_C TInt | SvgElementElementInDOM | ( | TInt | hDocument, |
TInt | hElement | |||
) |
Find whether the element is present in a document.
IMPORT_C void | SvgElementGetBBox | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aAttributeType, | |||
TReal32 * | aX, | |||
TReal32 * | aY, | |||
TReal32 * | aWidth, | |||
TReal32 * | aHeight | |||
) |
Returns the tight bounding box in current user coordinate space. Tight bounding box is the smallest possible rectangle that includes the geometry of all contained graphics elements excluding stroke. The calculation is done in the user coordinate space of the element. When bounding box is calculated elements with display property (trait) set to none are ignored. Exact rules for the bounding box calculation are given in the SVG spec.
SvgElementHandle aElementHandle | The element handle. |
SvgAttrType aAttributeType | The name of the attribute (trait) to retrieve. |
TReal32 * aX | X coordinate. |
TReal32 * aY | Y coordinate. |
TReal32 * aWidth | Width. |
TReal32 * aHeight | Height. |
IMPORT_C TInt | SvgElementGetColorAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aAttribute, | |||
TInt * | aRedValue, | |||
TInt * | aGreenValue, | |||
TInt * | aBlueValue | |||
) |
Get a color attribute from the given element. The values are copied into the color components given.
SvgElementHandle aElementHandle | The element handle. |
SvgAttrType aAttribute | |
TInt * aRedValue | The red value |
TInt * aGreenValue | The green value |
TInt * aBlueValue | The blue value |
IMPORT_C short | SvgElementGetEnumAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aAttribute | |||
) |
Get enum attribute (trait) value.
SvgElementHandle aElementHandle | The element handle. |
SvgAttrType aAttribute | The name of the attribute (trait). |
IMPORT_C SvgElementHandle | SvgElementGetFirstElementChild | ( | SvgElementHandle | aElementHandle | ) |
Returns the first child element node of the given element. Return NULL if this element has no child elements.
SvgElementHandle aElementHandle | Element handle |
IMPORT_C TReal32 | SvgElementGetFloatAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aAttribute | |||
) |
Return a attribute (trait) value as float.
SvgElementHandle aElementHandle | The element. |
SvgAttrType aAttribute | Attribute's (or trait's) name |
IMPORT_C TInt | SvgElementGetMatrixAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aMatrixAttribute, | |||
TReal32 * | aAVal, | |||
TReal32 * | aBVal, | |||
TReal32 * | aCVal, | |||
TReal32 * | aDVal, | |||
TReal32 * | aEVal, | |||
TReal32 * | aFVal | |||
) |
[aAVal aCVal aEVal] [aBVal aDVal aFVal]
SvgElementHandle aElementHandle | The element handle. |
SvgAttrType aMatrixAttribute | The name of the attribute (trait) to retrieve. |
TReal32 * aAVal | The x scaling component |
TReal32 * aBVal | The y shearing component |
TReal32 * aCVal | The x shearing component |
TReal32 * aDVal | The y scaling component |
TReal32 * aEVal | The x translation component |
TReal32 * aFVal | The y translation component |
IMPORT_C SvgElementHandle | SvgElementGetNextElementSibling | ( | SvgElementHandle | aElementHandle | ) |
Returns the next sibling element of the given element. Return NULL if the given element has no element sibling nodes that come after this one in the document tree.
SvgElementHandle aElementHandle | Element handle |
IMPORT_C SvgElementHandle | SvgElementGetParent | ( | SvgElementHandle | aElementHandle | ) |
Returns a parent element of the given element.
SvgElementHandle aElementHandle | Element handle |
IMPORT_C TInt | SvgElementGetPathAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aPathAttribute | |||
) |
Get the path attribute (trait)value. NOTE: The returned values are copies of the actual attribute values and will not change if the corresponding trait changes.
SvgElementHandle aElementHandle | The element handle. |
SvgAttrType aPathAttribute | The name of the attribute (trait) to retrieve. |
IMPORT_C TInt | SvgElementGetRectAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aRectAttribute, | |||
TReal32 * | aX, | |||
TReal32 * | aY, | |||
TReal32 * | aWidth, | |||
TReal32 * | aHeight | |||
) |
Return the rectangle attribute (trait) values. NOTE: The returned values are copies of the actual attribute (trait) values and will not change if the corresponding trait changes.
SvgElementHandle aElementHandle | The element handle. |
SvgAttrType aRectAttribute | The name of the attribute (trait) to retrieve. |
TReal32 * aX | X coordinate. |
TReal32 * aY | Y coordinate. |
TReal32 * aWidth | Width. |
TReal32 * aHeight | Height. |
IMPORT_C void | SvgElementGetScreenBBox | ( | TInt | hElement, |
TReal32 * | x, | |||
TReal32 * | y, | |||
TReal32 * | w, | |||
TReal32 * | h | |||
) |
Gets a screen bounding box for the given element. Returns the tight bounding box in screen coordinate space. Tight bounding box is the smallest possible rectangle that includes the geometry of all contained graphics elements excluding stroke. The box coordinates are in the screen coordinate space, which is connected to the current user coordinate space by the matrix returned by SvgElementGetMatrixAttribute (with attribute id=<svg>).
IMPORT_C TInt | SvgElementGetStringAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aAttributeName, | |||
TPtrC16 & | aStrAttribute | |||
) |
Get a string attribute from the given element.
SvgElementHandle aElementHandle | The element. |
SvgAttrType aAttributeName | Attribute's name |
TPtrC16 & aStrAttribute |
IMPORT_C TInt | SvgElementGetType | ( | SvgElementHandle | aElementHandle | ) |
Request element type. The following element type are supported: <a>, <animate>, <animateColor>, <animateMotion>, <animateTransform> <circle> <defs> <ellipse>, <font>, <font-face>, <font-face-name>, <font-face-src>, <foreignObject>, <g>, <glyph>, <hkern>, <image>, <line>, <metadata>, <missing-glyph>, <metadata>, <mpath>. <path>, <polygon>, <polyline>, <rect>, <set>, <svg>, <switch>, <text>, <title>, <use>.
SvgElementHandle aElementHandle | The element. |
IMPORT_C TInt | SvgElementGetUsedFromElement | ( | TInt | hElement | ) |
Finds the handle to the actual cloned element.
TInt hElement | aElement This is handle to the cloned element. this is child of the <use> element. |
IMPORT_C TInt | SvgElementHasAnimation | ( | SvgElementHandle | aElementHandle | ) |
Check if document has animation. NOTE: Java doesn't use this method.
SvgElementHandle aElementHandle | SVG element handle |
IMPORT_C void | SvgElementInsertBefore | ( | SvgElementHandle | aElementHandle, |
SvgElementHandle | aChildElementHandle, | |||
SvgElementHandle | aReferenceElementHandle | |||
) |
Inserts aChildElementHandle before aReferenceElementHandle in the child list for the aElementHandle. If aReferenceElementHandle is NULL, aChildElementHandle is inserted at the end of the list. If the aChildElementHandle is already part of the tree, it is first removed.
TODO | Should throw exception if the aChildElementHandle would cause the SVG document to go into error, for ex: when the newChild contains a <use> element with an invalid xlink:href attribute. |
SvgElementHandle aElementHandle | The parent element. |
SvgElementHandle aChildElementHandle | The child to add |
SvgElementHandle aReferenceElementHandle | The child before which the new child should be added. |
IMPORT_C TInt | SvgElementIsActive | ( | SvgElementHandle | aElementHandle | ) |
<rect id="<element>" x="<0>" y="<20>" width="<20>" height="<20>"> <animate id=<animationElement> attributeName=<x> attributeType=<XML> begin=<1s> dur=<4s> end=<2s> fill=<freeze> from=<0> to=<80> </animate> </rect>
<rect id="<element>" x="<0>" y="<20>" width="<20>" height="<20>"> <animate id=<animationElement> attributeName=<x> attributeType=<XML> begin=<1s> dur=<4s> end=<2s> fill=<freeze> from=<0> to=<80> </animate> </rect>
SvgElementHandle aElementHandle | The element handle. |
IMPORT_C TInt | SvgElementIsUsed | ( | TInt | hElement | ) |
Checks whether this element is child of a use element.
TInt hElement | The element handle. |
IMPORT_C SvgElementHandle | SvgElementRemoveChild | ( | SvgElementHandle | aElementHandle, |
SvgElementHandle | aChildElementHandle | |||
) |
Remove the given child element from the given svg element. Elements that have ids cannot be removed from the tree.
SvgElementHandle aElementHandle | The parent element. |
SvgElementHandle aChildElementHandle | The element that is to be removed TODO |
IMPORT_C void | SvgElementRemoveEventListener | ( | SvgElementHandle | aElementHandle, |
TInt | aListener, | |||
SvgAttrType | aType | |||
) |
Remove event listener from the given element. Note: need to replace void* with specific class NOTE: Java doesn't use this method.
SvgElementHandle aElementHandle | The element handle. |
TInt aListener | Listener |
SvgAttrType aType | Type |
IMPORT_C void | SvgElementSetColorAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aAttribute, | |||
TInt | aRedValue, | |||
TInt | aGreenValue, | |||
TInt | aBlueValue | |||
) |
Set a color attribute for the given element.
SvgElementHandle aElementHandle | The element. |
SvgAttrType aAttribute | Attribute's name |
TInt aRedValue | The red value |
TInt aGreenValue | The green value |
TInt aBlueValue | The blue value |
IMPORT_C void | SvgElementSetEnumAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aAttribute, | |||
short | aValue | |||
) |
Set enum attribute (trait) value.
SvgElementHandle aElementHandle | The element handle. |
SvgAttrType aAttribute | The name of the attribute (trait) to be set. |
short aValue | The value of the attribute (trait) to be set. |
IMPORT_C void | SvgElementSetFloatAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aAttribute, | |||
TReal32 | aFloatValue | |||
) |
Set the attribute (trait) value as float.
SvgElementHandle aElementHandle | The element handle. |
SvgAttrType aAttribute | The name of the attribute (trait) to be set. |
TReal32 aFloatValue | The value of the attribute (trait) to be set as float. |
IMPORT_C void | SvgElementSetMatrixAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aMatrixAttribute, | |||
TReal32 | aAVal, | |||
TReal32 | aBVal, | |||
TReal32 | aCVal, | |||
TReal32 | aDVal, | |||
TReal32 | aEVal, | |||
TReal32 | aFVal | |||
) |
[aAVal aCVal aEVal] [aBVal aDVal aFVal]
SvgElementHandle aElementHandle | The element handle. |
SvgAttrType aMatrixAttribute | The name of the attribute (trait) to be set. |
TReal32 aAVal | The x scaling component |
TReal32 aBVal | The y shearing component |
TReal32 aCVal | The x shearing component |
TReal32 aDVal | The y scaling component |
TReal32 aEVal | The x translation component |
TReal32 aFVal | The y translation component |
IMPORT_C void | SvgElementSetPathAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aPathAttribute, | |||
SvgPathHandle | aPathHandle | |||
) |
Set the path attribute (trait) value. NOTE: Value is a copy in the trait so subsequent changes to the given aPathHandle have no effect on the value of the attribute (trait).
SvgElementHandle aElementHandle | The element handle. |
SvgAttrType aPathAttribute | The name of the attribute (trait) to be set. |
SvgPathHandle aPathHandle | The value of the attribute (trait) to be set as. |
IMPORT_C void | SvgElementSetRectAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aRectAttribute, | |||
TReal32 | aX, | |||
TReal32 | aY, | |||
TReal32 | aWidth, | |||
TReal32 | aHeight | |||
) |
Set the rectangle attribute (trait) values.
SvgElementHandle aElementHandle | The element handle. |
SvgAttrType aRectAttribute | The name of the attribute (trait) to be set. |
TReal32 aX | X coordinate. |
TReal32 aY | Y coordinate. |
TReal32 aWidth | Width. |
TReal32 aHeight | Height. |
IMPORT_C void | SvgElementSetStringAttribute | ( | SvgElementHandle | aElementHandle, |
SvgAttrType | aAttributeName, | |||
const TPtrC16 & | aAttributeValue | |||
) |
Set a string attribute in the given element.
SvgElementHandle aElementHandle | The SVG element handle. |
SvgAttrType aAttributeName | Attribute's name |
const TPtrC16 & aAttributeValue | Atribute's value. |
IMPORT_C void | SvgElementUpdatePath | ( | SvgElementHandle | aElementHandle, |
SvgPathHandle | aPathHandle | |||
) |
Update path info. NOTE: Java doesn't use this method.
SvgElementHandle aElementHandle | The element handle. |
SvgPathHandle aPathHandle | The path handle. |
IMPORT_C SvgEngineHandle | SvgEngineCreate | ( | ) |
Create an SvgEngine instance. NOTE: Java side uses engine only during rendering phase.
IMPORT_C void | SvgEngineDestroy | ( | SvgEngineHandle | aEngineHandle | ) |
Request to destroy the given engine by handle. NOTE: Java MIDlet could use multiple engines.
SvgEngineHandle aEngineHandle | Engine |
IMPORT_C void | SvgEngineRenderDocument | ( | SvgEngineHandle | aEngineHandle, |
SvgDocumentHandle | aDocumentHandle, | |||
TInt | aSurfaceHandle, | |||
TInt | aSurfaceMaskHandle = NULL, | |||
TReal32 | aCurrentTime = 0.0f | |||
) |
Request to render the SVG document.
SvgEngineHandle aEngineHandle | Svg engine handle |
SvgDocumentHandle aDocumentHandle | Svg document handle |
TInt aSurfaceHandle | Svg surface handle |
TInt aSurfaceMaskHandle = NULL | Mask that defines what pixels should be thrown and what not. |
TReal32 aCurrentTime = 0.0f | Current frame time. NOTE might be obsolete since the |
IMPORT_C void | SvgEngineRenderDocumentL | ( | SvgEngineHandle | aEngineHandle, |
SvgDocumentHandle | aDocumentHandle, | |||
TInt | aSurfaceHandle, | |||
const TPoint & | aAnchor, | |||
const TRect & | aRenderArea, | |||
TReal32 | aCurrentTime, | |||
TReal32 | aAlpha | |||
) |
SvgEngineHandle aEngineHandle | |
SvgDocumentHandle aDocumentHandle | |
TInt aSurfaceHandle | |
const TPoint & aAnchor | |
const TRect & aRenderArea | |
TReal32 aCurrentTime | |
TReal32 aAlpha |
IMPORT_C void | SvgEngineResume | ( | SvgEngineHandle | aEngineHandle | ) |
SvgEngineHandle aEngineHandle |
IMPORT_C void | SvgEngineSetRenderQuality | ( | SvgEngineHandle | aEngineHandle, |
TInt | aQuality | |||
) |
Request to set render quality. Set the quality of rendering. It can take one of the values, RENDERING_QUALITY_LOW (=1) or RENDERING_QUALITY_HIGH (=2). Default value is RENDERING_QUALITY_HIGH. The implementation of these quality levels is implementation dependent and should be mapped to definitions in SVG spec (shape, text, image and color rendering)
SvgEngineHandle aEngineHandle | Engine handle. |
TInt aQuality | This value indicates the quality of rendering required. |
IMPORT_C void | SvgEngineStart | ( | SvgEngineHandle | aEngineHandle | ) |
SvgEngineHandle aEngineHandle |
IMPORT_C void | SvgEngineStop | ( | SvgEngineHandle | aEngineHandle | ) |
SvgEngineHandle aEngineHandle |
TInt | SvgEnumerationMappingJSRtoSVG | ( | const TInt | aAttributeId, |
TInt | aJsrEnumValue | |||
) | [private] |
Gets the Enumeration value mapping from JSR to SVG. Attribute t
This maps the Enumeration Mapping form JSR specific to SVG specific
TInt | SvgEnumerationMappingSVGtoJSR | ( | const TInt | aAttributeId, |
TInt32 | aSvgEnumValue | |||
) | [private] |
Gets the Enumeration value mapping from JSR to SVG. Attribute t
This maps the Enumeration from SVG to JSR.
TInt | SvgEnumerationtoStringMappingJSRtoSVG | ( | const TInt | aAttributeId, |
short | aJsrEnumValue, | |||
TDes & | aValue | |||
) | [private] |
Gets the Enumeration value to string mapping from JSR to SVG. Attribute t
This maps the Enumeration from JSR to SVG. SVG enumerated value here is string type.
TInt | SvgGetAttributeTypeMappingJSRtoSVG | ( | SvgAttrType | aType | ) | [private] |
Gets the attribute type mapping from JSR to SVG. Attribute t
This maps the Attribute ids form JSR specific to SVG specific
SvgAttrType aType |
SvgAttrType | SvgGetAttributeTypeMappingSVGtoJSR | ( | const TInt | aElementId | ) | [private] |
Gets the attribute type mapping from SVG to JSR. Attribute t
This maps the Attribute ids form SVG specific to JSR specific
const TInt aElementId |
TInt | SvgGetElementTypeMappingJSRtoSVG | ( | SvgAttrType | aType | ) | [private] |
Gets The corresponding JSR-to-SVG element id. Ids of the elements differ in the svg engine and the JSR-API's.
This maps the element ids form JSR specific to SVG specific
SvgAttrType aType |
SvgAttrType | SvgGetElementTypeMappingSVGtoJSR | ( | const TInt | aElementId | ) | [private] |
Gets The corresponding SVG-to-JSR element id. Ids of the elements differ in the svg engine and the JSR-API's.
This maps the element ids form SVG specific to JSR specific
const TInt aElementId |
IMPORT_C void | SvgPathAddClose | ( | SvgPathHandle | aPathHandle | ) |
Appends 'Z' (close path) segment to the path
SvgPathHandle aPathHandle | The path handle. |
IMPORT_C void | SvgPathAddCurveTo | ( | SvgPathHandle | aPathHandle, |
TReal32 | aX1, | |||
TReal32 | aY1, | |||
TReal32 | aX2, | |||
TReal32 | aY2, | |||
TReal32 | aX3, | |||
TReal32 | aY3 | |||
) |
Appends 'C' (absolute cubic curve) segment to the path.
SvgPathHandle aPathHandle | The path handle. |
TReal32 aX1 | the x-axis coordinate of the first control point. |
TReal32 aY1 | the y-axis coordinate of the first control point. |
TReal32 aX2 | the x-axis coordinate of the second end point. |
TReal32 aY2 | the y-axis coordinate of the second end point. |
TReal32 aX3 | the x-axis coordinate of the final end point. |
TReal32 aY3 | the y-axis coordinate of the final end point. |
IMPORT_C void | SvgPathAddLineTo | ( | SvgPathHandle | aPathHandle, |
TReal32 | aX, | |||
TReal32 | aY | |||
) |
Appends 'L' (absolute line) segment to the path with the specified coordinates.
SvgPathHandle aPathHandle | The path handle. |
TReal32 aX | The x-axis coordinate for the specified point. |
TReal32 aY | The y-axis coordinate for the specified point. |
IMPORT_C void | SvgPathAddMoveTo | ( | SvgPathHandle | aPathHandle, |
TReal32 | aX, | |||
TReal32 | aY | |||
) |
Appends 'M' (absolute move) segment to the path with the specified coordinates.
SvgPathHandle aPathHandle | The path handle. |
TReal32 aX | The x-axis coordinate for the specified point. |
TReal32 aY | The y-axis coordinate for the specified point. |
IMPORT_C void | SvgPathAddQuadTo | ( | SvgPathHandle | aPathHandle, |
TReal32 | aX1, | |||
TReal32 | aY1, | |||
TReal32 | aX2, | |||
TReal32 | aY2 | |||
) |
Appends 'Q' (absolute quadratic curve) segment to the path.
SvgPathHandle aPathHandle | The path handle. |
TReal32 aX1 | the x-axis coordinate of the first control point. |
TReal32 aY1 | the y-axis coordinate of the first control point. |
TReal32 aX2 | the x-axis coordinate of the final end point. |
TReal32 aY2 | the y-axis coordinate of the final end point. |
IMPORT_C SvgPathHandle | SvgPathCreate | ( | ) |
Creates new path object that is empty. This object can be used to modify value of path traits
IMPORT_C void | SvgPathDestroy | ( | SvgPathHandle | aPathHandle | ) |
Destroy the specified path path
SvgPathHandle aPathHandle | Handle to the path to be deleted. |
IMPORT_C TInt | SvgPathGetSegmentCount | ( | SvgPathHandle | aPathHandle | ) |
Get the segment count of the given path.
SvgPathHandle aPathHandle | The path handle. |
IMPORT_C TReal32 | SvgPathGetSegmentParameter | ( | SvgPathHandle | aPathHandle, |
TInt | aSegmentIndex, | |||
TInt | aSegmentParameterIndex | |||
) |
Returns segment parameter by zero-based command index and zero-based parametr index.
SvgPathHandle aPathHandle | The path handle. |
TInt aSegmentIndex | The command index for the segment command to retrieve. |
TInt aSegmentParameterIndex | The parameter index for the segment parameter to retrieve. |
IMPORT_C TInt | SvgPathGetSegmentType | ( | SvgPathHandle | aPathHandle, |
TInt | aSegmentIndex | |||
) |
Returns segment command by zero-based command index. Returns one of MOVE_TO, LINE_TO, CURVE_TO, QUAD_TO or CLOSE.
SvgPathHandle aPathHandle | The path handle. |
TInt aSegmentIndex | The command index for the segment command to retrieve. |
IMPORT_C void | SvgRenderingSurfaceClearBuffer | ( | SvgSurfaceHandle | aSurface | ) |
Clear the Svg Rendering Surface. NOTE: Java doesn't use this method.
SvgSurfaceHandle aSurface | Surface |
IMPORT_C SvgSurfaceHandle | SvgRenderingSurfaceCreate | ( | TInt | aWidth, |
TInt | aHeight | |||
) |
Create a Svg Rendering Surface. NOTE: Java doesn't use this method.
IMPORT_C void | SvgRenderingSurfaceDestroy | ( | SvgSurfaceHandle | aSurface | ) |
Destroy a Svg Rendering Surface. NOTE: Java doesn't use this method.
SvgSurfaceHandle aSurface | Surface |
IMPORT_C TUint * | SvgRenderingSurfaceGetBuffer | ( | SvgSurfaceHandle | aSurface | ) |
Get a pointer to the Svg Rendering surface. NOTE: Java doesn't use this method.
SvgSurfaceHandle aSurface | Surface |
IMPORT_C TInt | SvgRenderingSurfaceGetHeight | ( | SvgSurfaceHandle | aSurface | ) |
Get the height of the Svg Rendering Surface. NOTE: Java doesn't use this method.
SvgSurfaceHandle aSurface | Surface |
IMPORT_C TInt | SvgRenderingSurfaceGetWidth | ( | SvgSurfaceHandle | aSurface | ) |
Get the width of the Svg Rendering Surface. NOTE: Java doesn't use this method.
SvgSurfaceHandle aSurface | Surface |
TInt | SvgStringtoEnumerationMappingSVGtoJSR | ( | const TInt | aAttrbuteId, |
TPtrC16 | aValue | |||
) | [private] |
Gets the string to enumeration value mapping from SVG to JSR. Attribute t
This maps the Enumeration from SVG to JSR. SVG enumerated value here is string type.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.