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


nsISupports


This is the interface from which all other XPCOM interfaces inherit. It provides the foundation for XPCOM interface discovery and lifetime object management. The interface is partially scriptable.

Methods
QueryInterface

Provides a mechanism for requesting interfaces to which a given object might provide access. This method is scriptable.

Syntax:

void nsISupports::QueryInterface(in nsIIDRef uuid,
	[iid_is(uuid),retval] out nsQIResult result); 

Parameters:

uuid: The IID of the requested interface.
result: [out] The reference to return.

nsresult:

NS_OK if the interface was successfully returned.
NS_NOINTERFACE if the object does not support the given interface.
AddRef

Increments the internal refcount of the interface. This method is included for completeness. When writing code, use of NS_ADDREF or an nsCOMPtr to manage incrementing is strongly preferred. This method is not scriptable. In JavaScript it is taken care of automatically by XPConnect.

Syntax:

nsrefcnt nsISupports::AddRef() 

Parameters:

None.

Result:

The refcount.
Release

Decrements the internal refcount of the interface. When the count reaches zero, the interface deletes itself. This method is included for completeness. When writing code, use of NS_RELEASE or an nsCOMPtr to manage decrementing is strongly preferred. This method is not scriptable. In JavaScript it is taken care of automatically by XPConnect.

Syntax:

nsrefcnt nsISupports::Release() 

Parameters:

None.

Result:

The refcount.

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