PageRenderTime 381ms CodeModel.GetById 368ms RepoModel.GetById 1ms app.codeStats 0ms

/gecko_sdk/idl/nsIComponentRegistrar.idl

http://firefox-mac-pdf.googlecode.com/
IDL | 242 lines | 30 code | 27 blank | 185 comment | 0 complexity | b12ad63b4aa30bbb79e7c717e2f39e7f MD5 | raw file
  1. /* ***** BEGIN LICENSE BLOCK *****
  2. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3. *
  4. * The contents of this file are subject to the Mozilla Public License Version
  5. * 1.1 (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. * http://www.mozilla.org/MPL/
  8. *
  9. * Software distributed under the License is distributed on an "AS IS" basis,
  10. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. * for the specific language governing rights and limitations under the
  12. * License.
  13. *
  14. * The Original Code is XPCOM.
  15. *
  16. * The Initial Developer of the Original Code is Netscape Communications.
  17. * Portions created by the Initial Developer are Copyright (C) 2001
  18. * the Initial Developer. All Rights Reserved.
  19. *
  20. * Contributor(s):
  21. *
  22. * Alternatively, the contents of this file may be used under the terms of
  23. * either the GNU General Public License Version 2 or later (the "GPL"), or
  24. * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  25. * in which case the provisions of the GPL or the LGPL are applicable instead
  26. * of those above. If you wish to allow use of your version of this file only
  27. * under the terms of either the GPL or the LGPL, and not to allow others to
  28. * use your version of this file under the terms of the MPL, indicate your
  29. * decision by deleting the provisions above and replace them with the notice
  30. * and other provisions required by the GPL or the LGPL. If you do not delete
  31. * the provisions above, a recipient may use your version of this file under
  32. * the terms of any one of the MPL, the GPL or the LGPL.
  33. *
  34. * ***** END LICENSE BLOCK ***** */
  35. /**
  36. * The nsIComponentRegistrar interface.
  37. * @status FROZEN
  38. */
  39. #include "nsISupports.idl"
  40. interface nsIFile;
  41. interface nsIFactory;
  42. interface nsISimpleEnumerator;
  43. [scriptable, uuid(2417cbfe-65ad-48a6-b4b6-eb84db174392)]
  44. interface nsIComponentRegistrar : nsISupports
  45. {
  46. /**
  47. * autoRegister
  48. *
  49. * Register a component file or all component files in a directory.
  50. *
  51. * Component files must have an associated loader and export the required
  52. * symbols which this loader defines. For example, if the given file is a
  53. * native library (which is built into XPCOM), it must export the symbol
  54. * "NSGetModule". Other loaders may have different semantics.
  55. *
  56. * This method may only be called from the main thread.
  57. *
  58. * @param aSpec : Filename spec for component file's location. If aSpec
  59. * is a directory, then every component file in the
  60. * directory will be registered.
  61. * If aSpec is null, static components, GRE components,
  62. * and the application's component directories will be
  63. * registered. See NS_GRE_DIR, NS_XPCOM_COMPONENT_DIR,
  64. * and NS_XPCOM_COMPONENT_DIR_LIST in
  65. * nsDirectoryServiceDefs.h.
  66. */
  67. void autoRegister(in nsIFile aSpec);
  68. /**
  69. * autoUnregister
  70. *
  71. * Unregister a component file or all component files in a directory.
  72. * This method may only be called from the main thread.
  73. *
  74. * @param aSpec : Filename spec for component file's location. If aSpec
  75. * is a directory, the every component file in the directory
  76. * will be registered.
  77. * If aSpec is null, then the application component's
  78. * directory as defined by NS_XPCOM_COMPONENT_DIR will be
  79. * registered. (see nsIDirectoryService.idl)
  80. *
  81. * @return NS_OK Unregistration was successful.
  82. * NS_ERROR* Method failure.
  83. */
  84. void autoUnregister(in nsIFile aSpec);
  85. /**
  86. * registerFactory
  87. *
  88. * Register a factory with a given ContractID, CID and Class Name.
  89. *
  90. * @param aClass : CID of object
  91. * @param aClassName : Class Name of CID
  92. * @param aContractID : ContractID associated with CID aClass
  93. * @param aFactory : Factory that will be registered for CID aClass
  94. *
  95. * @return NS_OK Registration was successful.
  96. * NS_ERROR* method failure.
  97. */
  98. void registerFactory(in nsCIDRef aClass,
  99. in string aClassName,
  100. in string aContractID,
  101. in nsIFactory aFactory);
  102. /**
  103. * unregisterFactory
  104. *
  105. * Unregister a factory associated with CID aClass.
  106. *
  107. * @param aClass : CID being unregistered
  108. * @param aFactory : Factory previously registered to create instances of
  109. * CID aClass.
  110. *
  111. * @return NS_OK Unregistration was successful.
  112. * NS_ERROR* Method failure.
  113. */
  114. void unregisterFactory(in nsCIDRef aClass,
  115. in nsIFactory aFactory);
  116. /**
  117. * registerFactoryLocation
  118. *
  119. * Register a factory with a given ContractID, CID and Class Name
  120. *
  121. * @param aClass : CID of object
  122. * @param aClassName : Class Name of CID
  123. * @param aContractID : ContractID associated with CID aClass
  124. * @param aFile : Component File. This file must have an associated
  125. * loader and export the required symbols which this
  126. * loader specifies.
  127. * @param aLoaderStr : Opaque loader specific string. This value is
  128. * passed into the nsIModule's registerSelf
  129. * callback and must be fowarded unmodified when
  130. * registering factories via their location.
  131. * @param aType : Component Type of CID aClass. This value is
  132. * passed into the nsIModule's registerSelf
  133. * callback and must be fowarded unmodified when
  134. * registering factories via their location.
  135. *
  136. * @return NS_OK Registration was successful.
  137. * NS_ERROR* Method failure.
  138. */
  139. void registerFactoryLocation(in nsCIDRef aClass,
  140. in string aClassName,
  141. in string aContractID,
  142. in nsIFile aFile,
  143. in string aLoaderStr,
  144. in string aType);
  145. /**
  146. * unregisterFactoryLocation
  147. *
  148. * Unregister a factory associated with CID aClass.
  149. *
  150. * @param aClass : CID being unregistered
  151. * @param aFile : Component File previously registered
  152. *
  153. * @return NS_OK Unregistration was successful.
  154. * NS_ERROR* Method failure.
  155. */
  156. void unregisterFactoryLocation(in nsCIDRef aClass,
  157. in nsIFile aFile);
  158. /**
  159. * isCIDRegistered
  160. *
  161. * Returns true if a factory is registered for the CID.
  162. *
  163. * @param aClass : CID queried for registeration
  164. * @return : true if a factory is registered for CID
  165. * false otherwise.
  166. */
  167. boolean isCIDRegistered(in nsCIDRef aClass);
  168. /**
  169. * isContractIDRegistered
  170. *
  171. * Returns true if a factory is registered for the contract id.
  172. *
  173. * @param aClass : contract id queried for registeration
  174. * @return : true if a factory is registered for contract id
  175. * false otherwise.
  176. */
  177. boolean isContractIDRegistered(in string aContractID);
  178. /**
  179. * enumerateCIDs
  180. *
  181. * Enumerate the list of all registered CIDs.
  182. *
  183. * @return : enumerator for CIDs. Elements of the enumeration can be QI'ed
  184. * for the nsISupportsID interface. From the nsISupportsID, you
  185. * can obtain the actual CID.
  186. */
  187. nsISimpleEnumerator enumerateCIDs();
  188. /**
  189. * enumerateContractIDs
  190. *
  191. * Enumerate the list of all registered ContractIDs.
  192. *
  193. * @return : enumerator for ContractIDs. Elements of the enumeration can be
  194. * QI'ed for the nsISupportsCString interface. From the
  195. * nsISupportsCString interface, you can obtain the actual
  196. * Contract ID string.
  197. */
  198. nsISimpleEnumerator enumerateContractIDs();
  199. /**
  200. * CIDToContractID
  201. *
  202. * Returns the Contract ID for a given CID, if one exists and is registered.
  203. *
  204. * @return : Contract ID.
  205. */
  206. string CIDToContractID(in nsCIDRef aClass);
  207. /**
  208. * contractIDToCID
  209. *
  210. * Returns the CID for a given Contract ID, if one exists and is registered.
  211. *
  212. * @return : Contract ID.
  213. */
  214. nsCIDPtr contractIDToCID(in string aContractID);
  215. };