SVG Tiny 1.2 - 20051207

B IDL Definitions

This appendix contains the complete OMG IDL for the SVG UDOM.

The SVG UDOM IDL defines the model for the SVG UDOM. Note that the SVG UDOM IDL is defined such that some interfaces have more than one base class. The different standard language bindings for the SVG UDOM are responsible for defining how to map all aspects of the SVG UDOM into the given language, including how the language should implement interfaces with more than one base class.


pragmas
{
  java.jni.api.name="org.w3c.dom";  
  core.package.vendor="W3C";  
  core.package.name="SVG Tiny";  
  core.package.id="svgt";
};

[
  comment="subsetted Core DOM";
  java.jni.api.name="org.w3c.dom";
]

module dom
{
    valuetype DOMString sequence<unsigned short>;
    typedef Object DOMObject;
    interface Node;
    interface Element;
    interface Document;
    interface DOMImplementation;

    exception DOMException
    {
        unsigned short code;
    };

    const unsigned short INDEX_SIZE_ERR = 1;
    const unsigned short HIERARCHY_REQUEST_ERR = 3;
    const unsigned short WRONG_DOCUMENT_ERR = 4;
    const unsigned short INVALID_CHARACTER_ERR = 5;
    const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
    const unsigned short NOT_FOUND_ERR = 8;
    const unsigned short NOT_SUPPORTED_ERR = 9;
    const unsigned short INVALID_STATE_ERR = 11;
    const unsigned short INVALID_MODIFICATION_ERR = 13;
    const unsigned short NAMESPACE_ERR = 14;
    const unsigned short INVALID_ACCESS_ERR = 15;
    const unsigned short TYPE_MISMATCH_ERR = 17;

    interface Node
    {
        readonly attribute DOMString namespaceURI;
        readonly attribute DOMString localName;
        readonly attribute Node parentNode;
        readonly attribute Document ownerDocument;
        attribute DOMString textContent;
        Node appendChild(in Node newChild) raises(DOMException);
        Node insertBefore(in Node newChild, in Node refChild) raises(DOMException);
        Node removeChild(in Node oldChild) raises(DOMException);
        Node cloneNode(in boolean deep);
    };

    interface Element : Node
    {
        DOMString getAttributeNS(in DOMString namespaceURI, in DOMString localName) raises(DOMException);  
        void setAttributeNS(in DOMString namespaceURI, in DOMString qualifiedName, in DOMString value) raises(DOMException);
    };

    interface Document : Node
    {
        readonly attribute DOMImplementation implementation;
        Element createElementNS(in DOMString namespaceURI, in DOMString qualifiedName) raises(DOMException);
        readonly attribute Element documentElement;
        Element getElementById(in DOMString elementId);
    };

    interface DOMImplementation 
    {
      boolean hasFeature(in DOMString feature, in DOMString version);
    };

};

module events
{
    typedef dom::DOMString DOMString;
    typedef dom::DOMException DOMException;
    typedef dom::Document Document;
    typedef dom::Element Element;
    interface EventTarget;
    interface EventListener;
    interface Event;    

    interface EventTarget
    {
        void addEventListener(in DOMString type, in EventListener listener, in boolean useCapture) raises(DOMException);
        void removeEventListener(in DOMString type, in EventListener listener, in boolean useCapture) raises(DOMException);
        void addEventListenerNS(in DOMString namespaceURI, in DOMString type, in EventListener listener, in boolean useCapture, in DOMObject evtGroup) raises(DOMException);
        void removeEventListenerNS(in DOMString namespaceURI, in DOMString type, in EventListener listener, in boolean useCapture) raises(DOMException);
    };

    interface EventListener
    {
        void handleEvent(in Event evt);
    };

    interface Event
    {
        readonly attribute EventTarget target;
        readonly attribute EventTarget currentTarget;
        readonly attribute DOMString type;
        readonly attribute DOMString namespaceURI;
        readonly attribute boolean cancelable;
        boolean isDefaultPrevented();
        void stopPropagation();
        void preventDefault();
    };    

    interface OriginalEvent 
    {
        readonly attribute Event originalEvent;
    };

    interface MouseEvent : UIEvent    
    {        
        readonly attribute long screenX;        
        readonly attribute long screenY;        
        readonly attribute long clientX;        
        readonly attribute long clientY;        
        readonly attribute unsigned short button;    
    };

    interface TextEvent : UIEvent    
    {        
        readonly attribute DOMString data;    
    };

    interface KeyboardEvent : UIEvent     
    {        
        readonly attribute DOMString keyIdentifier;    
    };

    interface TimeEvent : Event     
    {        
        readonly attribute long detail;    
    };

    interface UIEvent : Event     
    {        
        readonly attribute long detail;    
    };

    interface WheelEvent : UIEvent     
    {        
        readonly attribute unsigned long wheelDelta;    
    };

    interface ProgressEvent : Event     
    {        
        readonly attribute boolean lengthComputable;        
        readonly attribute unsigned long loaded;        
        readonly attribute unsigned long total;    
    };

    interface ConnectionEvent : Event 
    {
         const unsigned short NO_ERR = 0;
         const unsigned short NETWORK_ERR = 1;
         readonly attribute unsigned short errorCode;
         readonly attribute sequence<octet> receivedData;
    };

};

module smil
{

    interface ElementTimeControl
    {
        void beginElementAt(in float offset);
        void beginElement();
        void endElementAt(in float offset);
        void endElement();
        void pauseElement();
        void resumeElement();
        readonly attribute boolean isPaused; 
    };

};

module global
{
    typedef dom::DOMString DOMString;        
    typedef dom::DOMException DOMException;    
    typedef events::EventTarget EventTarget;
    interface Connection;
    interface Timer;

    interface Global 
    {
    };

    exception GlobalException
    {
        unsigned short code;
    };

    const unsigned short NOT_CONNECTED_ERR = 1;
    const unsigned short ENCODING_ERR = 2;

    interface Connection : EventTarget 
    {
        readonly attribute boolean connected;
        void connect(in DOMString host, in unsigned short port) raises(GlobalException);
        void send(in sequence<octet> data) raises(GlobalException);
        void close();
     };

    interface Timer : events::EventTarget
    {
       attribute long delay;
       attribute long interval;
       readonly attribute boolean running;    
       void start();
       void stop();
    };

};

module svg
{
    typedef dom::DOMString DOMString;
    typedef dom::DOMException DOMException;
    typedef dom::Document Document;
    typedef dom::Element Element;
    typedef dom::DOMObject DOMObject;    
    typedef global::Connection Connection;
    typedef global::Timer Timer;
    typedef global::Global Global;
    typedef events::EventListener EventListener;
    typedef events::EventTarget EventTarget;
    interface SVGSVGElement;
    interface SVGRGBColor;
    interface SVGRect;
    interface SVGPoint;
    interface SVGPath;
    interface SVGMatrix;
    interface SVGLocatableElement;
    interface SVGElement;
    interface SVGAnimationElement;
    interface SVGDocument;
    interface SVGGlobal;

    exception SVGException
    {
        unsigned short code;
    };

    const unsigned short SVG_INVALID_VALUE_ERR = 1;
    const unsigned short SVG_MATRIX_NOT_INVERTABLE = 2;

    interface SVGDocument : Document, EventTarget 
    {
        readonly attribute SVGGlobal global;
    };

    interface SVGElementInstance : EventTarget 
    {
        readonly attribute SVGElement correspondingElement;
        readonly attribute SVGElement correspondingUseElement;
    };

    interface SVGSVGElement : SVGLocatableElement, SVGAnimationElement
    {
        const unsigned short NAV_AUTO           = 1; 
        const unsigned short NAV_NEXT           = 2; 
        const unsigned short NAV_PREV           = 3; 
        const unsigned short NAV_UP             = 4; 
        const unsigned short NAV_UP_RIGHT       = 5; 
        const unsigned short NAV_RIGHT          = 6; 
        const unsigned short NAV_DOWN_RIGHT     = 7;
        const unsigned short NAV_DOWN           = 8;
        const unsigned short NAV_DOWN_LEFT      = 9;
        const unsigned short NAV_LEFT           = 10;
        const unsigned short NAV_UP_LEFT        = 11;
        attribute float currentScale;
        attribute float currentRotate;
        readonly attribute SVGPoint currentTranslate;
        readonly attribute SVGRect viewport; 
        attribute float currentTime;
        SVGMatrix createSVGMatrixComponents(in float a, in float b, in float c, in float d, in float e, in float f);
        SVGRect createSVGRect();
        SVGPath createSVGPath();
        SVGRGBColor createSVGRGBColor(in long red, in long green, in long blue) raises(SVGException);
        void moveFocus(in unsigned short motionType) raises(DOMException);
        void setFocus(in DOMObject object) raises(DOMException);
        DOMObject getCurrentFocusedObject();
    };

    interface SVGRGBColor
    {
        readonly attribute unsigned long red;
        readonly attribute unsigned long green;
        readonly attribute unsigned long blue;
    };

    interface SVGRect
    {
        attribute float x;
        attribute float y;
        attribute float width;
        attribute float height;
    };

    interface SVGPoint
    {
        attribute float x;
        attribute float y;
    };

    interface SVGPath
    {
        const unsigned short MOVE_TO = 77;
        const unsigned short LINE_TO = 76;
        const unsigned short CURVE_TO = 67;
        const unsigned short QUAD_TO = 81;
        const unsigned short CLOSE = 90;
        readonly attribute unsigned long numberOfSegments;
        unsigned short getSegment(in unsigned long cmdIndex) raises(DOMException);
        float getSegmentParam(in unsigned long cmdIndex, in unsigned long paramIndex) raises(DOMException);
        void moveTo(in float x, in float y);
        void lineTo(in float x, in float y);
        void quadTo(in float x1, in float y1, in float x2, in float y2);
        void curveTo(in float x1, in float y1, in float x2, in float y2, in float x3, in float y3);
        void close();
    };

    interface SVGMatrix
    {
        float getComponent(in unsigned long index) raises(DOMException);
        SVGMatrix mMultiply(in SVGMatrix secondMatrix);
        SVGMatrix inverse() raises(SVGException);
        SVGMatrix mTranslate(in float x, in float y);
        SVGMatrix mScale(in float scaleFactor);
        SVGMatrix mRotate(in float angle);
    };

    interface SVGLocatable
    { 
        SVGRect   getBBox();
        SVGMatrix getScreenCTM();
        SVGRect   getScreenBBox();
    };

    interface SVGLocatableElement : SVGElement, SVGLocatable
    {
    };

    interface TraitAccess
    {
        DOMString getTrait(in DOMString name) raises(DOMException);
        DOMString getTraitNS(in DOMString namespaceURI, in DOMString name) raises(DOMException);
        float getFloatTrait(in DOMString name) raises(DOMException);
        SVGMatrix getMatrixTrait(in DOMString name) raises(DOMException);
        SVGRect getRectTrait(in DOMString name) raises(DOMException);
        SVGPath getPathTrait(in DOMString name) raises(DOMException);
        SVGRGBColor getRGBColorTrait(in DOMString name) raises(DOMException);
        DOMString getPresentationTrait(in DOMString name) raises(DOMException);
        DOMString getPresentationTraitNS(in DOMString namespaceURI, in DOMString name) raises(DOMException);
        float getFloatPresentationTrait(in DOMString name) raises(DOMException);
        SVGMatrix getMatrixPresentationTrait(in DOMString name) raises(DOMException);
        SVGRect getRectPresentationTrait(in DOMString name) raises(DOMException);
        SVGPath getPathPresentationTrait(in DOMString name) raises(DOMException);
        SVGRGBColor getRGBColorPresentationTrait(in DOMString name) raises(DOMException);
        void setTrait(in DOMString name, in DOMString value) raises(DOMException);
        void setTraitNS(in DOMString namespaceURI, in DOMString name, in DOMString value) raises(DOMException);
        void setFloatTrait(in DOMString name, in float value) raises(DOMException);
        void setMatrixTrait(in DOMString name, in SVGMatrix matrix) raises(DOMException);
        void setRectTrait(in DOMString name, in SVGRect rect) raises(DOMException);
        void setPathTrait(in DOMString name, in SVGPath path) raises(DOMException);
        void setRGBColorTrait(in DOMString name, in SVGRGBColor color) raises(DOMException);
    };

    interface ElementTraversal 
    {
        readonly attribute Element firstElementChild;
        readonly attribute Element lastElementChild;
        readonly attribute Element nextElementSibling;
        readonly attribute Element previousElementSibling;
    };

    interface SVGElement : Element, EventTarget, TraitAccess, ElementTraversal
    {
        attribute DOMString id;
    };

    interface SVGAnimationElement : SVGElement, smil::ElementTimeControl
    {
    };

    interface SVGVisualMediaElement : SVGLocatableElement, SVGAnimationElement 
    {
    };

    interface EventListenerInitializer2
    {
        void initializeEventListeners( in Element scriptElement );
        EventListener createEventListener( in Element handlerElement );
    };

    interface SVGGlobal : Global, EventListenerInitializer2
    {
       Connection createConnection();
       Timer createTimer();
       void gotoLocation(in DOMString newIRI);
       readonly attribute Document document;
       readonly attribute Global parent;
       DOMString binaryToString(in sequence<octet>, in DOMString encoding) raises(GlobalException);
       sequence<octet> stringToBinary(in DOMString data, in DOMString encoding) raises(GlobalException);
       DOMString getURL(in DOMString iri, in AsyncStatusCallback callback);
       DOMString postURL(in DOMString iri, in DOMString data, in AsyncStatusCallback callback, in DOMString type, in DOMString encoding);
       Node parseXML(in DOMString data, in Document contextDoc);
    };

    interface AsyncStatusCallback 
    {
        void operationComplete(in AsyncURLStatus status);
    };

    interface AsyncURLStatus 
    {
        readonly attribute boolean success;
        readonly attribute DOMString contentType;
        readonly attribute DOMString content;
    };

};