1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/components/nsIComponentRegistrar.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,163 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +/** 1.9 + * The nsIComponentRegistrar interface. 1.10 + */ 1.11 + 1.12 +#include "nsISupports.idl" 1.13 + 1.14 +interface nsIFile; 1.15 +interface nsIFactory; 1.16 +interface nsISimpleEnumerator; 1.17 + 1.18 +[scriptable, uuid(2417cbfe-65ad-48a6-b4b6-eb84db174392)] 1.19 +interface nsIComponentRegistrar : nsISupports 1.20 +{ 1.21 + /** 1.22 + * autoRegister 1.23 + * 1.24 + * Register a .manifest file, or an entire directory containing 1.25 + * these files. Registration lasts for this run only, and is not cached. 1.26 + * 1.27 + * @note Formerly this method would register component files directly. This 1.28 + * is no longer supported. 1.29 + */ 1.30 + void autoRegister(in nsIFile aSpec); 1.31 + 1.32 + /** 1.33 + * autoUnregister 1.34 + * @status OBSOLETE: This method is no longer implemented, but preserved 1.35 + * in this interface for binary compatibility with 1.36 + * Mozilla 1.9.2. 1.37 + */ 1.38 + void autoUnregister(in nsIFile aSpec); 1.39 + 1.40 + 1.41 + /** 1.42 + * registerFactory 1.43 + * 1.44 + * Register a factory with a given ContractID, CID and Class Name. 1.45 + * 1.46 + * @param aClass : CID of object 1.47 + * @param aClassName : Class Name of CID (unused) 1.48 + * @param aContractID : ContractID associated with CID aClass. May be null 1.49 + * if no contract ID is needed. 1.50 + * @param aFactory : Factory that will be registered for CID aClass. 1.51 + * If aFactory is null, the contract will be associated 1.52 + * with a previously registered CID. 1.53 + */ 1.54 + void registerFactory(in nsCIDRef aClass, 1.55 + in string aClassName, 1.56 + in string aContractID, 1.57 + in nsIFactory aFactory); 1.58 + 1.59 + /** 1.60 + * unregisterFactory 1.61 + * 1.62 + * Unregister a factory associated with CID aClass. 1.63 + * 1.64 + * @param aClass : CID being unregistered 1.65 + * @param aFactory : Factory previously registered to create instances of 1.66 + * CID aClass. 1.67 + * 1.68 + * @throws NS_ERROR* Method failure. 1.69 + */ 1.70 + void unregisterFactory(in nsCIDRef aClass, 1.71 + in nsIFactory aFactory); 1.72 + 1.73 + /** 1.74 + * registerFactoryLocation 1.75 + * @status OBSOLETE: This method is no longer implemented, but preserved 1.76 + * in this interface for binary compatibility with 1.77 + * Mozilla 1.9.2. 1.78 + */ 1.79 + void registerFactoryLocation(in nsCIDRef aClass, 1.80 + in string aClassName, 1.81 + in string aContractID, 1.82 + in nsIFile aFile, 1.83 + in string aLoaderStr, 1.84 + in string aType); 1.85 + 1.86 + /** 1.87 + * unregisterFactoryLocation 1.88 + * @status OBSOLETE: This method is no longer implemented, but preserved 1.89 + * in this interface for binary compatibility with 1.90 + * Mozilla 1.9.2. 1.91 + */ 1.92 + void unregisterFactoryLocation(in nsCIDRef aClass, 1.93 + in nsIFile aFile); 1.94 + 1.95 + /** 1.96 + * isCIDRegistered 1.97 + * 1.98 + * Returns true if a factory is registered for the CID. 1.99 + * 1.100 + * @param aClass : CID queried for registeration 1.101 + * @return : true if a factory is registered for CID 1.102 + * false otherwise. 1.103 + */ 1.104 + boolean isCIDRegistered(in nsCIDRef aClass); 1.105 + 1.106 + /** 1.107 + * isContractIDRegistered 1.108 + * 1.109 + * Returns true if a factory is registered for the contract id. 1.110 + * 1.111 + * @param aClass : contract id queried for registeration 1.112 + * @return : true if a factory is registered for contract id 1.113 + * false otherwise. 1.114 + */ 1.115 + boolean isContractIDRegistered(in string aContractID); 1.116 + 1.117 + /** 1.118 + * enumerateCIDs 1.119 + * 1.120 + * Enumerate the list of all registered CIDs. 1.121 + * 1.122 + * @return : enumerator for CIDs. Elements of the enumeration can be QI'ed 1.123 + * for the nsISupportsID interface. From the nsISupportsID, you 1.124 + * can obtain the actual CID. 1.125 + */ 1.126 + nsISimpleEnumerator enumerateCIDs(); 1.127 + 1.128 + /** 1.129 + * enumerateContractIDs 1.130 + * 1.131 + * Enumerate the list of all registered ContractIDs. 1.132 + * 1.133 + * @return : enumerator for ContractIDs. Elements of the enumeration can be 1.134 + * QI'ed for the nsISupportsCString interface. From the 1.135 + * nsISupportsCString interface, you can obtain the actual 1.136 + * Contract ID string. 1.137 + */ 1.138 + nsISimpleEnumerator enumerateContractIDs(); 1.139 + 1.140 + /** 1.141 + * CIDToContractID 1.142 + * @status OBSOLETE: This method is no longer implemented, but preserved 1.143 + * in this interface for binary compatibility with 1.144 + * Mozilla 1.9.2. 1.145 + */ 1.146 + string CIDToContractID(in nsCIDRef aClass); 1.147 + 1.148 + /** 1.149 + * contractIDToCID 1.150 + * 1.151 + * Returns the CID for a given Contract ID, if one exists and is registered. 1.152 + * 1.153 + * @return : Contract ID. 1.154 + */ 1.155 + nsCIDPtr contractIDToCID(in string aContractID); 1.156 +}; 1.157 + 1.158 + 1.159 + 1.160 + 1.161 + 1.162 + 1.163 + 1.164 + 1.165 + 1.166 +