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


nsIModule


This interface handles module registration and management. It is scriptable.

Methods
getClassObject

Obtains a factory object from an nsIModule for a given CID and IID pair.

Syntax:

void nsIModule::getClassObject(
	in nsIComponentManager aCompMgr,
	in nsCIDRef aClass,in nsIIDRef aIID,
	[retval, iid_is(aIID)] out nsQIResult aResult) 

Parameters:

aCompMgr: The component manager.
aClass: The class ID of the class for which aResult is the factory.
aIID: The interface ID of the requested interface.
aResult: [out] The reference to return.

nsresult:

NS_OK if successful.
registerSelf

Registers module with the Component Manager.

Syntax:

void nsIModule::registerSelf(
	in nsIComponentManager aCompMgr,in nsIFile aLocation,
	in string aLoaderStr,in string aType)  

Parameters:

aCompMgr: The component manager.
aLocation : The location of the module on disk .
aLoaderStr: Opaque loader specific string.
aType: Loader Type being used to load this module.

nsresult:

NS_OK if successful.
unregisterSelf

Unregisters module with the Component Manager.

Syntax:

void nsIModule::unregisterSelf(
	in nsIComponentManager aCompMgr,
	in nsIFile aLocation,in string aLoaderStr)  

Parameters:

aCompMgr : The component manager.
aLocation : The location of the module on disk.
aLoaderStr: Opaque loader specific string.

nsresult:

NS_OK if successful.
canUnload

Indicates that the module is willing to be unloaded. This does not guarantee that the module will be unloaded.

Syntax:

boolean nsIModule::canUnload(
	in nsIComponentManager aCompMgr) 

Parameters:

aCompMgr: The component manager.

Return:

PR_TRUE if the module is willing to be unloaded. It is very important to check that no outstanding references to the module's code/data exist before returning TRUE.
PR_FALSE guarantees that the module will not be unloaded.

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