michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIDOMWindow; michael@0: interface nsIURI; michael@0: interface nsIFrameLoaderOwner; michael@0: michael@0: [scriptable, uuid(e420bd32-b8c4-4b47-8cca-09e0bddbb0c3)] michael@0: michael@0: /** michael@0: * The C++ source has access to the browser script source through michael@0: * nsIBrowserDOMWindow. It is intended to be attached to the chrome DOMWindow michael@0: * of a toplevel browser window (a XUL window). A DOMWindow that does not michael@0: * happen to be a browser chrome window will simply have no access to any such michael@0: * interface. michael@0: */ michael@0: interface nsIBrowserDOMWindow : nsISupports michael@0: { michael@0: /** michael@0: * Values for openURI's aWhere parameter. michael@0: */ michael@0: /** michael@0: * Do whatever the default is based on application state, user preferences, michael@0: * and the value of the aContext parameter to openURI. michael@0: */ michael@0: const short OPEN_DEFAULTWINDOW = 0; michael@0: /** michael@0: * Open in the "current window". If aOpener is provided, this should be the michael@0: * top window in aOpener's window hierarchy, but exact behavior is michael@0: * application-dependent. If aOpener is not provided, it's up to the michael@0: * application to decide what constitutes a "current window". michael@0: */ michael@0: const short OPEN_CURRENTWINDOW = 1; michael@0: /** michael@0: * Open in a new window. michael@0: */ michael@0: const short OPEN_NEWWINDOW = 2; michael@0: /** michael@0: * Open in a new content tab in the toplevel browser window corresponding to michael@0: * this nsIBrowserDOMWindow. michael@0: */ michael@0: const short OPEN_NEWTAB = 3; michael@0: /** michael@0: * Open in an existing content tab based on the URI. If a match can't be michael@0: * found, revert to OPEN_NEWTAB behavior. michael@0: */ michael@0: const short OPEN_SWITCHTAB = 4; michael@0: michael@0: /** michael@0: * Values for openURI's aContext parameter. These affect the behavior of michael@0: * OPEN_DEFAULTWINDOW. michael@0: */ michael@0: /** michael@0: * external link (load request from another application, xremote, etc). michael@0: */ michael@0: const short OPEN_EXTERNAL = 1; michael@0: /** michael@0: * internal open new window michael@0: */ michael@0: const short OPEN_NEW = 2; michael@0: michael@0: /** michael@0: * Load a URI michael@0: michael@0: * @param aURI the URI to open. null is allowed. If null is passed in, no michael@0: * load will be done, though the window the load would have michael@0: * happened in will be returned. michael@0: * @param aWhere see possible values described above. michael@0: * @param aOpener window requesting the open (can be null). michael@0: * @param aContext the context in which the URI is being opened. This michael@0: * is used only when aWhere == OPEN_DEFAULTWINDOW. michael@0: * @return the window into which the URI was opened. michael@0: */ michael@0: nsIDOMWindow openURI(in nsIURI aURI, in nsIDOMWindow aOpener, michael@0: in short aWhere, in short aContext); michael@0: michael@0: /** michael@0: * As above, but return the nsIFrameLoaderOwner for the new window. michael@0: // XXXbz is this the right API? Do we really need the opener here? michael@0: // See bug 537428 michael@0: */ michael@0: nsIFrameLoaderOwner openURIInFrame(in nsIURI aURI, in nsIDOMWindow aOpener, michael@0: in short aWhere, in short aContext); michael@0: michael@0: /** michael@0: * @param aWindow the window to test. michael@0: * @return whether the window is the main content window for any michael@0: * currently open tab in this toplevel browser window. michael@0: */ michael@0: boolean isTabContentWindow(in nsIDOMWindow aWindow); michael@0: michael@0: /** michael@0: * The contentWindow property of the currently selected browser. michael@0: * This is used to implement .content in remote-Firefox. michael@0: */ michael@0: michael@0: readonly attribute jsval contentWindow; michael@0: }; michael@0: