Backed out changeset b71c8c052463 (bug 1943846) for causing mass failures. CLOSED...
[gecko.git] / xpfe / appshell / nsIAppWindow.idl
bloba6e3880b14025fe8bcf37670fb379f81e090b5d4
1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsISupports.idl"
9 /**
10 * The nsIAppWindow
12 * When the window is destroyed, it will fire a "xul-window-destroyed"
13 * notification through the global observer service.
16 %{C++
17 #include "LiveResizeListener.h"
18 #include "nsTArray.h"
21 interface nsIDocShell;
22 interface nsIDocShellTreeItem;
23 interface nsIXULBrowserWindow;
24 interface nsIRemoteTab;
25 interface mozIDOMWindowProxy;
26 interface nsIOpenWindowInfo;
27 webidl BrowsingContext;
29 native LiveResizeListenerArray(nsTArray<RefPtr<mozilla::LiveResizeListener>>);
31 [builtinclass, scriptable, uuid(d6d7a014-e28d-4c9d-8727-1cf6d870619b)]
32 interface nsIAppWindow : nsISupports
34 /**
35 * The docshell owning the XUL for this window.
37 readonly attribute nsIDocShell docShell;
39 /**
40 * Indicates if this window is instrinsically sized.
42 attribute boolean intrinsicallySized;
44 /**
45 * The primary content shell.
47 * Note that this is a docshell tree item and therefore can not be assured of
48 * what object it is. It could be an editor, a docshell, or a browser object.
49 * Or down the road any other object that supports being a DocShellTreeItem
50 * Query accordingly to determine the capabilities.
52 readonly attribute nsIDocShellTreeItem primaryContentShell;
54 /**
55 * In multiprocess case we may not have primaryContentShell but
56 * primaryRemoteTab.
58 readonly attribute nsIRemoteTab primaryRemoteTab;
60 /**
61 * Helper for getting the BrowsingContext from either `primaryContentShell` or
62 * `primaryRemoteTab` depending on which is available.
64 readonly attribute BrowsingContext primaryContentBrowsingContext;
66 void remoteTabAdded(in nsIRemoteTab aTab, in boolean aPrimary);
67 void remoteTabRemoved(in nsIRemoteTab aTab);
69 [noscript,notxpcom] LiveResizeListenerArray getLiveResizeListeners();
71 /**
72 * Returns the difference between the inner window size (client size) and the
73 * outer window size, in CSS pixels.
75 [infallible] readonly attribute unsigned long outerToInnerHeightDifferenceInCSSPixels;
76 [infallible] readonly attribute unsigned long outerToInnerWidthDifferenceInCSSPixels;
78 /**
79 * Move the window to a centered position.
80 * @param aRelative If not null, the window relative to which the window is
81 * moved. See aScreen parameter for details.
82 * @param aScreen PR_TRUE to center the window relative to the screen
83 * containing aRelative if aRelative is not null. If
84 * aRelative is null then relative to the screen of the
85 * opener window if it was initialized by passing it to
86 * nsWebShellWindow::Initialize. Failing that relative to
87 * the main screen.
88 * PR_FALSE to center it relative to aRelative itself.
89 * @param aAlert PR_TRUE to move the window to an alert position,
90 * generally centered horizontally and 1/3 down from the top.
92 void center(in nsIAppWindow aRelative, in boolean aScreen, in boolean aAlert);
94 /**
95 * Shows the window as a modal window. That is, ensures that it is visible
96 * and runs a local event loop, exiting only once the window has been closed.
98 void showModal();
101 * Locks the aspect ratio for a window.
102 * @param aShouldLock boolean
104 void lockAspectRatio(in boolean aShouldLock);
106 attribute uint32_t chromeFlags;
109 * Begin assuming |chromeFlags| don't change hereafter, and assert
110 * if they do change. The state change is one-way and idempotent.
112 void assumeChromeFlagsAreFrozen();
115 * Create a new window.
116 * @param aChromeFlags see nsIWebBrowserChrome
117 * @param aOpenWindowInfo information about the request for a content window
118 * to be opened. Will be null for non-content loads.
119 * @return the newly minted window
121 nsIAppWindow createNewWindow(in int32_t aChromeFlags,
122 in nsIOpenWindowInfo aOpenWindowInfo);
124 attribute nsIXULBrowserWindow XULBrowserWindow;
127 * Back-door method to make sure some stuff is done when the document is
128 * ready for layout, that would cause expensive computation otherwise later.
130 * Do NOT call this unless you know what you're doing! In particular,
131 * calling this when this XUL window doesn't yet have a document in its
132 * docshell could cause problems.
134 [noscript] void beforeStartLayout();
137 * If the window was opened as a content window, this will return the initial
138 * nsIOpenWindowInfo to use.
140 readonly attribute nsIOpenWindowInfo initialOpenWindowInfo;
143 * Request fast snapshot at RenderCompositor of WebRender.
144 * Since readback of Windows DirectComposition is very slow.
146 void needFastSnaphot();
149 * Ask the PopupManager to rollup all popups.
150 * Can be used by popup-like elements to close other popups when shown.
151 * Note that tooltips and noautohide popups won't be closed.
153 void rollupAllPopups();