xpfe/appshell/public/nsIAppShellService.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsISupports.idl"
michael@0 7
michael@0 8 interface nsIXULWindow;
michael@0 9 interface nsIWebNavigation;
michael@0 10 interface nsIURI;
michael@0 11 interface nsIDOMWindow;
michael@0 12 interface nsIAppShell;
michael@0 13
michael@0 14 [ptr] native JSContext(JSContext);
michael@0 15
michael@0 16 %{C++
michael@0 17 #include "js/TypeDecls.h"
michael@0 18 %}
michael@0 19
michael@0 20 [scriptable, uuid(2fa2f813-c216-4efb-8a8c-de60108ce5e5)]
michael@0 21 interface nsIAppShellService : nsISupports
michael@0 22 {
michael@0 23 /**
michael@0 24 * Create a window, which will be initially invisible.
michael@0 25 * @param aParent the parent window. Can be null.
michael@0 26 * @param aUrl the contents of the new window.
michael@0 27 * @param aChromeMask chrome flags affecting the kind of OS border
michael@0 28 * given to the window. see nsIBrowserWindow for
michael@0 29 * bit/flag definitions.
michael@0 30 * @param aCallbacks interface providing C++ hooks for window initialization
michael@0 31 * before the window is made visible. Can be null.
michael@0 32 * Deprecated.
michael@0 33 * @param aInitialWidth width, in pixels, of the window. Width of window
michael@0 34 * at creation. Can be overridden by the "width"
michael@0 35 * tag in the XUL. Set to NS_SIZETOCONTENT to force
michael@0 36 * the window to wrap to its contents.
michael@0 37 * @param aInitialHeight like aInitialWidth, but subtly different.
michael@0 38 * @param aResult the newly created window is returned here.
michael@0 39 */
michael@0 40 const long SIZE_TO_CONTENT = -1;
michael@0 41 nsIXULWindow createTopLevelWindow(in nsIXULWindow aParent,
michael@0 42 in nsIURI aUrl,
michael@0 43 in uint32_t aChromeMask,
michael@0 44 in long aInitialWidth,
michael@0 45 in long aInitialHeight);
michael@0 46
michael@0 47 /**
michael@0 48 * This is the constructor for creating an invisible DocShell.
michael@0 49 * It is used to simulate DOM windows without an actual physical
michael@0 50 * representation.
michael@0 51 * @param aIsChrome Set true if you want to use it for chrome content.
michael@0 52 */
michael@0 53 nsIWebNavigation createWindowlessBrowser([optional] in bool aIsChrome);
michael@0 54
michael@0 55 [noscript]
michael@0 56 void createHiddenWindow();
michael@0 57
michael@0 58 void destroyHiddenWindow();
michael@0 59
michael@0 60 /**
michael@0 61 * Return the (singleton) application hidden window, automatically created
michael@0 62 * and maintained by this AppShellService.
michael@0 63 * @param aResult the hidden window. Do not unhide hidden window.
michael@0 64 * Do not taunt hidden window.
michael@0 65 */
michael@0 66 readonly attribute nsIXULWindow hiddenWindow;
michael@0 67
michael@0 68 /**
michael@0 69 * Return the (singleton) application hidden window, automatically created
michael@0 70 * and maintained by this AppShellService.
michael@0 71 * @param aResult the hidden window. Do not unhide hidden window.
michael@0 72 * Do not taunt hidden window.
michael@0 73 */
michael@0 74 readonly attribute nsIDOMWindow hiddenDOMWindow;
michael@0 75
michael@0 76 /**
michael@0 77 * Return the (singleton) application hidden private window, automatically
michael@0 78 * created and maintained by this AppShellService. This window is created
michael@0 79 * in private browsing mode.
michael@0 80 * @param aResult the hidden private window. Do not unhide hidden window.
michael@0 81 * Do not taunt hidden window.
michael@0 82 */
michael@0 83 readonly attribute nsIXULWindow hiddenPrivateWindow;
michael@0 84
michael@0 85 /**
michael@0 86 * Return the (singleton) application hidden private window, automatically
michael@0 87 * created and maintained by this AppShellService. This window is created
michael@0 88 * in private browsing mode.
michael@0 89 * @param aResult the hidden private window. Do not unhide hidden window.
michael@0 90 * Do not taunt hidden window.
michael@0 91 */
michael@0 92 readonly attribute nsIDOMWindow hiddenPrivateDOMWindow;
michael@0 93
michael@0 94 /**
michael@0 95 * Return the (singleton) application hidden window as an nsIDOMWindow,
michael@0 96 * and, the corresponding JavaScript context pointer. This is useful
michael@0 97 * if you'd like to subsequently call OpenDialog on the hidden window.
michael@0 98 * @aHiddenDOMWindow the hidden window QI'd to type nsIDOMWindow
michael@0 99 * @aJSContext the corresponding JavaScript context
michael@0 100 */
michael@0 101 [noscript]
michael@0 102 void getHiddenWindowAndJSContext(out nsIDOMWindow aHiddenDOMWindow,
michael@0 103 out JSContext aJSContext);
michael@0 104
michael@0 105 /**
michael@0 106 * Return true if the application hidden window was provided by the
michael@0 107 * application. If it wasn't, the default hidden window was used. This will
michael@0 108 * usually be false on all non-mac platforms.
michael@0 109 */
michael@0 110 readonly attribute boolean applicationProvidedHiddenWindow;
michael@0 111
michael@0 112 /**
michael@0 113 * Add a window to the application's registry of windows. These windows
michael@0 114 * are generally shown in the Windows taskbar, and the application
michael@0 115 * knows it can't quit until it's out of registered windows.
michael@0 116 * @param aWindow the window to register
michael@0 117 * @note When this method is successful, it fires the global notification
michael@0 118 * "xul-window-registered"
michael@0 119 */
michael@0 120 void registerTopLevelWindow(in nsIXULWindow aWindow);
michael@0 121
michael@0 122 /**
michael@0 123 * Remove a window from the application's window registry. Note that
michael@0 124 * this method won't automatically attempt to quit the app when
michael@0 125 * the last window is unregistered. For that, see Quit().
michael@0 126 * @param aWindow you see the pattern
michael@0 127 */
michael@0 128 void unregisterTopLevelWindow(in nsIXULWindow aWindow);
michael@0 129
michael@0 130 /**
michael@0 131 * Whether the hidden private window has been lazily created.
michael@0 132 */
michael@0 133 [noscript]
michael@0 134 readonly attribute boolean hasHiddenPrivateWindow;
michael@0 135
michael@0 136 /**
michael@0 137 * Start/stop tracking lags in the event loop.
michael@0 138 * If the event loop gets unresponsive, a "event-loop-lag" notification
michael@0 139 * is sent. Note that calling `startEventLoopLagTracking` when tracking
michael@0 140 * is already enabled has no effect.
michael@0 141 * @return true if tracking succeeded.
michael@0 142 */
michael@0 143 bool startEventLoopLagTracking();
michael@0 144 void stopEventLoopLagTracking();
michael@0 145 };

mercurial