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.
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. IfaSpec
is a directory, then every component file in the directory will be registered. If theaSpec
isnull
, then the application component's directory as defined byNS_XPCOM_COMPONENT_DIR
will 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. IfaSpec
is a directory, then every component file in the directory will be unregistered. IfaSpec
isnull
, then the application component's directory as defined byNS_XPCOM_COMPONENT_DIR
will be unregistered (seensIDirectoryService
.id
l)
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
'sregisterSelf
callback and must be fowarded unmodified when registering factories via their location.
aType:
TheComponent Type ofaClass
. This value is passed into thensIModule
'sregisterSelf
callback and must be fowarded unmodified when registering factories via their location.
nsresult:
Unregisters a factory associated with
aClass
via location.Syntax:
void nsIComponentRegistrar::unregisterFactoryLocation( in nsCIDRef aClass, in nsIFile aFile)Parameters:
nsresult:
Returns
TRUE
if a factory is registered for a CID.Syntax:
boolean nsIComponentRegistrar::isCIDRegistered( in nsCIDRef aClass)Parameters:
Returns:
Returns
TRUE
if 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 |