package textbender.o.rhinohide.html; // Copyright 2007, Michael Allan. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Textbender Software"), to deal in the Textbender Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Textbender Software, and to permit persons to whom the Textbender Software is furnished to do so, subject to the following conditions: The preceding copyright notice and this permission notice shall be included in all copies or substantial portions of the Textbender Software. THE TEXTBENDER SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE TEXTBENDER SOFTWARE OR THE USE OR OTHER DEALINGS IN THE TEXTBENDER SOFTWARE. import netscape.javascript.*; import org.w3c.dom.*; import org.w3c.dom.html.*; import textbender.g.lang.*; import textbender.o.rhinohide.*; import textbender.o.rhinohide.core.*; /** An HTML document implemented as an overlay of a JavaScript HTML document. * The orthodox way to obtain the document displayed by the browser * is RhiWindow.{@linkplain RhiWindow#getDocument getDocument}(). */ public @ThreadSafe final class RhiHTMLDocument extends RhiDocument implements HTMLDocument { /** Constructs a RhiHTMLDocument. * * @param window global object * @param jsObject bridge to underlying JavaScript document, * per {@linkplain Rhinohide#jsObject() jsObject}() * * @return document, or null if jsObject is null * * @throws IllegalArgumentException if jsObject is neither null * nor a document */ public static RhiHTMLDocument wrapHTMLDocument( RhiWindow window, JSObject jsObject ) { return wrapHTMLDocument( window, jsObject, /*doTypeCheck*/true ); } public static RhiHTMLDocument wrapHTMLDocument( RhiWindow window, JSObject jsObject, boolean doTypeCheck ) { if( jsObject == null ) return null; if( doTypeCheck ) ensureNodeType( new Rhinohide(window,jsObject), DOCUMENT_NODE ); return new RhiHTMLDocument( window, jsObject ); } public RhiHTMLDocument( RhiWindow window, JSObject jsObject ) { super( window, jsObject ); } // - H T M L - D o c u m e n t -------------------------------------------------------- /** Not yet coded. * * @throws UnsupportedOperationException */ public void close() { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public HTMLCollection getAnchors() { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public HTMLCollection getApplets() { throw new UnsupportedOperationException(); } public HTMLElement getBody() { return RhiHTMLElement.wrapHTMLElement ( window, (JSObject)getMemberV( "body" ), /*doTypeCheck*/false ); } /** Not yet coded. * * @throws UnsupportedOperationException */ public void setBody( HTMLElement body ) { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public String getCookie() { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public void setCookie( String cookie ) { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public String getDomain() { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public NodeList getElementsByName( String elementName ) { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public HTMLCollection getForms() { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public HTMLCollection getImages() { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public HTMLCollection getLinks() { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public String getReferrer() { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public String getTitle() { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public void setTitle( String title ) { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public String getURL() { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public void open() { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public void write( String text ) { throw new UnsupportedOperationException(); } /** Not yet coded. * * @throws UnsupportedOperationException */ public void writeln( String text ) { throw new UnsupportedOperationException(); } }