diff --git a/teavm-dom/src/main/java/org/teavm/dom/core/DOMImplementation.java b/teavm-dom/src/main/java/org/teavm/dom/core/DOMImplementation.java index ae3a70739..0ecd0aa73 100644 --- a/teavm-dom/src/main/java/org/teavm/dom/core/DOMImplementation.java +++ b/teavm-dom/src/main/java/org/teavm/dom/core/DOMImplementation.java @@ -22,4 +22,9 @@ import org.teavm.jso.JSObject; * @author Alexey Andreev */ public interface DOMImplementation extends JSObject { + boolean hasFeature(String feature, String version); + + DocumentType createDocumentType(String qualifiedName, String publicId, String systemId); + + Document createDocument(String namespaceURI, String qualifiedName, DocumentType doctype); } diff --git a/teavm-dom/src/main/java/org/teavm/dom/core/DocumentType.java b/teavm-dom/src/main/java/org/teavm/dom/core/DocumentType.java index 86342b1f5..792554a45 100644 --- a/teavm-dom/src/main/java/org/teavm/dom/core/DocumentType.java +++ b/teavm-dom/src/main/java/org/teavm/dom/core/DocumentType.java @@ -15,10 +15,28 @@ */ package org.teavm.dom.core; +import org.teavm.jso.JSProperty; + /** * * @author Alexey Andreev */ public interface DocumentType extends Node { + @JSProperty + String getName(); + @JSProperty + NamedNodeMap getEntities(); + + @JSProperty + NamedNodeMap getNotations(); + + @JSProperty + String getPublicId(); + + @JSProperty + String getSystemId(); + + @JSProperty + String getInternalSubset(); } diff --git a/teavm-dom/src/main/java/org/teavm/dom/core/Entity.java b/teavm-dom/src/main/java/org/teavm/dom/core/Entity.java new file mode 100644 index 000000000..1d43f37f4 --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/core/Entity.java @@ -0,0 +1,33 @@ +/* + * Copyright 2014 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.core; + +import org.teavm.jso.JSProperty; + +/** + * + * @author Alexey Andreev + */ +public interface Entity extends Node { + @JSProperty + String getPublicId(); + + @JSProperty + String getSystemId(); + + @JSProperty + String getNotationName(); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/core/Notation.java b/teavm-dom/src/main/java/org/teavm/dom/core/Notation.java new file mode 100644 index 000000000..ac05947e3 --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/core/Notation.java @@ -0,0 +1,30 @@ +/* + * Copyright 2014 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.core; + +import org.teavm.jso.JSProperty; + +/** + * + * @author Alexey Andreev + */ +public interface Notation extends Node { + @JSProperty + String getPublicId(); + + @JSProperty + String getSystemId(); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/core/ProcessingInstruction.java b/teavm-dom/src/main/java/org/teavm/dom/core/ProcessingInstruction.java index 728aaa487..6c9153872 100644 --- a/teavm-dom/src/main/java/org/teavm/dom/core/ProcessingInstruction.java +++ b/teavm-dom/src/main/java/org/teavm/dom/core/ProcessingInstruction.java @@ -15,10 +15,19 @@ */ package org.teavm.dom.core; +import org.teavm.jso.JSProperty; + /** * * @author Alexey Andreev */ public interface ProcessingInstruction extends Node { + @JSProperty + String getData(); + @JSProperty + void setData(String data); + + @JSProperty + String getTarget(); } diff --git a/teavm-dom/src/main/java/org/teavm/dom/events/DocumentEvent.java b/teavm-dom/src/main/java/org/teavm/dom/events/DocumentEvent.java new file mode 100644 index 000000000..968d555da --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/events/DocumentEvent.java @@ -0,0 +1,24 @@ +/* + * Copyright 2014 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.events; + +/** + * + * @author Alexey Andreev + */ +public interface DocumentEvent { + Event createEvent(String eventType); +} diff --git a/teavm-dom/src/main/java/org/teavm/dom/events/MouseEvent.java b/teavm-dom/src/main/java/org/teavm/dom/events/MouseEvent.java new file mode 100644 index 000000000..2d912c8fa --- /dev/null +++ b/teavm-dom/src/main/java/org/teavm/dom/events/MouseEvent.java @@ -0,0 +1,69 @@ +/* + * Copyright 2014 Alexey Andreev. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.teavm.dom.events; + +import org.teavm.jso.JSObject; +import org.teavm.jso.JSProperty; + +/** + * + * @author Alexey Andreev + */ +public interface MouseEvent extends Event { + short LEFT_BUTTON = 0; + short MIDDLE_BUTTON = 1; + short RIGHT_BUTTON = 2; + String CLICK = "click"; + String MOUSEDOWN = "mousedown"; + String MOUSEUP = "mouseup"; + String MOUSEOVER = "mouseover"; + String MOUSEMOVE = "mousemove"; + String MOUSEOUT = "mouseout"; + + @JSProperty + int getScreenX(); + + @JSProperty + int getScreenY(); + + @JSProperty + int getClientX(); + + @JSProperty + int getClientY(); + + @JSProperty + boolean getCtrlKey(); + + @JSProperty + boolean getShiftKey(); + + @JSProperty + boolean getAltKey(); + + @JSProperty + boolean getMetaKey(); + + @JSProperty + short getButton(); + + @JSProperty + EventTarget getRelatedTarget(); + + void initMouseEvent(String type, boolean canBubble, boolean cancelable, JSObject view, int detail, int screenX, + int screenY, int clientX, int clientY, boolean ctrlKey, boolean altKey, boolean shiftKey, boolean metaKey, + short button, EventTarget relatedTarget); +}