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 DOM files are implementations of the Java
25 * interface package found here:
26 * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/java-binding.html
27 */
30 package org.inkscape.dom;
32 import org.w3c.dom.DOMException;
35 import org.w3c.dom.Attr;
36 import org.w3c.dom.CDATASection;
37 import org.w3c.dom.Comment;
38 import org.w3c.dom.DocumentFragment;
39 import org.w3c.dom.DocumentType;
40 import org.w3c.dom.DOMConfiguration;
41 import org.w3c.dom.DOMImplementation;
42 import org.w3c.dom.DOMStringList;
43 import org.w3c.dom.Element;
44 import org.w3c.dom.EntityReference;
45 import org.w3c.dom.Node;
46 import org.w3c.dom.NodeList;
47 import org.w3c.dom.ProcessingInstruction;
48 import org.w3c.dom.Text;
52 public class DocumentImpl
53 extends NodeImpl
54 implements org.w3c.dom.Document
55 {
57 public native DocumentType getDoctype();
59 public native DOMImplementation getImplementation();
61 public native Element getDocumentElement();
63 public native Element createElement(String tagName)
64 throws DOMException;
66 public native DocumentFragment createDocumentFragment();
68 public native Text createTextNode(String data);
70 public native Comment createComment(String data);
72 public native CDATASection createCDATASection(String data)
73 throws DOMException;
75 public native ProcessingInstruction createProcessingInstruction(String target,
76 String data)
77 throws DOMException;
79 public native Attr createAttribute(String name)
80 throws DOMException;
82 public native EntityReference createEntityReference(String name)
83 throws DOMException;
85 public native NodeList getElementsByTagName(String tagname);
87 public native Node importNode(Node importedNode,
88 boolean deep)
89 throws DOMException;
91 public native Element createElementNS(String namespaceURI,
92 String qualifiedName)
93 throws DOMException;
95 public native Attr createAttributeNS(String namespaceURI,
96 String qualifiedName)
97 throws DOMException;
99 public native NodeList getElementsByTagNameNS(String namespaceURI,
100 String localName);
102 public native Element getElementById(String elementId);
104 public native String getInputEncoding();
106 public native String getXmlEncoding();
108 public native boolean getXmlStandalone();
110 public native void setXmlStandalone(boolean xmlStandalone)
111 throws DOMException;
113 public native String getXmlVersion();
115 public native void setXmlVersion(String xmlVersion)
116 throws DOMException;
118 public native boolean getStrictErrorChecking();
120 public native void setStrictErrorChecking(boolean strictErrorChecking);
122 public native String getDocumentURI();
124 public native void setDocumentURI(String documentURI);
126 public native Node adoptNode(Node source)
127 throws DOMException;
129 public native DOMConfiguration getDomConfig();
131 public native void normalizeDocument();
133 public native Node renameNode(Node n,
134 String namespaceURI,
135 String qualifiedName)
136 throws DOMException;
138 }