nsIComponentRegistrar

IID:2417cbfe-65ad-48a6-b4b6-eb84db174392
Inherits From:nsISupports

Methods

void autoRegister ( nsIFile spec ) void autoUnregister ( nsIFile spec ) char* CIDToContractID ( nsCIDRef class ) nsCIDPtr* contractIDToCID ( char* contractID ) nsISimpleEnumerator enumerateCIDs ( ) nsISimpleEnumerator enumerateContractIDs ( ) PRBool isCIDRegistered ( nsCIDRef class ) PRBool isContractIDRegistered ( char* contractID ) void registerFactory ( nsCIDRef class , char* className , char* contractID , nsIFactory factory ) void registerFactoryLocation ( nsCIDRef class , char* className , char* contractID , nsIFile file , char* loaderStr , char* type ) void unregisterFactory ( nsCIDRef class , nsIFactory factory ) void unregisterFactoryLocation ( nsCIDRef class , nsIFile file )

void autoRegister ( nsIFile spec )

Register a component file or all component files in a directory.

Component files must have an associated loader and export the required symbols which this loader defines. For example, if the given file is a native library (which is built into XPCOM), it must export the symbol "NSGetModule". Other loaders may have different semantics.

This method may only be called from the main thread.

Arguments:
spec: : Filename spec for component file's location. If spec is a directory, then every component file in the directory will be registered. If the spec is null, then the application component's directory as defined by NS_XPCOM_COMPONENT_DIR will be registered (see nsIDirectoryService.idl)
Returns:
NS_OK : Registration was successful. NS_ERROR: Method failure.

void autoUnregister ( nsIFile spec )

Unregister a component file or all component files in a directory. This method may only be called from the main thread.

Arguments:
spec: : Filename spec for component file's location. If spec is a directory, the every component file in the directory will be registered. If spec is null, then the application component's directory as defined by NS_XPCOM_COMPONENT_DIR will be registered. (see nsIDirectoryService.idl)
Returns:
NS_OK Unregistration was successful. NS_ERROR* Method failure.

char* CIDToContractID ( nsCIDRef class )

Returns the Contract ID for a given CID, if one exists and is registered.

Arguments:
class
Returns:
: Contract ID.

nsCIDPtr* contractIDToCID ( char* contractID )

Returns the CID for a given Contract ID, if one exists and is registered.

Arguments:
contractID
Returns:
: Contract ID.

nsISimpleEnumerator enumerateCIDs ( )

Enumerate the list of all registered CIDs.

Returns:
nsISupportsID interface. From the nsISupportsID, you

nsISimpleEnumerator enumerateContractIDs ( )

Enumerate the list of all registered ContractIDs.

Returns:
nsISupportsCString interface. From the

PRBool isCIDRegistered ( nsCIDRef class )

Returns true if a factory is registered for the CID.

Arguments:
class: : CID queried for registeration
Returns:
: true if a factory is registered for CID false otherwise.

PRBool isContractIDRegistered ( char* contractID )

Returns true if a factory is registered for the contract id.

Arguments:
contractID
Returns:
: true if a factory is registered for contract id false otherwise.

void registerFactory ( nsCIDRef class , char* className , char* contractID , nsIFactory factory )

Register a factory with a given ContractID, CID and Class Name.

Arguments:
class: : CID of object
className: : Class Name of CID
contractID: : ContractID associated with CID class
factory: : Factory that will be registered for CID class
Returns:
NS_OK Registration was successful. NS_ERROR* method failure.

void registerFactoryLocation ( nsCIDRef class , char* className , char* contractID , nsIFile file , char* loaderStr , char* type )

Register a factory with a given ContractID, CID and Class Name

Arguments:
class: : CID of object
className: : Class Name of CID
contractID: : ContractID associated with CID class
file: : Component File. This file must have an associated loader and export the required symbols which this loader specifies.
loaderStr: : Opaque loader specific string. This value is passed into the nsIModule's registerSelf callback and must be fowarded unmodified when registering factories via their location.
type: : Component Type of CID class. This value is passed into the nsIModule's registerSelf callback and must be fowarded unmodified when registering factories via their location.
Returns:
NS_OK Registration was successful. NS_ERROR* Method failure.

void unregisterFactory ( nsCIDRef class , nsIFactory factory )

Unregister a factory associated with CID class.

Arguments:
class: : CID being unregistered
factory: : Factory previously registered to create instances of CID class.
Returns:
NS_OK Unregistration was successful. NS_ERROR* Method failure.

void unregisterFactoryLocation ( nsCIDRef class , nsIFile file )

Unregister a factory associated with CID class.

Arguments:
class: : CID being unregistered
file: : Component File previously registered
Returns:
NS_OK Unregistration was successful. NS_ERROR* Method failure.

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com