
nsIComponentRegistrar
This interface handles component registration and management.
Registers 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.
Syntax:
void nsIComponentRegistrar::autoRegister( in nsIFile aSpec)Parameters:
aSpec:Filename spec for component file's location. IfaSpecis a directory, then every component file in the directory will be registered. If theaSpecisnull, then the application component's directory as defined byNS_XPCOM_COMPONENT_DIRwill be registered (seensIDirectoryService.idl)
nsresult:
Unregisters a component file or all component files in a directory.
This method may only be called from the main thread.
Syntax:
void nsIComponentRegistrar::autoUnregister( in nsIFile aSpec)Parameters:
aSpec:Filename spec for component file's location. IfaSpecis a directory, then every component file in the directory will be unregistered. IfaSpecisnull, then the application component's directory as defined byNS_XPCOM_COMPONENT_DIRwill be unregistered (seensIDirectoryService.idl)
nsresult:
Registers a factory with a given ContractID, CID, and Class Name.
Syntax:
void nsIComponentRegistrar::registerFactory( in nsCIDRef aClass,in string aClassName, in string aContractID, in nsIFactory aFactory)Parameters:
nsresult:
Unregisters a factory associated with CID
aClass.Syntax:
void nsIComponentRegistrar::unregisterFactory( in nsCIDRef aClass, in nsIFactory aFactory)Parameters:
nsresult:
Registers a factory with a given ContractID, CID and Class Name via location.
Syntax:
void nsIComponentRegistrar::registerFactoryLocation( in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFile aFile, in string aLoaderStr, in string aType)Parameters:
aFile:The Component File. This file must have an associated loader and export the required symbols which this loader specifies.
aLoaderStr:An opaque loader specific string. This value is passed into thensIModule'sregisterSelfcallback and must be fowarded unmodified when registering factories via their location.
aType:TheComponent Type ofaClass. This value is passed into thensIModule'sregisterSelfcallback and must be fowarded unmodified when registering factories via their location.
nsresult:
Unregisters a factory associated with
aClassvia location.Syntax:
void nsIComponentRegistrar::unregisterFactoryLocation( in nsCIDRef aClass, in nsIFile aFile)Parameters:
nsresult:
Returns
TRUEif a factory is registered for a CID.Syntax:
boolean nsIComponentRegistrar::isCIDRegistered( in nsCIDRef aClass)Parameters:
Returns:
Returns
TRUEif a factory is registered for a ContractID.Syntax:
boolean nsIComponentRegistrar::isContractIDRegistered( in string aContractID)Parameters:
Returns:
Enumerates the list of all registered CIDs.
Syntax:
nsISimpleEnumerator nsIComponentRegistrar::enumerateCIDs()Parameters:
Returns:
Enumerates the list of all registered ContractIDs.
Syntax:
nsISimpleEnumerator nsIComponentRegistrar::enumerateContractIDs()Parameters:
Returns:
Gets the ContractID for a given CID, if one exists and is registered.
Syntax:
string nsIComponentRegistrar::CIDToContractID( in nsCIDRef aClass)Parameters:
Returns:
Gets the CID for a given Contract ID, if one exists and is registered.
Syntax:
nsCIDPtr nsIComponentRegistrar::contractIDToCID( in string aContractID)Parameters:
Returns:
| Written by:Ellen Evans | Comments, questions, complaints?
Bug 143387 |