[inkscape.git] / trunk / src / bind / java / org / inkscape / dom / svg / SVGTextContentElementImpl.java
1 /**
2 * This is a simple mechanism to bind Inkscape to Java, and thence
3 * to all of the nice things that can be layered upon that.
4 *
5 * Authors:
6 * Bob Jamison
7 *
8 * Copyright (c) 2007-2008 Inkscape.org
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 3 of the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23 *
24 * Note that these SVG files are implementations of the Java
25 * interface package found here:
26 * http://www.w3.org/TR/SVG/java.html
27 */
29 package org.inkscape.dom.svg;
31 import org.w3c.dom.DOMException;
33 import org.w3c.dom.svg.*;
35 import org.w3c.dom.events.EventTarget;
36 import org.w3c.dom.css.CSSStyleDeclaration;
37 import org.w3c.dom.css.CSSValue;
39 import org.w3c.dom.events.EventException;
40 import org.w3c.dom.events.Event;
41 import org.w3c.dom.events.EventListener;
46 public class SVGTextContentElementImpl
47 extends
48 SVGElementImpl
49 //SVGTests,
50 //SVGLangSpace,
51 //SVGExternalResourcesRequired,
52 //SVGStylable,
53 //EventTarget
54 implements org.w3c.dom.svg.SVGTextContentElement
55 {
57 public SVGTextContentElementImpl()
58 {
59 imbue(_SVGTests = new SVGTestsImpl());
60 imbue(_SVGLangSpace = new SVGLangSpaceImpl());
61 imbue(_SVGExternalResourcesRequired = new SVGExternalResourcesRequiredImpl());
62 imbue(_SVGStylable = new SVGStylableImpl());
63 imbue(_EventTarget = new org.inkscape.dom.events.EventTargetImpl());
64 }
67 //from SVGTests
68 private SVGTestsImpl _SVGTests;
69 public SVGStringList getRequiredFeatures()
70 { return _SVGTests.getRequiredFeatures(); }
71 public SVGStringList getRequiredExtensions()
72 { return _SVGTests.getRequiredExtensions(); }
73 public SVGStringList getSystemLanguage()
74 { return _SVGTests.getSystemLanguage(); }
75 public boolean hasExtension (String extension)
76 { return _SVGTests.hasExtension(extension); }
77 //end SVGTests
79 //from SVGLangSpace
80 private SVGLangSpaceImpl _SVGLangSpace;
81 public String getXMLlang()
82 { return _SVGLangSpace.getXMLlang(); }
83 public void setXMLlang(String xmllang)
84 throws DOMException
85 { _SVGLangSpace.setXMLlang(xmllang); }
86 public String getXMLspace()
87 { return _SVGLangSpace.getXMLspace(); }
88 public void setXMLspace(String xmlspace)
89 throws DOMException
90 { _SVGLangSpace.setXMLspace(xmlspace); }
91 //end SVGLangSpace
93 //from SVGExternalResourcesRequired
94 private SVGExternalResourcesRequiredImpl _SVGExternalResourcesRequired;
95 public SVGAnimatedBoolean getExternalResourcesRequired()
96 { return _SVGExternalResourcesRequired.getExternalResourcesRequired(); }
97 //end SVGExternalResourcesRequired
99 //from SVGStylable
100 private SVGStylableImpl _SVGStylable;
101 public SVGAnimatedString getClassName()
102 { return _SVGStylable.getClassName(); }
103 public CSSStyleDeclaration getStyle()
104 { return _SVGStylable.getStyle(); }
105 public CSSValue getPresentationAttribute(String name)
106 { return _SVGStylable.getPresentationAttribute(name); }
107 //end SVGStylable
109 //from EventTarget
110 private org.inkscape.dom.events.EventTargetImpl _EventTarget;
111 public void addEventListener(String type,
112 EventListener listener,
113 boolean useCapture)
114 { _EventTarget.addEventListener(type, listener, useCapture); }
115 public void removeEventListener(String type,
116 EventListener listener,
117 boolean useCapture)
118 { _EventTarget.removeEventListener(type, listener, useCapture); }
119 public boolean dispatchEvent(Event evt)
120 throws EventException
121 { return _EventTarget.dispatchEvent(evt); }
122 public void addEventListenerNS(String namespaceURI,
123 String type,
124 EventListener listener,
125 boolean useCapture,
126 Object evtGroup)
127 { _EventTarget.addEventListenerNS(namespaceURI, type, listener, useCapture, evtGroup); }
128 public void removeEventListenerNS(String namespaceURI,
129 String type,
130 EventListener listener,
131 boolean useCapture)
132 { _EventTarget.removeEventListenerNS(namespaceURI, type, listener, useCapture); }
133 public boolean willTriggerNS(String namespaceURI,
134 String type)
135 { return _EventTarget.willTriggerNS(namespaceURI, type); }
136 public boolean hasEventListenerNS(String namespaceURI,
137 String type)
138 { return _EventTarget.hasEventListenerNS(namespaceURI, type); }
139 //end EventTarget
143 public native SVGAnimatedLength getTextLength( );
144 public native SVGAnimatedEnumeration getLengthAdjust( );
146 public native int getNumberOfChars ( );
147 public native float getComputedTextLength ( );
148 public native float getSubStringLength ( int charnum, int nchars )
149 throws DOMException;
150 public native SVGPoint getStartPositionOfChar ( int charnum )
151 throws DOMException;
152 public native SVGPoint getEndPositionOfChar ( int charnum )
153 throws DOMException;
154 public native SVGRect getExtentOfChar ( int charnum )
155 throws DOMException;
156 public native float getRotationOfChar ( int charnum )
157 throws DOMException;
158 public native int getCharNumAtPosition ( SVGPoint point );
159 public native void selectSubString ( int charnum, int nchars )
160 throws DOMException;
161 }