2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; 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/. */
|
1999-06-25 05:15:19 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2000-02-29 03:20:55 +03:00
|
|
|
interface nsIXULWindow;
|
2016-01-16 06:23:09 +03:00
|
|
|
interface nsIWindowlessBrowser;
|
1999-06-25 05:15:19 +04:00
|
|
|
interface nsIURI;
|
2016-01-30 20:05:36 +03:00
|
|
|
interface mozIDOMWindowProxy;
|
2004-10-29 23:28:38 +04:00
|
|
|
interface nsIAppShell;
|
2019-04-09 23:59:37 +03:00
|
|
|
interface nsIRemoteTab;
|
1999-06-25 05:15:19 +04:00
|
|
|
|
1999-10-08 18:04:17 +04:00
|
|
|
[ptr] native JSContext(JSContext);
|
|
|
|
|
1999-06-25 05:15:19 +04:00
|
|
|
%{C++
|
2013-08-28 06:59:14 +04:00
|
|
|
#include "js/TypeDecls.h"
|
1999-06-25 05:15:19 +04:00
|
|
|
%}
|
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
[scriptable, uuid(19266025-354c-4bb9-986b-3483b2b1cdef)]
|
1999-06-25 05:15:19 +04:00
|
|
|
interface nsIAppShellService : nsISupports
|
|
|
|
{
|
1999-07-27 10:34:25 +04:00
|
|
|
/**
|
2005-02-20 01:42:01 +03:00
|
|
|
* Create a window, which will be initially invisible.
|
1999-07-27 10:34:25 +04:00
|
|
|
* @param aParent the parent window. Can be null.
|
|
|
|
* @param aUrl the contents of the new window.
|
|
|
|
* @param aChromeMask chrome flags affecting the kind of OS border
|
|
|
|
* given to the window. see nsIBrowserWindow for
|
|
|
|
* bit/flag definitions.
|
|
|
|
* @param aCallbacks interface providing C++ hooks for window initialization
|
|
|
|
* before the window is made visible. Can be null.
|
|
|
|
* Deprecated.
|
|
|
|
* @param aInitialWidth width, in pixels, of the window. Width of window
|
|
|
|
* at creation. Can be overridden by the "width"
|
|
|
|
* tag in the XUL. Set to NS_SIZETOCONTENT to force
|
|
|
|
* the window to wrap to its contents.
|
|
|
|
* @param aInitialHeight like aInitialWidth, but subtly different.
|
2019-04-09 23:59:37 +03:00
|
|
|
* @param aOpeningTab The RemoteTab that requested that this window be opened.
|
2014-06-06 06:51:14 +04:00
|
|
|
* Can be left null.
|
2016-10-07 21:59:59 +03:00
|
|
|
* @param aOpenerWindow The Window Proxy which requested that this window be opened.
|
|
|
|
* Can be left null.
|
1999-07-27 10:34:25 +04:00
|
|
|
*/
|
2001-09-10 23:42:54 +04:00
|
|
|
const long SIZE_TO_CONTENT = -1;
|
|
|
|
nsIXULWindow createTopLevelWindow(in nsIXULWindow aParent,
|
2019-05-23 01:37:14 +03:00
|
|
|
in nsIURI aUrl,
|
2012-08-22 19:56:38 +04:00
|
|
|
in uint32_t aChromeMask,
|
2001-09-10 23:42:54 +04:00
|
|
|
in long aInitialWidth,
|
2014-06-06 06:51:14 +04:00
|
|
|
in long aInitialHeight,
|
2019-04-09 23:59:37 +03:00
|
|
|
in nsIRemoteTab aOpeningTab,
|
2016-10-07 21:59:59 +03:00
|
|
|
in mozIDOMWindowProxy aOpenerWindow);
|
1999-07-27 10:34:25 +04:00
|
|
|
|
2013-10-16 17:18:42 +04:00
|
|
|
/**
|
|
|
|
* This is the constructor for creating an invisible DocShell.
|
|
|
|
* It is used to simulate DOM windows without an actual physical
|
|
|
|
* representation.
|
|
|
|
* @param aIsChrome Set true if you want to use it for chrome content.
|
|
|
|
*/
|
2016-01-16 06:23:09 +03:00
|
|
|
nsIWindowlessBrowser createWindowlessBrowser([optional] in bool aIsChrome);
|
2013-04-04 17:24:32 +04:00
|
|
|
|
1999-10-13 02:20:28 +04:00
|
|
|
[noscript]
|
2011-10-14 17:06:39 +04:00
|
|
|
void createHiddenWindow();
|
2004-10-29 23:28:38 +04:00
|
|
|
|
|
|
|
void destroyHiddenWindow();
|
1999-10-13 02:20:28 +04:00
|
|
|
|
2015-04-29 12:25:26 +03:00
|
|
|
/**
|
|
|
|
* B2G multi-screen support. When open another top-level window on b2g,
|
|
|
|
* a screen ID is needed for identifying which screen this window is
|
|
|
|
* opened to.
|
|
|
|
* @param aScreenId Differentiate screens of windows. It is platform-
|
|
|
|
* specific due to the hardware limitation for now.
|
|
|
|
*/
|
|
|
|
[noscript]
|
|
|
|
void setScreenId(in uint32_t aScreenId);
|
|
|
|
|
1999-07-27 10:34:25 +04:00
|
|
|
/**
|
|
|
|
* Return the (singleton) application hidden window, automatically created
|
|
|
|
* and maintained by this AppShellService.
|
|
|
|
* @param aResult the hidden window. Do not unhide hidden window.
|
|
|
|
* Do not taunt hidden window.
|
|
|
|
*/
|
2001-09-10 23:42:54 +04:00
|
|
|
readonly attribute nsIXULWindow hiddenWindow;
|
1999-07-27 10:34:25 +04:00
|
|
|
|
2000-05-25 04:44:10 +04:00
|
|
|
/**
|
|
|
|
* Return the (singleton) application hidden window, automatically created
|
|
|
|
* and maintained by this AppShellService.
|
|
|
|
* @param aResult the hidden window. Do not unhide hidden window.
|
|
|
|
* Do not taunt hidden window.
|
|
|
|
*/
|
2016-01-30 20:05:36 +03:00
|
|
|
readonly attribute mozIDOMWindowProxy hiddenDOMWindow;
|
2000-05-25 04:44:10 +04:00
|
|
|
|
2012-12-11 08:49:17 +04:00
|
|
|
/**
|
|
|
|
* Return the (singleton) application hidden private window, automatically
|
|
|
|
* created and maintained by this AppShellService. This window is created
|
|
|
|
* in private browsing mode.
|
|
|
|
* @param aResult the hidden private window. Do not unhide hidden window.
|
|
|
|
* Do not taunt hidden window.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIXULWindow hiddenPrivateWindow;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the (singleton) application hidden private window, automatically
|
|
|
|
* created and maintained by this AppShellService. This window is created
|
|
|
|
* in private browsing mode.
|
|
|
|
* @param aResult the hidden private window. Do not unhide hidden window.
|
|
|
|
* Do not taunt hidden window.
|
|
|
|
*/
|
2016-01-30 20:05:36 +03:00
|
|
|
readonly attribute mozIDOMWindowProxy hiddenPrivateDOMWindow;
|
2012-12-11 08:49:17 +04:00
|
|
|
|
2007-08-24 01:30:29 +04:00
|
|
|
/**
|
|
|
|
* Return true if the application hidden window was provided by the
|
|
|
|
* application. If it wasn't, the default hidden window was used. This will
|
|
|
|
* usually be false on all non-mac platforms.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean applicationProvidedHiddenWindow;
|
|
|
|
|
1999-07-27 10:34:25 +04:00
|
|
|
/**
|
|
|
|
* Add a window to the application's registry of windows. These windows
|
|
|
|
* are generally shown in the Windows taskbar, and the application
|
|
|
|
* knows it can't quit until it's out of registered windows.
|
2004-10-29 23:28:38 +04:00
|
|
|
* @param aWindow the window to register
|
|
|
|
* @note When this method is successful, it fires the global notification
|
|
|
|
* "xul-window-registered"
|
1999-07-27 10:34:25 +04:00
|
|
|
*/
|
2001-09-10 23:42:54 +04:00
|
|
|
void registerTopLevelWindow(in nsIXULWindow aWindow);
|
1999-07-27 10:34:25 +04:00
|
|
|
|
|
|
|
/**
|
2002-08-24 22:57:45 +04:00
|
|
|
* Remove a window from the application's window registry. Note that
|
|
|
|
* this method won't automatically attempt to quit the app when
|
|
|
|
* the last window is unregistered. For that, see Quit().
|
1999-07-27 10:34:25 +04:00
|
|
|
* @param aWindow you see the pattern
|
|
|
|
*/
|
2001-09-10 23:42:54 +04:00
|
|
|
void unregisterTopLevelWindow(in nsIXULWindow aWindow);
|
2013-01-07 06:16:48 +04:00
|
|
|
|
2019-03-05 23:18:25 +03:00
|
|
|
/**
|
|
|
|
* Whether the hidden window has been lazily created.
|
|
|
|
*/
|
|
|
|
readonly attribute boolean hasHiddenWindow;
|
|
|
|
|
2013-01-07 06:16:48 +04:00
|
|
|
/**
|
|
|
|
* Whether the hidden private window has been lazily created.
|
|
|
|
*/
|
|
|
|
[noscript]
|
|
|
|
readonly attribute boolean hasHiddenPrivateWindow;
|
2014-02-11 18:24:47 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Start/stop tracking lags in the event loop.
|
|
|
|
* If the event loop gets unresponsive, a "event-loop-lag" notification
|
|
|
|
* is sent. Note that calling `startEventLoopLagTracking` when tracking
|
|
|
|
* is already enabled has no effect.
|
|
|
|
* @return true if tracking succeeded.
|
|
|
|
*/
|
|
|
|
bool startEventLoopLagTracking();
|
|
|
|
void stopEventLoopLagTracking();
|
1999-06-25 05:15:19 +04:00
|
|
|
};
|