Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes
nsIWindowWatcher Interface Reference

import "nsIWindowWatcher.idl";

Inheritance diagram for nsIWindowWatcher:
Inheritance graph
[legend]
Collaboration diagram for nsIWindowWatcher:
Collaboration graph
[legend]

List of all members.

Public Member Functions

nsIDOMWindow openWindow (in nsIDOMWindow aParent, in string aUrl, in string aName, in string aFeatures, in nsISupports aArguments)
 Create a new window.
void registerNotification (in nsIObserver aObserver)
 Clients of this service can register themselves to be notified when a window is opened or closed (added to or removed from this service).
void unregisterNotification (in nsIObserver aObserver)
 Clients of this service can register themselves to be notified when a window is opened or closed (added to or removed from this service).
nsISimpleEnumerator getWindowEnumerator ()
 Get an iterator for currently open windows in the order they were opened, guaranteeing that each will be visited exactly once.
nsIPrompt getNewPrompter (in nsIDOMWindow aParent)
 Return a newly created nsIPrompt implementation.
nsIAuthPrompt getNewAuthPrompter (in nsIDOMWindow aParent)
 Return a newly created nsIAuthPrompt implementation.
void setWindowCreator (in nsIWindowCreator creator)
 Set the window creator callback.
nsIWebBrowserChrome getChromeForWindow (in nsIDOMWindow aWindow)
 Retrieve the chrome window mapped to the given DOM window.
nsIDOMWindow getWindowByName (in wstring aTargetName, in nsIDOMWindow aCurrentWindow)
 Retrieve an existing window (or frame).

Public Attributes

attribute nsIDOMWindow activeWindow
 The Watcher serves as a global storage facility for the current active (frontmost non-floating-palette-type) window, storing and returning it on demand.

Detailed Description

Definition at line 74 of file nsIWindowWatcher.idl.


Member Function Documentation

Retrieve the chrome window mapped to the given DOM window.

Window Watcher keeps a list of all top-level DOM windows currently open, along with their corresponding chrome interfaces. Since DOM Windows lack a (public) means of retrieving their corresponding chrome, this method will do that.

Parameters:
aWindowthe DOM window whose chrome window the caller needs
Returns:
the corresponding chrome window

Return a newly created nsIAuthPrompt implementation.

Parameters:
aParentthe parent window used for posing alerts. can be null.
Returns:
a new nsIAuthPrompt object

Return a newly created nsIPrompt implementation.

Parameters:
aParentthe parent window used for posing alerts. can be null.
Returns:
a new nsIPrompt object
nsIDOMWindow nsIWindowWatcher::getWindowByName ( in wstring  aTargetName,
in nsIDOMWindow  aCurrentWindow 
)

Retrieve an existing window (or frame).

Parameters:
aTargetNamethe window name
aCurrentWindowa starting point in the window hierarchy to begin the search. If null, each toplevel window will be searched.

Note: This method will search all open windows for any window or frame with the given window name. Make sure you understand the security implications of this before using this method!

Get an iterator for currently open windows in the order they were opened, guaranteeing that each will be visited exactly once.

Returns:
an enumerator which will itself return nsISupports objects which can be QIed to an nsIDOMWindow
nsIDOMWindow nsIWindowWatcher::openWindow ( in nsIDOMWindow  aParent,
in string  aUrl,
in string  aName,
in string  aFeatures,
in nsISupports  aArguments 
)

Create a new window.

It will automatically be added to our list (via addWindow()).

Parameters:
aParentparent window, if any. Null if no parent. If it is impossible to get to an nsIWebBrowserChrome from aParent, this method will effectively act as if aParent were null.
aURLurl to which to open the new window. Must already be escaped, if applicable. can be null.
aNamewindow name from JS window.open. can be null. If a window with this name already exists, the openWindow call may just load aUrl in it (if aUrl is not null) and return it.
aFeatureswindow features from JS window.open. can be null.
aArgumentsextra argument(s) to the new window, to be attached as the |arguments| property. An nsISupportsArray will be unwound into multiple arguments (but not recursively!). can be null.
Returns:
the new window
Note:
This method may examine the JS context stack for purposes of determining the security context to use for the search for a given window named aName.
This method should try to set the default charset for the new window to the default charset of aParent. This is not guaranteed, however.
This method may dispatch a "toplevel-window-ready" notification via nsIObserverService if the window did not already exist.

Clients of this service can register themselves to be notified when a window is opened or closed (added to or removed from this service).

This method adds an aObserver to the list of objects to be notified.

Parameters:
aObserverthe object to be notified when windows are opened or closed. Its Observe method will be called with the following parameters:

aObserver::Observe interprets its parameters so: aSubject the window being opened or closed, sent as an nsISupports which can be QIed to an nsIDOMWindow. aTopic a wstring, either "domwindowopened" or "domwindowclosed". someData not used.

Set the window creator callback.

It must be filled in by the app. openWindow will use it to create new windows.

Parameters:
creatorthe callback. if null, the callback will be cleared and window creation capabilities lost.

Clients of this service can register themselves to be notified when a window is opened or closed (added to or removed from this service).

This method removes an aObserver from the list of objects to be notified.

Parameters:
aObserverthe observer to be removed.

Member Data Documentation

The Watcher serves as a global storage facility for the current active (frontmost non-floating-palette-type) window, storing and returning it on demand.

Users must keep this attribute current, including after the topmost window is closed. This attribute obviously can return null if no windows are open, but should otherwise always return a valid window.

Definition at line 191 of file nsIWindowWatcher.idl.


The documentation for this interface was generated from the following file: