2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
interface nsIXULWindow;
|
|
|
|
interface nsIURI;
|
2011-07-15 03:31:34 -07:00
|
|
|
interface nsIDOMWindow;
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsIAppShell;
|
|
|
|
|
|
|
|
[ptr] native JSContext(JSContext);
|
|
|
|
|
|
|
|
%{C++
|
|
|
|
struct JSContext;
|
|
|
|
%}
|
|
|
|
|
2011-10-14 06:06:39 -07:00
|
|
|
[scriptable, uuid(EBCD34E2-2E43-45C0-AAC8-E6F1C692B371)]
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsIAppShellService : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Create a window, which will be initially invisible.
|
|
|
|
* @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.
|
|
|
|
* @param aResult the newly created window is returned here.
|
|
|
|
*/
|
|
|
|
const long SIZE_TO_CONTENT = -1;
|
|
|
|
nsIXULWindow createTopLevelWindow(in nsIXULWindow aParent,
|
|
|
|
in nsIURI aUrl,
|
2012-08-22 08:56:38 -07:00
|
|
|
in uint32_t aChromeMask,
|
2007-03-22 10:30:00 -07:00
|
|
|
in long aInitialWidth,
|
2011-10-14 06:06:39 -07:00
|
|
|
in long aInitialHeight);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
[noscript]
|
2011-10-14 06:06:39 -07:00
|
|
|
void createHiddenWindow();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
void destroyHiddenWindow();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIXULWindow hiddenWindow;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2011-07-15 03:31:34 -07:00
|
|
|
readonly attribute nsIDOMWindow hiddenDOMWindow;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
2011-07-15 03:31:34 -07:00
|
|
|
* Return the (singleton) application hidden window as an nsIDOMWindow,
|
2007-03-22 10:30:00 -07:00
|
|
|
* and, the corresponding JavaScript context pointer. This is useful
|
|
|
|
* if you'd like to subsequently call OpenDialog on the hidden window.
|
2011-07-15 03:31:34 -07:00
|
|
|
* @aHiddenDOMWindow the hidden window QI'd to type nsIDOMWindow
|
2007-03-22 10:30:00 -07:00
|
|
|
* @aJSContext the corresponding JavaScript context
|
|
|
|
*/
|
|
|
|
[noscript]
|
2011-07-15 03:31:34 -07:00
|
|
|
void getHiddenWindowAndJSContext(out nsIDOMWindow aHiddenDOMWindow,
|
2007-03-22 10:30:00 -07:00
|
|
|
out JSContext aJSContext);
|
|
|
|
|
2007-08-23 14:30:29 -07: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;
|
|
|
|
|
2007-03-22 10:30:00 -07: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.
|
|
|
|
* @param aWindow the window to register
|
|
|
|
* @note When this method is successful, it fires the global notification
|
|
|
|
* "xul-window-registered"
|
|
|
|
*/
|
|
|
|
void registerTopLevelWindow(in nsIXULWindow aWindow);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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().
|
|
|
|
* @param aWindow you see the pattern
|
|
|
|
*/
|
|
|
|
void unregisterTopLevelWindow(in nsIXULWindow aWindow);
|
|
|
|
};
|