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.
What Gecko Provides
The following is a description of some of the interfaces most commonly used in embedding Gecko. It is by no means an exhaustive list of the available interfaces. The interfaces in this section are on classes provided by Mozilla. There is also a set of interfaces for which Gecko expects the embedder to provide the implementation. A sample of those are covered in the next section.
Initialization and Teardown
There are two C++ only functions which serve to initalize and terminate Gecko. The initialization function (NS_InitEmbedding) must be called before attempting to use Gecko. It ensures XPCOM is started, creates the component registry if necessary, and starts global services. The shutdown function (NS_TermEmbedding) terminates the Gecko embedding layer, ensuring that global services are unloaded, files are closed and XPCOM is shut down.
nsIWebBrowser
Use of this interface during initialization allows embedders to associate a new nsWebBrowser instance (an object representing the "client-area" of a typical browser window) with the embedder's chrome and to register any listeners. The interface may also be used at runtime to obtain the content DOM window and from that the rest of the DOM.
nsIWebBrowserSetup
This interface is used to set basic properties (like whether image loading will be allowed) before the browser window is open.
nsIWebNavigation
The nsIWebNavigation interface is used to load URIs into the web browser instance and provide access to session history capabilities - such as back and forward. It is not, at this writing (8/19/02) frozen.
nsIWebBrowserPersist
The nsIWebBrowserPersist interface allows a URI to be saved to file. It is not, at this writing (8/19/02) frozen.
nsIBaseWindow
The nsIBaseWindow interface describes a generic window and basic operations (size, position, window title retrieval, etc.) that can be performed on it. It is not, at this writing (8/19/02), frozen.
nsISHistory
The nsISHistory interface provides access to session history information and allows that information to be purged.
nsIWebBrowserFind
The nsIWebBrowserFind interface controls the setup and execution of text searches in the browser window.
Written by: Ellen Evans | Comments, questions, complaints?
Bug 141350 |