001: /*
002: * Copyright (c) 2002-2008 Gargoyle Software Inc. All rights reserved.
003: *
004: * Redistribution and use in source and binary forms, with or without
005: * modification, are permitted provided that the following conditions are met:
006: *
007: * 1. Redistributions of source code must retain the above copyright notice,
008: * this list of conditions and the following disclaimer.
009: * 2. Redistributions in binary form must reproduce the above copyright notice,
010: * this list of conditions and the following disclaimer in the documentation
011: * and/or other materials provided with the distribution.
012: * 3. The end-user documentation included with the redistribution, if any, must
013: * include the following acknowledgment:
014: *
015: * "This product includes software developed by Gargoyle Software Inc.
016: * (http://www.GargoyleSoftware.com/)."
017: *
018: * Alternately, this acknowledgment may appear in the software itself, if
019: * and wherever such third-party acknowledgments normally appear.
020: * 4. The name "Gargoyle Software" must not be used to endorse or promote
021: * products derived from this software without prior written permission.
022: * For written permission, please contact info@GargoyleSoftware.com.
023: * 5. Products derived from this software may not be called "HtmlUnit", nor may
024: * "HtmlUnit" appear in their name, without prior written permission of
025: * Gargoyle Software Inc.
026: *
027: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
028: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
029: * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARGOYLE
030: * SOFTWARE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
031: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
032: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
033: * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
034: * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
035: * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
036: * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
037: */
038: package com.gargoylesoftware.htmlunit;
039:
040: /**
041: * An interface that represents one window in a browser. It could be a top level window
042: * or a frame.
043: *
044: * @version $Revision: 2132 $
045: * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a>
046: * @author David K. Taylor
047: * @author David D. Kilzer
048: */
049: public interface WebWindow {
050:
051: /**
052: * Return the name of this window.
053: *
054: * @return The name of this window.
055: */
056: String getName();
057:
058: /**
059: * Set the name of this window.
060: *
061: * @param name The new window name.
062: */
063: void setName(final String name);
064:
065: /**
066: * Return the currently loaded page or null if no page has been loaded.
067: *
068: * @return The currently loaded page or null if no page has been loaded.
069: */
070: Page getEnclosedPage();
071:
072: /**
073: * Set the currently loaded page.
074: *
075: * @param page The new page or null if there is no page (ie empty window)
076: */
077: void setEnclosedPage(final Page page);
078:
079: /**
080: * Return the window that contains this window. If this is a top
081: * level window, then return this window.
082: *
083: * @return The parent window or this window if there is no parent.
084: */
085: WebWindow getParentWindow();
086:
087: /**
088: * Return the top level window that contains this window. If this
089: * is a top level window, then return this window.
090: *
091: * @return The top level window that contains this window or this
092: * window if there is no parent.
093: */
094: WebWindow getTopWindow();
095:
096: /**
097: * Return the web client that "owns" this window.
098: *
099: * @return The web client or null if this window has been closed.
100: */
101: WebClient getWebClient();
102:
103: /**
104: * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br/>
105: *
106: * Set the javascript object that corresponds to this element. This is not guaranteed
107: * to be set even if there is a javascript object for this html element.
108: * @param scriptObject The javascript object.
109: */
110: void setScriptObject(final Object scriptObject);
111:
112: /**
113: * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br/>
114: *
115: * Return the javascript object that corresponds to this element.
116: * @return The javascript object that corresponds to this element.
117: */
118: Object getScriptObject();
119:
120: /**
121: * <span style="color:red">INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.</span><br/>
122: *
123: * Currently exposed here for testing purposes, a better API will be added in the
124: * future and this will become a completely internal class.
125: *
126: * @return The ThreadManager for this WebWindow
127: */
128: ThreadManager getThreadManager();
129: }
|