nsIComponentRegistrar.idl 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. /**
  5. * The nsIComponentRegistrar interface.
  6. */
  7. #include "nsISupports.idl"
  8. interface nsIFile;
  9. interface nsIFactory;
  10. interface nsISimpleEnumerator;
  11. [scriptable, uuid(2417cbfe-65ad-48a6-b4b6-eb84db174392)]
  12. interface nsIComponentRegistrar : nsISupports
  13. {
  14. /**
  15. * autoRegister
  16. *
  17. * Register a .manifest file, or an entire directory containing
  18. * these files. Registration lasts for this run only, and is not cached.
  19. *
  20. * @note Formerly this method would register component files directly. This
  21. * is no longer supported.
  22. */
  23. void autoRegister(in nsIFile aSpec);
  24. /**
  25. * autoUnregister
  26. * @status OBSOLETE: This method is no longer implemented, but preserved
  27. * in this interface for binary compatibility with
  28. * Mozilla 1.9.2.
  29. */
  30. void autoUnregister(in nsIFile aSpec);
  31. /**
  32. * registerFactory
  33. *
  34. * Register a factory with a given ContractID, CID and Class Name.
  35. *
  36. * @param aClass : CID of object
  37. * @param aClassName : Class Name of CID (unused)
  38. * @param aContractID : ContractID associated with CID aClass. May be null
  39. * if no contract ID is needed.
  40. * @param aFactory : Factory that will be registered for CID aClass.
  41. * If aFactory is null, the contract will be associated
  42. * with a previously registered CID.
  43. */
  44. void registerFactory(in nsCIDRef aClass,
  45. in string aClassName,
  46. in string aContractID,
  47. in nsIFactory aFactory);
  48. /**
  49. * unregisterFactory
  50. *
  51. * Unregister a factory associated with CID aClass.
  52. *
  53. * @param aClass : CID being unregistered
  54. * @param aFactory : Factory previously registered to create instances of
  55. * CID aClass.
  56. *
  57. * @throws NS_ERROR* Method failure.
  58. */
  59. void unregisterFactory(in nsCIDRef aClass,
  60. in nsIFactory aFactory);
  61. /**
  62. * registerFactoryLocation
  63. * @status OBSOLETE: This method is no longer implemented, but preserved
  64. * in this interface for binary compatibility with
  65. * Mozilla 1.9.2.
  66. */
  67. void registerFactoryLocation(in nsCIDRef aClass,
  68. in string aClassName,
  69. in string aContractID,
  70. in nsIFile aFile,
  71. in string aLoaderStr,
  72. in string aType);
  73. /**
  74. * unregisterFactoryLocation
  75. * @status OBSOLETE: This method is no longer implemented, but preserved
  76. * in this interface for binary compatibility with
  77. * Mozilla 1.9.2.
  78. */
  79. void unregisterFactoryLocation(in nsCIDRef aClass,
  80. in nsIFile aFile);
  81. /**
  82. * isCIDRegistered
  83. *
  84. * Returns true if a factory is registered for the CID.
  85. *
  86. * @param aClass : CID queried for registeration
  87. * @return : true if a factory is registered for CID
  88. * false otherwise.
  89. */
  90. boolean isCIDRegistered(in nsCIDRef aClass);
  91. /**
  92. * isContractIDRegistered
  93. *
  94. * Returns true if a factory is registered for the contract id.
  95. *
  96. * @param aClass : contract id queried for registeration
  97. * @return : true if a factory is registered for contract id
  98. * false otherwise.
  99. */
  100. boolean isContractIDRegistered(in string aContractID);
  101. /**
  102. * enumerateCIDs
  103. *
  104. * Enumerate the list of all registered CIDs.
  105. *
  106. * @return : enumerator for CIDs. Elements of the enumeration can be QI'ed
  107. * for the nsISupportsID interface. From the nsISupportsID, you
  108. * can obtain the actual CID.
  109. */
  110. nsISimpleEnumerator enumerateCIDs();
  111. /**
  112. * enumerateContractIDs
  113. *
  114. * Enumerate the list of all registered ContractIDs.
  115. *
  116. * @return : enumerator for ContractIDs. Elements of the enumeration can be
  117. * QI'ed for the nsISupportsCString interface. From the
  118. * nsISupportsCString interface, you can obtain the actual
  119. * Contract ID string.
  120. */
  121. nsISimpleEnumerator enumerateContractIDs();
  122. /**
  123. * CIDToContractID
  124. * @status OBSOLETE: This method is no longer implemented, but preserved
  125. * in this interface for binary compatibility with
  126. * Mozilla 1.9.2.
  127. */
  128. string CIDToContractID(in nsCIDRef aClass);
  129. /**
  130. * contractIDToCID
  131. *
  132. * Returns the CID for a given Contract ID, if one exists and is registered.
  133. *
  134. * @return : Contract ID.
  135. */
  136. nsCIDPtr contractIDToCID(in string aContractID);
  137. };