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.


TOC PREV NEXT INDEX

Embedding Gecko API


nsIWebBrowserChrome


This interface must be implemented by the embedder in a class that also implements nsIEmbeddingSiteWindow. It corresponds to the top-level, outermost window containing an embedded Gecko WebBrowser. It is scriptable.

Methods
setStatus

Called when the status text in the chrome needs to be updated (e.g., when mousing over a link).

Syntax:

void nsIWebBrowserChrome::setStatus(
	in unsigned long statusType, in wstring status) 

Parameters:

statusType: What is setting the text. See Constants below for possible values.
status: The status string. null is an acceptable value, meaning no status.

nsresult :

NS_OK if successful.
destroyBrowserWindow

Destroys the window associated with the WebBrowser object.

Syntax:

void nsIWebBrowserChrome::destroyBrowserWindow() 

Parameters:

None.

nsresult :

NS_OK if successful.
sizeBrowserTo

Resizes the chrome so that the browser will be the specified size.

Syntax:

void nsIWebBrowserChrome::sizeBrowserTo(
	in long aCX, in long aCY) 

Parameters:

aCX: The new width of the browser.
aCY: The new height of the browser.

nsresult:

NS_OK if successful.
showAsModal

Shows the window as a modal window.

Syntax:

void nsIWebBrowserChrome::showAsModal() 

Parameters:

None.

nsresult:

A result code specified in exitModalEventLoop below. Usually NS_OK if successful.
isWindowModal

Indicates if the window is currently executing a modal loop.

Syntax:

boolean nsIWebBrowserChrome::isWindowModal() 

Parameters:

None.

Returns:

TRUE if the window is modal.
FALSE otherwise.
exitModalEventLoop

Exits a modal event loop if one is active. The implementation should also exit the loop if the window is destroyed.

Syntax:

void nsIWebBrowserChrome::exitModalEventLoop(
	in nsresult aStatus) 

Parameters:

aStatus: The result code to return from showAsModal above.

Returns:

NS_OK if successful.
Attributes and Constants
attribute nsIWebBrowser nsIWebBrowserChrome::webBrowser

Accesses the currently loaded WebBrowser. The browser chrome may be told to set the WebBrowser object to a new object by setting this attribute. In this case the implementer is responsible for taking the new WebBrowser object and doing any necessary initialization or setup as if it had created the WebBrowser itself. This includes positioning, setting up listeners, and so forth.

attribute unsigned long nsIWebBrowserChrome::chromeFlags

Accesses the chrome flags for this browser chrome. The implementation should reflect the value of this attribute by hiding or showing its chrome appropriately. See below for possible values.

const unsigned long nsIWebBrowserChrome::STATUS_SCRIPT=0x00000001
const unsigned long nsIWebBrowserChrome::STATUS_SCRIPT_DEFAULT=0x00000002
const unsigned long nsIWebBrowserChrome::STATUS_LINK=0x00000003

These constants are possible values for setStatus above.

const unsigned long nsIWebBrowserChrome::CHROME_DEFAULT=0x00000001
const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_BORDERS=0x00000002
const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_CLOSE=0x00000004
const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_RESIZE=0x00000008
const unsigned long nsIWebBrowserChrome::CHROME_MENUBAR=0x00000010
const unsigned long nsIWebBrowserChrome::CHROME_TOOLBAR=0x00000020
const unsigned long nsIWebBrowserChrome::CHROME_LOCATIONBAR=0x00000040
const unsigned long nsIWebBrowserChrome::CHROME_STATUSBAR=0x00000080
const unsigned long nsIWebBrowserChrome::CHROME_PERSONAL_TOOLBAR=0x00000100
const unsigned long nsIWebBrowserChrome::CHROME_SCROLLBARS=0x00000200
const unsigned long nsIWebBrowserChrome::CHROME_TITLEBAR=0x00000400

These are the standard values for the chromeFlags attribute above.

const unsigned long nsIWebBrowserChrome::CHROME_WITH_SIZE=0x00001000
const unsigned long nsIWebBrowserChrome::CHROME_WITH_POSITION=0x00002000

These flags are specifically for use with nsIWindowCreator.

const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_MIN=0x00004000
const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_POPUP=0x00008000
const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_RAISED=0x02000000
const unsigned long nsIWebBrowserChrome::CHROME_WINDOW_LOWERED=0x04000000
const unsigned long nsIWebBrowserChrome::CHROME_CENTER_SCREEN=0x08000000
const unsigned long nsIWebBrowserChrome::CHROME_DEPENDENT=0x10000000
const unsigned long nsIWebBrowserChrome::CHROME_MODAL=0x20000000
const unsigned long nsIWebBrowserChrome::CHROME_OPENAS_DIALOG=0x40000000
const unsigned long nsIWebBrowserChrome::CHROME_OPENAS_CHROME =0x80000000
const unsigned long nsIWebBrowserChrome::CHROME_ALL=0x00000ffe

These flags represent special cases.

Note: The modal style bit (CHROME_MODAL) simply affects the way the window looks and does not mean that the window is actually modal.


Written by:Ellen Evans | Comments, questions, complaints? Bug 143387
TOC PREV NEXT INDEX