1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpfe/appshell/public/nsIAppShellService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,145 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +interface nsIXULWindow; 1.12 +interface nsIWebNavigation; 1.13 +interface nsIURI; 1.14 +interface nsIDOMWindow; 1.15 +interface nsIAppShell; 1.16 + 1.17 +[ptr] native JSContext(JSContext); 1.18 + 1.19 +%{C++ 1.20 +#include "js/TypeDecls.h" 1.21 +%} 1.22 + 1.23 +[scriptable, uuid(2fa2f813-c216-4efb-8a8c-de60108ce5e5)] 1.24 +interface nsIAppShellService : nsISupports 1.25 +{ 1.26 + /** 1.27 + * Create a window, which will be initially invisible. 1.28 + * @param aParent the parent window. Can be null. 1.29 + * @param aUrl the contents of the new window. 1.30 + * @param aChromeMask chrome flags affecting the kind of OS border 1.31 + * given to the window. see nsIBrowserWindow for 1.32 + * bit/flag definitions. 1.33 + * @param aCallbacks interface providing C++ hooks for window initialization 1.34 + * before the window is made visible. Can be null. 1.35 + * Deprecated. 1.36 + * @param aInitialWidth width, in pixels, of the window. Width of window 1.37 + * at creation. Can be overridden by the "width" 1.38 + * tag in the XUL. Set to NS_SIZETOCONTENT to force 1.39 + * the window to wrap to its contents. 1.40 + * @param aInitialHeight like aInitialWidth, but subtly different. 1.41 + * @param aResult the newly created window is returned here. 1.42 + */ 1.43 + const long SIZE_TO_CONTENT = -1; 1.44 + nsIXULWindow createTopLevelWindow(in nsIXULWindow aParent, 1.45 + in nsIURI aUrl, 1.46 + in uint32_t aChromeMask, 1.47 + in long aInitialWidth, 1.48 + in long aInitialHeight); 1.49 + 1.50 + /** 1.51 + * This is the constructor for creating an invisible DocShell. 1.52 + * It is used to simulate DOM windows without an actual physical 1.53 + * representation. 1.54 + * @param aIsChrome Set true if you want to use it for chrome content. 1.55 + */ 1.56 + nsIWebNavigation createWindowlessBrowser([optional] in bool aIsChrome); 1.57 + 1.58 + [noscript] 1.59 + void createHiddenWindow(); 1.60 + 1.61 + void destroyHiddenWindow(); 1.62 + 1.63 + /** 1.64 + * Return the (singleton) application hidden window, automatically created 1.65 + * and maintained by this AppShellService. 1.66 + * @param aResult the hidden window. Do not unhide hidden window. 1.67 + * Do not taunt hidden window. 1.68 + */ 1.69 + readonly attribute nsIXULWindow hiddenWindow; 1.70 + 1.71 + /** 1.72 + * Return the (singleton) application hidden window, automatically created 1.73 + * and maintained by this AppShellService. 1.74 + * @param aResult the hidden window. Do not unhide hidden window. 1.75 + * Do not taunt hidden window. 1.76 + */ 1.77 + readonly attribute nsIDOMWindow hiddenDOMWindow; 1.78 + 1.79 + /** 1.80 + * Return the (singleton) application hidden private window, automatically 1.81 + * created and maintained by this AppShellService. This window is created 1.82 + * in private browsing mode. 1.83 + * @param aResult the hidden private window. Do not unhide hidden window. 1.84 + * Do not taunt hidden window. 1.85 + */ 1.86 + readonly attribute nsIXULWindow hiddenPrivateWindow; 1.87 + 1.88 + /** 1.89 + * Return the (singleton) application hidden private window, automatically 1.90 + * created and maintained by this AppShellService. This window is created 1.91 + * in private browsing mode. 1.92 + * @param aResult the hidden private window. Do not unhide hidden window. 1.93 + * Do not taunt hidden window. 1.94 + */ 1.95 + readonly attribute nsIDOMWindow hiddenPrivateDOMWindow; 1.96 + 1.97 + /** 1.98 + * Return the (singleton) application hidden window as an nsIDOMWindow, 1.99 + * and, the corresponding JavaScript context pointer. This is useful 1.100 + * if you'd like to subsequently call OpenDialog on the hidden window. 1.101 + * @aHiddenDOMWindow the hidden window QI'd to type nsIDOMWindow 1.102 + * @aJSContext the corresponding JavaScript context 1.103 + */ 1.104 + [noscript] 1.105 + void getHiddenWindowAndJSContext(out nsIDOMWindow aHiddenDOMWindow, 1.106 + out JSContext aJSContext); 1.107 + 1.108 + /** 1.109 + * Return true if the application hidden window was provided by the 1.110 + * application. If it wasn't, the default hidden window was used. This will 1.111 + * usually be false on all non-mac platforms. 1.112 + */ 1.113 + readonly attribute boolean applicationProvidedHiddenWindow; 1.114 + 1.115 + /** 1.116 + * Add a window to the application's registry of windows. These windows 1.117 + * are generally shown in the Windows taskbar, and the application 1.118 + * knows it can't quit until it's out of registered windows. 1.119 + * @param aWindow the window to register 1.120 + * @note When this method is successful, it fires the global notification 1.121 + * "xul-window-registered" 1.122 + */ 1.123 + void registerTopLevelWindow(in nsIXULWindow aWindow); 1.124 + 1.125 + /** 1.126 + * Remove a window from the application's window registry. Note that 1.127 + * this method won't automatically attempt to quit the app when 1.128 + * the last window is unregistered. For that, see Quit(). 1.129 + * @param aWindow you see the pattern 1.130 + */ 1.131 + void unregisterTopLevelWindow(in nsIXULWindow aWindow); 1.132 + 1.133 + /** 1.134 + * Whether the hidden private window has been lazily created. 1.135 + */ 1.136 + [noscript] 1.137 + readonly attribute boolean hasHiddenPrivateWindow; 1.138 + 1.139 + /** 1.140 + * Start/stop tracking lags in the event loop. 1.141 + * If the event loop gets unresponsive, a "event-loop-lag" notification 1.142 + * is sent. Note that calling `startEventLoopLagTracking` when tracking 1.143 + * is already enabled has no effect. 1.144 + * @return true if tracking succeeded. 1.145 + */ 1.146 + bool startEventLoopLagTracking(); 1.147 + void stopEventLoopLagTracking(); 1.148 +};