mozilla

Revision 96762 of Overview of Mozilla embedding APIs

  • Revision slug: Mozilla_embedding_APIs_overview
  • Revision title: Mozilla embedding APIs overview
  • Revision id: 96762
  • Created:
  • Creator: Dosido
  • Is current revision? No
  • Comment

Revision Content

Introduction

The Mozilla Public API consists of a collection of services and components which are accessed via XPCOM interfaces. Mozilla's XPCOM layer consists of a component model (called XPCOM) and the infrastructure necessary to support dynamic registration, instantiation and manipulation of XPCOM components.

At the heart of XPCOM's implementation is the Service Manager and the Component Manager. Together, these two services provide a centralized point for gaining access to all of the public Mozilla interfaces.

The Service Manager exposes all of the available XPCOM services - each service represents a global object which provides some piece of functionality. The Component Manager allows new instances of registered XPCOM components to be instantiated.

Image:public-apis-image2.gif

The embedding layer consists of several components built on top of XPCOM and its services. Much of the Gecko functionality is exposed through a component called the nsWebBrowser. Embedding applications can leverage this component to easily access many of Gecko's features. Each WebBrowser instance represents the "client-area" of a typical browser window. The WebBrowser exposes a set of interfaces which allow the embedding application to control activity and respond to changes within this client area. Using these interfaces an embedding application can build up its own user interface around a WebBrowser instance.

Image:public-apis-image1.gif

Public Classes

The following utility classes are available from the XPCOM DLL. They provide some basic functionality which should be leveraged when building new XPCOM components.

   * nsCOMPtr<interface-type>
   These are templatized smart pointers which transparently deal with XPCOM reference counting issues.  See the nsCOMPtr User's Manual for more information.
   *   nsString
     There are a collection of string classes which support both unicode and ASCII strings.  These classes provide a variety of string operations as well as dealing with the memory management issues of storing the underlying data. See the String Guide for more details. 
   * nsWeakPtr
     This is an nsCOMPtr which encapsulates XPCOM weak reference support.  See the nsIWeakReference document for more information.

Public Return Codes

   * NS_SUCCEEDED
   * NS_ERROR_FAILURE
   * NS_ERROR_NOT_IMPLEMENTED

Revision Source

<h2 name="Introduction"> Introduction </h2>
<p>The Mozilla Public API consists of a collection of services and components which are accessed via XPCOM interfaces.  Mozilla's XPCOM layer consists of a component model (called XPCOM) and the infrastructure necessary to support dynamic registration, instantiation and manipulation of XPCOM components.
</p><p>At the heart of XPCOM's implementation is the Service Manager and the Component Manager.  Together, these two services provide a centralized point for gaining access to all of the public Mozilla interfaces.
</p><p>The Service Manager exposes all of the available XPCOM services - each service represents a global object which provides some piece of functionality.  The Component Manager allows new instances of registered XPCOM components to be instantiated.
</p><p><img alt="Image:public-apis-image2.gif" src="File:en/Media_Gallery/Public-apis-image2.gif">
</p><p>The embedding layer consists of several components built on top of XPCOM and its services.  Much of the Gecko functionality is exposed through a component called the nsWebBrowser.  Embedding applications can leverage this component to easily access many of Gecko's features.  Each WebBrowser instance represents the "client-area" of a typical browser window.  The WebBrowser exposes a set of interfaces which allow the embedding application to control activity and respond to changes within this client area.  Using these interfaces an embedding application can build up its own user interface around a WebBrowser instance. 
</p><p><img alt="Image:public-apis-image1.gif" src="File:en/Media_Gallery/Public-apis-image1.gif">
</p>
<h2 name="Public_Classes"> Public Classes </h2>
<p>The following utility classes are available from the XPCOM DLL.  They provide some basic functionality which should be leveraged when building new XPCOM components.
</p>
<pre class="eval">   * nsCOMPtr&lt;interface-type&gt;
</pre>
<pre class="eval">   These are templatized smart pointers which transparently deal with XPCOM reference counting issues.  See the nsCOMPtr User's Manual for more information.
</pre>
<pre class="eval">   *   nsString
</pre>
<pre class="eval">     There are a collection of string classes which support both unicode and ASCII strings.  These classes provide a variety of string operations as well as dealing with the memory management issues of storing the underlying data. See the String Guide for more details. 
</pre>
<pre class="eval">   * nsWeakPtr
</pre>
<pre class="eval">     This is an nsCOMPtr which encapsulates XPCOM weak reference support.  See the nsIWeakReference document for more information.
</pre>
<h3 name="Public_Return_Codes"> Public Return Codes </h3>
<pre class="eval">   * NS_SUCCEEDED
   * NS_ERROR_FAILURE
   * NS_ERROR_NOT_IMPLEMENTED
</pre>
Revert to this revision