2000-01-14 07:23:38 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 15:12:37 +04:00
|
|
|
* 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/. */
|
2000-01-14 07:23:38 +03:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The nsIXULWindow
|
2004-10-29 23:28:38 +04:00
|
|
|
*
|
|
|
|
* When the window is destroyed, it will fire a "xul-window-destroyed"
|
|
|
|
* notification through the global observer service.
|
2000-01-14 07:23:38 +03:00
|
|
|
*/
|
|
|
|
|
2017-02-01 18:38:16 +03:00
|
|
|
%{C++
|
|
|
|
#include "LiveResizeListener.h"
|
|
|
|
#include "nsTArray.h"
|
|
|
|
%}
|
|
|
|
|
2000-01-22 06:13:20 +03:00
|
|
|
interface nsIDocShell;
|
|
|
|
interface nsIDocShellTreeItem;
|
2004-08-21 18:47:51 +04:00
|
|
|
interface nsIXULBrowserWindow;
|
2014-06-06 06:51:14 +04:00
|
|
|
interface nsITabParent;
|
2016-10-07 21:59:59 +03:00
|
|
|
interface mozIDOMWindowProxy;
|
2000-01-22 06:13:20 +03:00
|
|
|
|
2017-02-01 18:38:16 +03:00
|
|
|
native LiveResizeListenerArray(nsTArray<RefPtr<mozilla::LiveResizeListener>>);
|
|
|
|
|
2015-10-01 20:06:51 +03:00
|
|
|
[scriptable, uuid(d6d7a014-e28d-4c9d-8727-1cf6d870619b)]
|
2000-01-14 07:23:38 +03:00
|
|
|
interface nsIXULWindow : nsISupports
|
|
|
|
{
|
2001-11-06 04:19:39 +03:00
|
|
|
/**
|
2004-10-29 23:28:38 +04:00
|
|
|
* The docshell owning the XUL for this window.
|
|
|
|
*/
|
2001-11-06 04:19:39 +03:00
|
|
|
readonly attribute nsIDocShell docShell;
|
2000-01-22 06:13:20 +03:00
|
|
|
|
2001-11-06 04:19:39 +03:00
|
|
|
/**
|
2004-10-29 23:28:38 +04:00
|
|
|
* Indicates if this window is instrinsically sized.
|
|
|
|
*/
|
2001-11-06 04:19:39 +03:00
|
|
|
attribute boolean intrinsicallySized;
|
2000-02-14 09:10:52 +03:00
|
|
|
|
2001-11-06 04:19:39 +03:00
|
|
|
/**
|
2004-10-29 23:28:38 +04:00
|
|
|
* 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.
|
|
|
|
*/
|
2001-11-06 04:19:39 +03:00
|
|
|
readonly attribute nsIDocShellTreeItem primaryContentShell;
|
2000-01-22 06:13:20 +03:00
|
|
|
|
2015-10-01 20:06:51 +03:00
|
|
|
/**
|
|
|
|
* In multiprocess case we may not have primaryContentShell but
|
|
|
|
* primaryTabParent.
|
|
|
|
*/
|
|
|
|
readonly attribute nsITabParent primaryTabParent;
|
|
|
|
|
|
|
|
void tabParentAdded(in nsITabParent aTab, in boolean aPrimary);
|
|
|
|
void tabParentRemoved(in nsITabParent aTab);
|
|
|
|
|
2017-02-01 18:38:16 +03:00
|
|
|
[noscript,notxpcom] LiveResizeListenerArray getLiveResizeListeners();
|
|
|
|
|
2001-11-06 04:19:39 +03:00
|
|
|
/**
|
2004-10-29 23:28:38 +04:00
|
|
|
* Tell this window that it has picked up a child XUL window
|
|
|
|
* @param aChild the child window being added
|
|
|
|
*/
|
2001-11-06 04:19:39 +03:00
|
|
|
void addChildWindow(in nsIXULWindow aChild);
|
2004-10-29 23:28:38 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Tell this window that it has lost a child XUL window
|
|
|
|
* @param aChild the child window being removed
|
|
|
|
*/
|
2001-11-06 04:19:39 +03:00
|
|
|
void removeChildWindow(in nsIXULWindow aChild);
|
2001-03-30 06:27:50 +04:00
|
|
|
|
2001-11-06 04:19:39 +03:00
|
|
|
/**
|
2004-10-29 23:28:38 +04:00
|
|
|
* Move the window to a centered position.
|
2009-09-29 06:20:46 +04:00
|
|
|
* @param aRelative If not null, the window relative to which the window is
|
|
|
|
* moved. See aScreen parameter for details.
|
2012-10-25 20:32:24 +04:00
|
|
|
* @param aScreen PR_TRUE to center the window relative to the screen
|
2009-09-29 06:20:46 +04:00
|
|
|
* 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.
|
2012-10-25 20:32:24 +04:00
|
|
|
* PR_FALSE to center it relative to aRelative itself.
|
|
|
|
* @param aAlert PR_TRUE to move the window to an alert position,
|
2004-10-29 23:28:38 +04:00
|
|
|
* generally centered horizontally and 1/3 down from the top.
|
|
|
|
*/
|
2001-11-06 04:19:39 +03:00
|
|
|
void center(in nsIXULWindow aRelative, in boolean aScreen, in boolean aAlert);
|
2000-04-14 00:07:28 +04:00
|
|
|
|
2001-11-06 04:19:39 +03:00
|
|
|
/**
|
2004-10-29 23:28:38 +04:00
|
|
|
* 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.
|
|
|
|
*/
|
2001-11-06 04:19:39 +03:00
|
|
|
void showModal();
|
2000-04-02 02:03:28 +04:00
|
|
|
|
2001-11-06 04:19:39 +03:00
|
|
|
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;
|
2000-04-02 02:03:28 +04:00
|
|
|
|
2004-10-29 23:28:38 +04:00
|
|
|
attribute unsigned long zLevel;
|
2001-11-06 04:19:39 +03:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
attribute uint32_t chromeFlags;
|
2010-07-19 22:33:33 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Begin assuming |chromeFlags| don't change hereafter, and assert
|
|
|
|
* if they do change. The state change is one-way and idempotent.
|
|
|
|
*/
|
|
|
|
void assumeChromeFlagsAreFrozen();
|
|
|
|
|
2001-11-06 04:19:39 +03:00
|
|
|
/**
|
2004-10-29 23:28:38 +04:00
|
|
|
* Create a new window.
|
|
|
|
* @param aChromeFlags see nsIWebBrowserChrome
|
2014-06-06 06:51:14 +04:00
|
|
|
* @param aOpeningTab the TabParent that requested this new window be opened.
|
|
|
|
* Can be left null.
|
2016-10-07 21:59:59 +03:00
|
|
|
* @param aOpener The window which is requesting that this new window be opened.
|
2004-10-29 23:28:38 +04:00
|
|
|
* @return the newly minted window
|
|
|
|
*/
|
2014-06-06 06:51:14 +04:00
|
|
|
nsIXULWindow createNewWindow(in int32_t aChromeFlags,
|
2016-10-07 21:59:59 +03:00
|
|
|
in nsITabParent aOpeningTab,
|
|
|
|
in mozIDOMWindowProxy aOpener);
|
2004-08-21 18:47:51 +04:00
|
|
|
|
|
|
|
attribute nsIXULBrowserWindow XULBrowserWindow;
|
2006-07-25 04:20:33 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Back-door method to force application of chrome flags at a particular
|
|
|
|
* time. 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 applyChromeFlags();
|
2016-05-11 12:44:57 +03:00
|
|
|
|
|
|
|
/**
|
2016-07-14 23:31:41 +03:00
|
|
|
* 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.
|
|
|
|
*
|
2016-05-11 12:44:57 +03:00
|
|
|
* Note: this is an internal method, other consumers should never call this.
|
2016-07-14 23:31:41 +03:00
|
|
|
*
|
|
|
|
* @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.
|
2016-05-11 12:44:57 +03:00
|
|
|
*/
|
2016-07-14 23:31:41 +03:00
|
|
|
[noscript, notxpcom] void sizeShellToWithLimit(in int32_t aDesiredWidth,
|
|
|
|
in int32_t aDesiredHeight,
|
|
|
|
in int32_t shellItemWidth,
|
|
|
|
in int32_t shellItemHeight);
|
2000-01-14 07:23:38 +03:00
|
|
|
};
|