nsIComponentRegistrar.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/xpcom/components/nsIComponentRegistrar.idl
  3. */
  4. #ifndef __gen_nsIComponentRegistrar_h__
  5. #define __gen_nsIComponentRegistrar_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. class nsIFile; /* forward declaration */
  14. class nsIFactory; /* forward declaration */
  15. class nsISimpleEnumerator; /* forward declaration */
  16. /* starting interface: nsIComponentRegistrar */
  17. #define NS_ICOMPONENTREGISTRAR_IID_STR "2417cbfe-65ad-48a6-b4b6-eb84db174392"
  18. #define NS_ICOMPONENTREGISTRAR_IID \
  19. {0x2417cbfe, 0x65ad, 0x48a6, \
  20. { 0xb4, 0xb6, 0xeb, 0x84, 0xdb, 0x17, 0x43, 0x92 }}
  21. class NS_NO_VTABLE nsIComponentRegistrar : public nsISupports {
  22. public:
  23. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICOMPONENTREGISTRAR_IID)
  24. /**
  25. * autoRegister
  26. *
  27. * Register a component file or all component files in a directory.
  28. *
  29. * Component files must have an associated loader and export the required
  30. * symbols which this loader defines. For example, if the given file is a
  31. * native library (which is built into XPCOM), it must export the symbol
  32. * "NSGetModule". Other loaders may have different semantics.
  33. *
  34. * This method may only be called from the main thread.
  35. *
  36. * @param aSpec : Filename spec for component file's location. If aSpec
  37. * is a directory, then every component file in the
  38. * directory will be registered.
  39. * If the aSpec is null, then the application component's
  40. * directory as defined by NS_XPCOM_COMPONENT_DIR will be
  41. * registered (see nsIDirectoryService.idl)
  42. *
  43. * @return NS_OK : Registration was successful.
  44. * NS_ERROR: Method failure.
  45. */
  46. /* void autoRegister (in nsIFile aSpec); */
  47. NS_IMETHOD AutoRegister(nsIFile *aSpec) = 0;
  48. /**
  49. * autoUnregister
  50. *
  51. * Unregister a component file or all component files in a directory.
  52. * This method may only be called from the main thread.
  53. *
  54. * @param aSpec : Filename spec for component file's location. If aSpec
  55. * is a directory, the every component file in the directory
  56. * will be registered.
  57. * If aSpec is null, then the application component's
  58. * directory as defined by NS_XPCOM_COMPONENT_DIR will be
  59. * registered. (see nsIDirectoryService.idl)
  60. *
  61. * @return NS_OK Unregistration was successful.
  62. * NS_ERROR* Method failure.
  63. */
  64. /* void autoUnregister (in nsIFile aSpec); */
  65. NS_IMETHOD AutoUnregister(nsIFile *aSpec) = 0;
  66. /**
  67. * registerFactory
  68. *
  69. * Register a factory with a given ContractID, CID and Class Name.
  70. *
  71. * @param aClass : CID of object
  72. * @param aClassName : Class Name of CID
  73. * @param aContractID : ContractID associated with CID aClass
  74. * @param aFactory : Factory that will be registered for CID aClass
  75. *
  76. * @return NS_OK Registration was successful.
  77. * NS_ERROR* method failure.
  78. */
  79. /* void registerFactory (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFactory aFactory); */
  80. NS_IMETHOD RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory) = 0;
  81. /**
  82. * unregisterFactory
  83. *
  84. * Unregister a factory associated with CID aClass.
  85. *
  86. * @param aClass : CID being unregistered
  87. * @param aFactory : Factory previously registered to create instances of
  88. * CID aClass.
  89. *
  90. * @return NS_OK Unregistration was successful.
  91. * NS_ERROR* Method failure.
  92. */
  93. /* void unregisterFactory (in nsCIDRef aClass, in nsIFactory aFactory); */
  94. NS_IMETHOD UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory) = 0;
  95. /**
  96. * registerFactoryLocation
  97. *
  98. * Register a factory with a given ContractID, CID and Class Name
  99. *
  100. * @param aClass : CID of object
  101. * @param aClassName : Class Name of CID
  102. * @param aContractID : ContractID associated with CID aClass
  103. * @param aFile : Component File. This file must have an associated
  104. * loader and export the required symbols which this
  105. * loader specifies.
  106. * @param aLoaderStr : Opaque loader specific string. This value is
  107. * passed into the nsIModule's registerSelf
  108. * callback and must be fowarded unmodified when
  109. * registering factories via their location.
  110. * @param aType : Component Type of CID aClass. This value is
  111. * passed into the nsIModule's registerSelf
  112. * callback and must be fowarded unmodified when
  113. * registering factories via their location.
  114. *
  115. * @return NS_OK Registration was successful.
  116. * NS_ERROR* Method failure.
  117. */
  118. /* void registerFactoryLocation (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFile aFile, in string aLoaderStr, in string aType); */
  119. NS_IMETHOD RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType) = 0;
  120. /**
  121. * unregisterFactoryLocation
  122. *
  123. * Unregister a factory associated with CID aClass.
  124. *
  125. * @param aClass : CID being unregistered
  126. * @param aFile : Component File previously registered
  127. *
  128. * @return NS_OK Unregistration was successful.
  129. * NS_ERROR* Method failure.
  130. */
  131. /* void unregisterFactoryLocation (in nsCIDRef aClass, in nsIFile aFile); */
  132. NS_IMETHOD UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile) = 0;
  133. /**
  134. * isCIDRegistered
  135. *
  136. * Returns true if a factory is registered for the CID.
  137. *
  138. * @param aClass : CID queried for registeration
  139. * @return : true if a factory is registered for CID
  140. * false otherwise.
  141. */
  142. /* boolean isCIDRegistered (in nsCIDRef aClass); */
  143. NS_IMETHOD IsCIDRegistered(const nsCID & aClass, PRBool *_retval) = 0;
  144. /**
  145. * isContractIDRegistered
  146. *
  147. * Returns true if a factory is registered for the contract id.
  148. *
  149. * @param aClass : contract id queried for registeration
  150. * @return : true if a factory is registered for contract id
  151. * false otherwise.
  152. */
  153. /* boolean isContractIDRegistered (in string aContractID); */
  154. NS_IMETHOD IsContractIDRegistered(const char *aContractID, PRBool *_retval) = 0;
  155. /**
  156. * enumerateCIDs
  157. *
  158. * Enumerate the list of all registered CIDs.
  159. *
  160. * @return : enumerator for CIDs. Elements of the enumeration can be QI'ed
  161. * for the nsISupportsID interface. From the nsISupportsID, you
  162. * can obtain the actual CID.
  163. */
  164. /* nsISimpleEnumerator enumerateCIDs (); */
  165. NS_IMETHOD EnumerateCIDs(nsISimpleEnumerator **_retval) = 0;
  166. /**
  167. * enumerateContractIDs
  168. *
  169. * Enumerate the list of all registered ContractIDs.
  170. *
  171. * @return : enumerator for ContractIDs. Elements of the enumeration can be
  172. * QI'ed for the nsISupportsCString interface. From the
  173. * nsISupportsCString interface, you can obtain the actual
  174. * Contract ID string.
  175. */
  176. /* nsISimpleEnumerator enumerateContractIDs (); */
  177. NS_IMETHOD EnumerateContractIDs(nsISimpleEnumerator **_retval) = 0;
  178. /**
  179. * CIDToContractID
  180. *
  181. * Returns the Contract ID for a given CID, if one exists and is registered.
  182. *
  183. * @return : Contract ID.
  184. */
  185. /* string CIDToContractID (in nsCIDRef aClass); */
  186. NS_IMETHOD CIDToContractID(const nsCID & aClass, char **_retval) = 0;
  187. /**
  188. * contractIDToCID
  189. *
  190. * Returns the CID for a given Contract ID, if one exists and is registered.
  191. *
  192. * @return : Contract ID.
  193. */
  194. /* nsCIDPtr contractIDToCID (in string aContractID); */
  195. NS_IMETHOD ContractIDToCID(const char *aContractID, nsCID * *_retval) = 0;
  196. };
  197. /* Use this macro when declaring classes that implement this interface. */
  198. #define NS_DECL_NSICOMPONENTREGISTRAR \
  199. NS_IMETHOD AutoRegister(nsIFile *aSpec); \
  200. NS_IMETHOD AutoUnregister(nsIFile *aSpec); \
  201. NS_IMETHOD RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory); \
  202. NS_IMETHOD UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory); \
  203. NS_IMETHOD RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType); \
  204. NS_IMETHOD UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile); \
  205. NS_IMETHOD IsCIDRegistered(const nsCID & aClass, PRBool *_retval); \
  206. NS_IMETHOD IsContractIDRegistered(const char *aContractID, PRBool *_retval); \
  207. NS_IMETHOD EnumerateCIDs(nsISimpleEnumerator **_retval); \
  208. NS_IMETHOD EnumerateContractIDs(nsISimpleEnumerator **_retval); \
  209. NS_IMETHOD CIDToContractID(const nsCID & aClass, char **_retval); \
  210. NS_IMETHOD ContractIDToCID(const char *aContractID, nsCID * *_retval);
  211. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  212. #define NS_FORWARD_NSICOMPONENTREGISTRAR(_to) \
  213. NS_IMETHOD AutoRegister(nsIFile *aSpec) { return _to AutoRegister(aSpec); } \
  214. NS_IMETHOD AutoUnregister(nsIFile *aSpec) { return _to AutoUnregister(aSpec); } \
  215. NS_IMETHOD RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory) { return _to RegisterFactory(aClass, aClassName, aContractID, aFactory); } \
  216. NS_IMETHOD UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory) { return _to UnregisterFactory(aClass, aFactory); } \
  217. NS_IMETHOD RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType) { return _to RegisterFactoryLocation(aClass, aClassName, aContractID, aFile, aLoaderStr, aType); } \
  218. NS_IMETHOD UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile) { return _to UnregisterFactoryLocation(aClass, aFile); } \
  219. NS_IMETHOD IsCIDRegistered(const nsCID & aClass, PRBool *_retval) { return _to IsCIDRegistered(aClass, _retval); } \
  220. NS_IMETHOD IsContractIDRegistered(const char *aContractID, PRBool *_retval) { return _to IsContractIDRegistered(aContractID, _retval); } \
  221. NS_IMETHOD EnumerateCIDs(nsISimpleEnumerator **_retval) { return _to EnumerateCIDs(_retval); } \
  222. NS_IMETHOD EnumerateContractIDs(nsISimpleEnumerator **_retval) { return _to EnumerateContractIDs(_retval); } \
  223. NS_IMETHOD CIDToContractID(const nsCID & aClass, char **_retval) { return _to CIDToContractID(aClass, _retval); } \
  224. NS_IMETHOD ContractIDToCID(const char *aContractID, nsCID * *_retval) { return _to ContractIDToCID(aContractID, _retval); }
  225. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  226. #define NS_FORWARD_SAFE_NSICOMPONENTREGISTRAR(_to) \
  227. NS_IMETHOD AutoRegister(nsIFile *aSpec) { return !_to ? NS_ERROR_NULL_POINTER : _to->AutoRegister(aSpec); } \
  228. NS_IMETHOD AutoUnregister(nsIFile *aSpec) { return !_to ? NS_ERROR_NULL_POINTER : _to->AutoUnregister(aSpec); } \
  229. NS_IMETHOD RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterFactory(aClass, aClassName, aContractID, aFactory); } \
  230. NS_IMETHOD UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterFactory(aClass, aFactory); } \
  231. NS_IMETHOD RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterFactoryLocation(aClass, aClassName, aContractID, aFile, aLoaderStr, aType); } \
  232. NS_IMETHOD UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterFactoryLocation(aClass, aFile); } \
  233. NS_IMETHOD IsCIDRegistered(const nsCID & aClass, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsCIDRegistered(aClass, _retval); } \
  234. NS_IMETHOD IsContractIDRegistered(const char *aContractID, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsContractIDRegistered(aContractID, _retval); } \
  235. NS_IMETHOD EnumerateCIDs(nsISimpleEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->EnumerateCIDs(_retval); } \
  236. NS_IMETHOD EnumerateContractIDs(nsISimpleEnumerator **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->EnumerateContractIDs(_retval); } \
  237. NS_IMETHOD CIDToContractID(const nsCID & aClass, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CIDToContractID(aClass, _retval); } \
  238. NS_IMETHOD ContractIDToCID(const char *aContractID, nsCID * *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ContractIDToCID(aContractID, _retval); }
  239. #if 0
  240. /* Use the code below as a template for the implementation class for this interface. */
  241. /* Header file */
  242. class nsComponentRegistrar : public nsIComponentRegistrar
  243. {
  244. public:
  245. NS_DECL_ISUPPORTS
  246. NS_DECL_NSICOMPONENTREGISTRAR
  247. nsComponentRegistrar();
  248. private:
  249. ~nsComponentRegistrar();
  250. protected:
  251. /* additional members */
  252. };
  253. /* Implementation file */
  254. NS_IMPL_ISUPPORTS1(nsComponentRegistrar, nsIComponentRegistrar)
  255. nsComponentRegistrar::nsComponentRegistrar()
  256. {
  257. /* member initializers and constructor code */
  258. }
  259. nsComponentRegistrar::~nsComponentRegistrar()
  260. {
  261. /* destructor code */
  262. }
  263. /* void autoRegister (in nsIFile aSpec); */
  264. NS_IMETHODIMP nsComponentRegistrar::AutoRegister(nsIFile *aSpec)
  265. {
  266. return NS_ERROR_NOT_IMPLEMENTED;
  267. }
  268. /* void autoUnregister (in nsIFile aSpec); */
  269. NS_IMETHODIMP nsComponentRegistrar::AutoUnregister(nsIFile *aSpec)
  270. {
  271. return NS_ERROR_NOT_IMPLEMENTED;
  272. }
  273. /* void registerFactory (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFactory aFactory); */
  274. NS_IMETHODIMP nsComponentRegistrar::RegisterFactory(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFactory *aFactory)
  275. {
  276. return NS_ERROR_NOT_IMPLEMENTED;
  277. }
  278. /* void unregisterFactory (in nsCIDRef aClass, in nsIFactory aFactory); */
  279. NS_IMETHODIMP nsComponentRegistrar::UnregisterFactory(const nsCID & aClass, nsIFactory *aFactory)
  280. {
  281. return NS_ERROR_NOT_IMPLEMENTED;
  282. }
  283. /* void registerFactoryLocation (in nsCIDRef aClass, in string aClassName, in string aContractID, in nsIFile aFile, in string aLoaderStr, in string aType); */
  284. NS_IMETHODIMP nsComponentRegistrar::RegisterFactoryLocation(const nsCID & aClass, const char *aClassName, const char *aContractID, nsIFile *aFile, const char *aLoaderStr, const char *aType)
  285. {
  286. return NS_ERROR_NOT_IMPLEMENTED;
  287. }
  288. /* void unregisterFactoryLocation (in nsCIDRef aClass, in nsIFile aFile); */
  289. NS_IMETHODIMP nsComponentRegistrar::UnregisterFactoryLocation(const nsCID & aClass, nsIFile *aFile)
  290. {
  291. return NS_ERROR_NOT_IMPLEMENTED;
  292. }
  293. /* boolean isCIDRegistered (in nsCIDRef aClass); */
  294. NS_IMETHODIMP nsComponentRegistrar::IsCIDRegistered(const nsCID & aClass, PRBool *_retval)
  295. {
  296. return NS_ERROR_NOT_IMPLEMENTED;
  297. }
  298. /* boolean isContractIDRegistered (in string aContractID); */
  299. NS_IMETHODIMP nsComponentRegistrar::IsContractIDRegistered(const char *aContractID, PRBool *_retval)
  300. {
  301. return NS_ERROR_NOT_IMPLEMENTED;
  302. }
  303. /* nsISimpleEnumerator enumerateCIDs (); */
  304. NS_IMETHODIMP nsComponentRegistrar::EnumerateCIDs(nsISimpleEnumerator **_retval)
  305. {
  306. return NS_ERROR_NOT_IMPLEMENTED;
  307. }
  308. /* nsISimpleEnumerator enumerateContractIDs (); */
  309. NS_IMETHODIMP nsComponentRegistrar::EnumerateContractIDs(nsISimpleEnumerator **_retval)
  310. {
  311. return NS_ERROR_NOT_IMPLEMENTED;
  312. }
  313. /* string CIDToContractID (in nsCIDRef aClass); */
  314. NS_IMETHODIMP nsComponentRegistrar::CIDToContractID(const nsCID & aClass, char **_retval)
  315. {
  316. return NS_ERROR_NOT_IMPLEMENTED;
  317. }
  318. /* nsCIDPtr contractIDToCID (in string aContractID); */
  319. NS_IMETHODIMP nsComponentRegistrar::ContractIDToCID(const char *aContractID, nsCID * *_retval)
  320. {
  321. return NS_ERROR_NOT_IMPLEMENTED;
  322. }
  323. /* End of implementation class template. */
  324. #endif
  325. #endif /* __gen_nsIComponentRegistrar_h__ */