gecko-dev/xpfe/appshell/nsIAppWindow.idl
Cosmin Sabou aefb5f9c88 Backed out 24 changesets (bug 1616353) for fission assertion failures nsGlobalWindowOuter.cpp.
Backed out changeset 3a43210e4900 (bug 1616353)
Backed out changeset cb77e9149cf8 (bug 1616353)
Backed out changeset 3aacc7cfe33f (bug 1616353)
Backed out changeset c026b06063a5 (bug 1616353)
Backed out changeset 580e790c5d17 (bug 1616353)
Backed out changeset 6f09bc1c476d (bug 1616353)
Backed out changeset 6955906262c0 (bug 1616353)
Backed out changeset a7700472807a (bug 1616353)
Backed out changeset a4735096e01b (bug 1616353)
Backed out changeset bd1706c57d91 (bug 1616353)
Backed out changeset 363c13296fda (bug 1616353)
Backed out changeset e414df387524 (bug 1616353)
Backed out changeset 765d3364cca0 (bug 1616353)
Backed out changeset 8a13355b4ac4 (bug 1616353)
Backed out changeset ada17fb8fca7 (bug 1616353)
Backed out changeset 6b6b99af186d (bug 1616353)
Backed out changeset ea966e78b296 (bug 1616353)
Backed out changeset cb88e0bbb3b9 (bug 1616353)
Backed out changeset f89a89015114 (bug 1616353)
Backed out changeset ae6058552969 (bug 1616353)
Backed out changeset f42bb5b48c1b (bug 1616353)
Backed out changeset 1ab9d22c73bb (bug 1616353)
Backed out changeset 2692c2c1396b (bug 1616353)
Backed out changeset 11a279c8da08 (bug 1616353)
2020-04-06 20:03:02 +03:00

188 lines
6.8 KiB
Plaintext

/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsISupports.idl"
/**
* The nsIAppWindow
*
* When the window is destroyed, it will fire a "xul-window-destroyed"
* notification through the global observer service.
*/
%{C++
#include "LiveResizeListener.h"
#include "nsTArray.h"
%}
interface nsIDocShell;
interface nsIDocShellTreeItem;
interface nsIXULBrowserWindow;
interface nsIRemoteTab;
interface mozIDOMWindowProxy;
native LiveResizeListenerArray(nsTArray<RefPtr<mozilla::LiveResizeListener>>);
[builtinclass, scriptable, uuid(d6d7a014-e28d-4c9d-8727-1cf6d870619b)]
interface nsIAppWindow : nsISupports
{
/**
* The docshell owning the XUL for this window.
*/
readonly attribute nsIDocShell docShell;
/**
* Indicates if this window is instrinsically sized.
*/
attribute boolean intrinsicallySized;
/**
* The primary content shell.
*
* Note that this is a docshell tree item and therefore can not be assured of
* what object it is. It could be an editor, a docshell, or a browser object.
* Or down the road any other object that supports being a DocShellTreeItem
* Query accordingly to determine the capabilities.
*/
readonly attribute nsIDocShellTreeItem primaryContentShell;
/**
* In multiprocess case we may not have primaryContentShell but
* primaryRemoteTab.
*/
readonly attribute nsIRemoteTab primaryRemoteTab;
void remoteTabAdded(in nsIRemoteTab aTab, in boolean aPrimary);
void remoteTabRemoved(in nsIRemoteTab aTab);
[noscript,notxpcom] LiveResizeListenerArray getLiveResizeListeners();
/**
* Tell this window that it has picked up a child XUL window
* @param aChild the child window being added
*/
void addChildWindow(in nsIAppWindow aChild);
/**
* Returns the difference between the inner window size (client size) and the
* outer window size, in CSS pixels.
*/
[infallible] readonly attribute unsigned long outerToInnerHeightDifferenceInCSSPixels;
[infallible] readonly attribute unsigned long outerToInnerWidthDifferenceInCSSPixels;
/**
* Tell this window that it has lost a child XUL window
* @param aChild the child window being removed
*/
void removeChildWindow(in nsIAppWindow aChild);
/**
* Move the window to a centered position.
* @param aRelative If not null, the window relative to which the window is
* moved. See aScreen parameter for details.
* @param aScreen PR_TRUE to center the window relative to the screen
* containing aRelative if aRelative is not null. If
* aRelative is null then relative to the screen of the
* opener window if it was initialized by passing it to
* nsWebShellWindow::Initialize. Failing that relative to
* the main screen.
* PR_FALSE to center it relative to aRelative itself.
* @param aAlert PR_TRUE to move the window to an alert position,
* generally centered horizontally and 1/3 down from the top.
*/
void center(in nsIAppWindow aRelative, in boolean aScreen, in boolean aAlert);
/**
* Shows the window as a modal window. That is, ensures that it is visible
* and runs a local event loop, exiting only once the window has been closed.
*/
void showModal();
/**
* Locks the aspect ratio for a window.
* @param aShouldLock boolean
*/
void lockAspectRatio(in bool aShouldLock);
const unsigned long lowestZ = 0;
const unsigned long loweredZ = 4; /* "alwaysLowered" attribute */
const unsigned long normalZ = 5;
const unsigned long raisedZ = 6; /* "alwaysRaised" attribute */
const unsigned long highestZ = 9;
attribute unsigned long zLevel;
attribute uint32_t chromeFlags;
/**
* Begin assuming |chromeFlags| don't change hereafter, and assert
* if they do change. The state change is one-way and idempotent.
*/
void assumeChromeFlagsAreFrozen();
/**
* Create a new window.
* @param aChromeFlags see nsIWebBrowserChrome
* @param aOpeningTab the RemoteTab that requested this new window be opened.
* Can be left null.
* @param aOpener The window which is requesting that this new window be opened.
* @param aNextRemoteTabId The integer ID of the next remote tab actor to use.
* 0 means there is no next remote tab actor to use.
* @return the newly minted window
*/
nsIAppWindow createNewWindow(in int32_t aChromeFlags,
in nsIRemoteTab aOpeningTab,
in mozIDOMWindowProxy aOpener,
in unsigned long long aNextRemoteTabId);
attribute nsIXULBrowserWindow XULBrowserWindow;
/**
* Back-door method to make sure some stuff is done when the document is
* ready for layout, that would cause expensive computation otherwise later.
*
* Do NOT call this unless you know what you're doing! In particular,
* calling this when this XUL window doesn't yet have a document in its
* docshell could cause problems.
*/
[noscript] void beforeStartLayout();
/**
* Given the dimensions of some content area held within this
* XUL window, and assuming that that content area will change
* its dimensions in linear proportion to the dimensions of this
* XUL window, changes the size of the XUL window so that the
* content area reaches a particular size.
*
* We need to supply the content area dimensions because sometimes
* the child's nsDocShellTreeOwner needs to propagate a SizeShellTo
* call to the parent. But the shellItem argument of the call will
* not be available on the parent side.
*
* Note: this is an internal method, other consumers should never call this.
*
* @param aDesiredWidth
* The desired width of the content area in device pixels.
* @param aDesiredHeight
* The desired height of the content area in device pixels.
* @param shellItemWidth
* The current width of the content area.
* @param shellItemHeight
* The current height of the content area.
*/
[noscript, notxpcom] void sizeShellToWithLimit(in int32_t aDesiredWidth,
in int32_t aDesiredHeight,
in int32_t shellItemWidth,
in int32_t shellItemHeight);
/**
* If the window was opened as a content window by script, this will return the
* integer ID of the next RemoteTab actor to use.
*/
[noscript]
readonly attribute unsigned long long nextRemoteTabId;
};