Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * |
michael@0 | 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #include "nsISupports.idl" |
michael@0 | 8 | |
michael@0 | 9 | /** |
michael@0 | 10 | * The nsIXULWindow |
michael@0 | 11 | * |
michael@0 | 12 | * When the window is destroyed, it will fire a "xul-window-destroyed" |
michael@0 | 13 | * notification through the global observer service. |
michael@0 | 14 | */ |
michael@0 | 15 | |
michael@0 | 16 | interface nsIDocShell; |
michael@0 | 17 | interface nsIDocShellTreeItem; |
michael@0 | 18 | interface nsIXULBrowserWindow; |
michael@0 | 19 | |
michael@0 | 20 | [scriptable, uuid(CCF9E98A-E442-4061-9F74-94539DD9FE9E)] |
michael@0 | 21 | interface nsIXULWindow : nsISupports |
michael@0 | 22 | { |
michael@0 | 23 | /** |
michael@0 | 24 | * The docshell owning the XUL for this window. |
michael@0 | 25 | */ |
michael@0 | 26 | readonly attribute nsIDocShell docShell; |
michael@0 | 27 | |
michael@0 | 28 | /** |
michael@0 | 29 | * Indicates if this window is instrinsically sized. |
michael@0 | 30 | */ |
michael@0 | 31 | attribute boolean intrinsicallySized; |
michael@0 | 32 | |
michael@0 | 33 | /** |
michael@0 | 34 | * The primary content shell. |
michael@0 | 35 | * |
michael@0 | 36 | * Note that this is a docshell tree item and therefore can not be assured of |
michael@0 | 37 | * what object it is. It could be an editor, a docshell, or a browser object. |
michael@0 | 38 | * Or down the road any other object that supports being a DocShellTreeItem |
michael@0 | 39 | * Query accordingly to determine the capabilities. |
michael@0 | 40 | */ |
michael@0 | 41 | readonly attribute nsIDocShellTreeItem primaryContentShell; |
michael@0 | 42 | |
michael@0 | 43 | /** |
michael@0 | 44 | * The content shell specified by the supplied id. |
michael@0 | 45 | * |
michael@0 | 46 | * Note that this is a docshell tree item and therefore can not be assured of |
michael@0 | 47 | * what object it is. It could be an editor, a docshell, or a browser object. |
michael@0 | 48 | * Or down the road any other object that supports being a DocShellTreeItem |
michael@0 | 49 | * Query accordingly to determine the capabilities. |
michael@0 | 50 | */ |
michael@0 | 51 | nsIDocShellTreeItem getContentShellById(in wstring ID); |
michael@0 | 52 | |
michael@0 | 53 | /** |
michael@0 | 54 | * Tell this window that it has picked up a child XUL window |
michael@0 | 55 | * @param aChild the child window being added |
michael@0 | 56 | */ |
michael@0 | 57 | void addChildWindow(in nsIXULWindow aChild); |
michael@0 | 58 | |
michael@0 | 59 | /** |
michael@0 | 60 | * Tell this window that it has lost a child XUL window |
michael@0 | 61 | * @param aChild the child window being removed |
michael@0 | 62 | */ |
michael@0 | 63 | void removeChildWindow(in nsIXULWindow aChild); |
michael@0 | 64 | |
michael@0 | 65 | /** |
michael@0 | 66 | * Move the window to a centered position. |
michael@0 | 67 | * @param aRelative If not null, the window relative to which the window is |
michael@0 | 68 | * moved. See aScreen parameter for details. |
michael@0 | 69 | * @param aScreen PR_TRUE to center the window relative to the screen |
michael@0 | 70 | * containing aRelative if aRelative is not null. If |
michael@0 | 71 | * aRelative is null then relative to the screen of the |
michael@0 | 72 | * opener window if it was initialized by passing it to |
michael@0 | 73 | * nsWebShellWindow::Initialize. Failing that relative to |
michael@0 | 74 | * the main screen. |
michael@0 | 75 | * PR_FALSE to center it relative to aRelative itself. |
michael@0 | 76 | * @param aAlert PR_TRUE to move the window to an alert position, |
michael@0 | 77 | * generally centered horizontally and 1/3 down from the top. |
michael@0 | 78 | */ |
michael@0 | 79 | void center(in nsIXULWindow aRelative, in boolean aScreen, in boolean aAlert); |
michael@0 | 80 | |
michael@0 | 81 | /** |
michael@0 | 82 | * Shows the window as a modal window. That is, ensures that it is visible |
michael@0 | 83 | * and runs a local event loop, exiting only once the window has been closed. |
michael@0 | 84 | */ |
michael@0 | 85 | void showModal(); |
michael@0 | 86 | |
michael@0 | 87 | const unsigned long lowestZ = 0; |
michael@0 | 88 | const unsigned long loweredZ = 4; /* "alwaysLowered" attribute */ |
michael@0 | 89 | const unsigned long normalZ = 5; |
michael@0 | 90 | const unsigned long raisedZ = 6; /* "alwaysRaised" attribute */ |
michael@0 | 91 | const unsigned long highestZ = 9; |
michael@0 | 92 | |
michael@0 | 93 | attribute unsigned long zLevel; |
michael@0 | 94 | |
michael@0 | 95 | /** |
michael@0 | 96 | * contextFlags are from nsIWindowCreator2 |
michael@0 | 97 | */ |
michael@0 | 98 | attribute uint32_t contextFlags; |
michael@0 | 99 | |
michael@0 | 100 | attribute uint32_t chromeFlags; |
michael@0 | 101 | |
michael@0 | 102 | /** |
michael@0 | 103 | * Begin assuming |chromeFlags| don't change hereafter, and assert |
michael@0 | 104 | * if they do change. The state change is one-way and idempotent. |
michael@0 | 105 | */ |
michael@0 | 106 | void assumeChromeFlagsAreFrozen(); |
michael@0 | 107 | |
michael@0 | 108 | /** |
michael@0 | 109 | * Create a new window. |
michael@0 | 110 | * @param aChromeFlags see nsIWebBrowserChrome |
michael@0 | 111 | * @return the newly minted window |
michael@0 | 112 | */ |
michael@0 | 113 | nsIXULWindow createNewWindow(in int32_t aChromeFlags); |
michael@0 | 114 | |
michael@0 | 115 | attribute nsIXULBrowserWindow XULBrowserWindow; |
michael@0 | 116 | |
michael@0 | 117 | /** |
michael@0 | 118 | * Back-door method to force application of chrome flags at a particular |
michael@0 | 119 | * time. Do NOT call this unless you know what you're doing! In particular, |
michael@0 | 120 | * calling this when this XUL window doesn't yet have a document in its |
michael@0 | 121 | * docshell could cause problems. |
michael@0 | 122 | */ |
michael@0 | 123 | [noscript] void applyChromeFlags(); |
michael@0 | 124 | }; |