nsIAppShellService

IID:E5E5AF70-8A38-11D2-9938-0080C7CB1080
Inherits From:nsISupports

This interface is implemented by the following components:


Constants

PRUint32 eConsiderQuit = 1
PRUint32 eAttemptQuit = 2
PRUint32 eForceQuit = 3
Create a window.
PRInt32 SIZE_TO_CONTENT = -1

Properties

readonly nsIDOMWindowInternal hiddenDOMWindow

Return the (singleton) application hidden window, automatically created and maintained by this AppShellService.

readonly nsIXULWindow hiddenWindow

Return the (singleton) application hidden window, automatically created and maintained by this AppShellService.

readonly nsINativeAppSupport nativeAppSupport

Getter for "native app support."


Methods

void closeTopLevelWindow ( nsIXULWindow window ) [noscript] void createHiddenWindow ( ) PRBool createStartupState ( PRInt32 windowWidth , PRInt32 windowHeight ) nsIXULWindow createTopLevelWindow ( nsIXULWindow parent , nsIURI url , PRBool showWindow , PRBool loadDefaultPage , PRUint32 chromeMask , PRInt32 initialWidth , PRInt32 initialHeight ) void doProfileStartup ( nsICmdLineService cmdLineService , PRBool canInteract ) void ensure1Window ( nsICmdLineService cmdLineService ) void enterLastWindowClosingSurvivalArea ( ) void exitLastWindowClosingSurvivalArea ( ) [noscript] void getHiddenWindowAndJSContext ( out nsIDOMWindowInternal hiddenDOMWindow , out JSContext* JSContext ) void hideSplashScreen ( ) void initialize ( nsICmdLineService cmdLineService , nsISupports nativeAppSupportOrSplashScreen ) void quit ( PRUint32 ferocity ) void registerTopLevelWindow ( nsIXULWindow window ) void run ( ) void topLevelWindowIsModal ( nsIXULWindow window , PRBool modal ) void unregisterTopLevelWindow ( nsIXULWindow window )

void closeTopLevelWindow ( nsIXULWindow window )

Close a window.

Arguments:
window: a window.

void createHiddenWindow ( )


PRBool createStartupState ( PRInt32 windowWidth , PRInt32 windowHeight )

Creates the initial state of the application by launching tasks specfied by "general.startup.*" prefs.

Arguments:
windowWidth: the width to make the initial window(s) opened
windowHeight: the height to make the initial window(s) opened
Returns:
TRUE if a window was opened

nsIXULWindow createTopLevelWindow ( nsIXULWindow parent , nsIURI url , PRBool showWindow , PRBool loadDefaultPage , PRUint32 chromeMask , PRInt32 initialWidth , PRInt32 initialHeight )

Arguments:
parent
url
showWindow
loadDefaultPage
chromeMask
initialWidth
initialHeight

void doProfileStartup ( nsICmdLineService cmdLineService , PRBool canInteract )

Starts up the profile manager with the given arguments

Arguments:
cmdLineService: the arguments given to the program
canInteract: If FALSE and UI is needed, will fail

void ensure1Window ( nsICmdLineService cmdLineService )

Ensures that at least one window exists after creating the startup state. If one has not been made, this will create a browser window.

Arguments:
cmdLineService: the command line from which startup args can be read.

void enterLastWindowClosingSurvivalArea ( )

During application startup (and at other times!) we may temporarily encounter a situation where all application windows will be closed but we don't want to take this as a signal to quit the app. Bracket the code where the last window could close with these. (And at application startup, on platforms that don't normally quit when the last window has closed, call Enter once, but not Exit)


void exitLastWindowClosingSurvivalArea ( )


void getHiddenWindowAndJSContext ( out nsIDOMWindowInternal hiddenDOMWindow , out JSContext* JSContext )

Return the (singleton) application hidden window as an nsIDOMWindowInternal, and, the corresponding JavaScript context pointer. This is useful if you'd like to subsequently call OpenDialog on the hidden window.

Arguments:
hiddenDOMWindow
JSContext

void hideSplashScreen ( )

Remove the splash screen (if visible). This need be called only once per application session.


void initialize ( nsICmdLineService cmdLineService , nsISupports nativeAppSupportOrSplashScreen )

Required initialization routine.

Arguments:
cmdLineService: is stored and passed to appshell components as they are initialized.
nativeAppSupportOrSplashScreen: is an object that can be QI'd to either an nsINativeAppSupport or nsISplashScreen; this object will be used to implement HideSplashScreen.

void quit ( PRUint32 ferocity )

Exit the event loop, shut down the app

Arguments:
ferocity

void registerTopLevelWindow ( nsIXULWindow window )

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.

Arguments:
window: yes

void run ( )

Runs an application event loop: normally the main event pump which defines the lifetime of the application.


void topLevelWindowIsModal ( nsIXULWindow window , PRBool modal )

The appshell service needs to be informed of modal XUL windows currently open. Call this method as a window becomes modal or as it becomes nonmodal.

Arguments:
window: no surprises here
modal: true if window is becoming modal false if window is becoming nonmodal (or being closed)

void unregisterTopLevelWindow ( nsIXULWindow window )

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().

Arguments:
window: you see the pattern

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com