Completes DOM Level 2 mapping

This commit is contained in:
konsoletyper 2014-03-18 23:50:39 +04:00
parent 0ab1639821
commit 037538c416
7 changed files with 188 additions and 0 deletions

View File

@ -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);
}

View File

@ -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<Entity> getEntities();
@JSProperty
NamedNodeMap<Notation> getNotations();
@JSProperty
String getPublicId();
@JSProperty
String getSystemId();
@JSProperty
String getInternalSubset();
}

View File

@ -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 <konsoletyper@gmail.com>
*/
public interface Entity extends Node {
@JSProperty
String getPublicId();
@JSProperty
String getSystemId();
@JSProperty
String getNotationName();
}

View File

@ -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 <konsoletyper@gmail.com>
*/
public interface Notation extends Node {
@JSProperty
String getPublicId();
@JSProperty
String getSystemId();
}

View File

@ -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();
}

View File

@ -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 <konsoletyper@gmail.com>
*/
public interface DocumentEvent {
Event createEvent(String eventType);
}

View File

@ -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 <konsoletyper@gmail.com>
*/
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);
}