You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is
highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If
there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.

nsIEmbeddingSiteWindow

This interface is implemented by the embedder to provide Gecko with the means to call up to the host to resize the window, hide or show it and set/get its title. This interface is scriptable except as noted below.

Methods

setDimensions

Sets the dimensions for the window, both its position and size. The flags indicate what the caller wants to set and whether the size refers to the inner or outer area. The inner area refers to just the embedded area, wheras the outer area can also include any surrounding chrome, window frame, title bar, and so on.

Syntax:

void nsIEmbeddingSiteWindow::setDimensions(
in unsigned long flags,in long x,in long y,
in long cx, in long cy)

Parameters:

flags: Combination of position, inner and outer size flags.

x: Left hand corner of the outer area.

y:Top corner of the outer area.

cx:Width of the inner or outer area.

cy: Height of the inner or outer area.

nsresult:

NS_OKif operation was performed correctly.

NS_ERROR_UNEXPECTEDif window could not be destroyed.

NS_ERROR_INVALID_ARGfor bad flag combination or illegal dimensions.

getDimensions

Gets the dimensions of the window. The caller may pass nsnull for any value it is uninterested in receiving.

Syntax:

void nsIEmbeddingSiteWindow::getDimensions(
in unsigned long flags,out long x,out long y,
out long cx,out long cy)

Parameters:

flags: Combination of position, inner and outer size flag .

x:[out] Left hand corner of the outer area; or nsnull.

y: [out]Top corner of the outer area; or nsnull.

cx:[out] Width of the inner or outer area; or nsnull.

cy:[out] Height of the inner or outer area; or nsnull.

nsresult

NS_OK if successful.

setFocus

Gives the window focus.

Syntax:

void nsIEmbeddingSiteWindow::setFocus()

Parameters:

None.

nsresult:

NS_OK if successful

Constants and Attributes

const unsigned long nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION=1

Flag indicates that position of the top left corner of the outer area is required/specified.

const unsigned long nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER = 2

Flag indicates that the size of the inner area is required/specified.

Note: The inner and outer flags are mutually exclusive and it is invalid to combine them.

const unsigned long nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER = 4

Flag indicates that the size of the outer area is required/specified.

attribute boolean nsIEmbeddingSiteWindow::visibility

Gets and sets the visibility of the window.

attribute wstring nsIEmbeddingSiteWindow::title

Gets and sets the title of the window.

readonly attribute voidPtr nsIEmbeddingSiteWindow::siteWindow

Gets the native window for the site's window. The implementor should copy the native window object into the address supplied by the caller. This attribute is not scriptable.

The type of the native window that the address refers to is platform and OS specific as follows: