michael@0: /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * 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: /** michael@0: * The nsIXULWindow michael@0: * michael@0: * When the window is destroyed, it will fire a "xul-window-destroyed" michael@0: * notification through the global observer service. michael@0: */ michael@0: michael@0: interface nsIDocShell; michael@0: interface nsIDocShellTreeItem; michael@0: interface nsIXULBrowserWindow; michael@0: michael@0: [scriptable, uuid(CCF9E98A-E442-4061-9F74-94539DD9FE9E)] michael@0: interface nsIXULWindow : nsISupports michael@0: { michael@0: /** michael@0: * The docshell owning the XUL for this window. michael@0: */ michael@0: readonly attribute nsIDocShell docShell; michael@0: michael@0: /** michael@0: * Indicates if this window is instrinsically sized. michael@0: */ michael@0: attribute boolean intrinsicallySized; michael@0: michael@0: /** michael@0: * The primary content shell. michael@0: * michael@0: * Note that this is a docshell tree item and therefore can not be assured of michael@0: * what object it is. It could be an editor, a docshell, or a browser object. michael@0: * Or down the road any other object that supports being a DocShellTreeItem michael@0: * Query accordingly to determine the capabilities. michael@0: */ michael@0: readonly attribute nsIDocShellTreeItem primaryContentShell; michael@0: michael@0: /** michael@0: * The content shell specified by the supplied id. michael@0: * michael@0: * Note that this is a docshell tree item and therefore can not be assured of michael@0: * what object it is. It could be an editor, a docshell, or a browser object. michael@0: * Or down the road any other object that supports being a DocShellTreeItem michael@0: * Query accordingly to determine the capabilities. michael@0: */ michael@0: nsIDocShellTreeItem getContentShellById(in wstring ID); michael@0: michael@0: /** michael@0: * Tell this window that it has picked up a child XUL window michael@0: * @param aChild the child window being added michael@0: */ michael@0: void addChildWindow(in nsIXULWindow aChild); michael@0: michael@0: /** michael@0: * Tell this window that it has lost a child XUL window michael@0: * @param aChild the child window being removed michael@0: */ michael@0: void removeChildWindow(in nsIXULWindow aChild); michael@0: michael@0: /** michael@0: * Move the window to a centered position. michael@0: * @param aRelative If not null, the window relative to which the window is michael@0: * moved. See aScreen parameter for details. michael@0: * @param aScreen PR_TRUE to center the window relative to the screen michael@0: * containing aRelative if aRelative is not null. If michael@0: * aRelative is null then relative to the screen of the michael@0: * opener window if it was initialized by passing it to michael@0: * nsWebShellWindow::Initialize. Failing that relative to michael@0: * the main screen. michael@0: * PR_FALSE to center it relative to aRelative itself. michael@0: * @param aAlert PR_TRUE to move the window to an alert position, michael@0: * generally centered horizontally and 1/3 down from the top. michael@0: */ michael@0: void center(in nsIXULWindow aRelative, in boolean aScreen, in boolean aAlert); michael@0: michael@0: /** michael@0: * Shows the window as a modal window. That is, ensures that it is visible michael@0: * and runs a local event loop, exiting only once the window has been closed. michael@0: */ michael@0: void showModal(); michael@0: michael@0: const unsigned long lowestZ = 0; michael@0: const unsigned long loweredZ = 4; /* "alwaysLowered" attribute */ michael@0: const unsigned long normalZ = 5; michael@0: const unsigned long raisedZ = 6; /* "alwaysRaised" attribute */ michael@0: const unsigned long highestZ = 9; michael@0: michael@0: attribute unsigned long zLevel; michael@0: michael@0: /** michael@0: * contextFlags are from nsIWindowCreator2 michael@0: */ michael@0: attribute uint32_t contextFlags; michael@0: michael@0: attribute uint32_t chromeFlags; michael@0: michael@0: /** michael@0: * Begin assuming |chromeFlags| don't change hereafter, and assert michael@0: * if they do change. The state change is one-way and idempotent. michael@0: */ michael@0: void assumeChromeFlagsAreFrozen(); michael@0: michael@0: /** michael@0: * Create a new window. michael@0: * @param aChromeFlags see nsIWebBrowserChrome michael@0: * @return the newly minted window michael@0: */ michael@0: nsIXULWindow createNewWindow(in int32_t aChromeFlags); michael@0: michael@0: attribute nsIXULBrowserWindow XULBrowserWindow; michael@0: michael@0: /** michael@0: * Back-door method to force application of chrome flags at a particular michael@0: * time. Do NOT call this unless you know what you're doing! In particular, michael@0: * calling this when this XUL window doesn't yet have a document in its michael@0: * docshell could cause problems. michael@0: */ michael@0: [noscript] void applyChromeFlags(); michael@0: };