nsIModule.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/xpcom/components/nsIModule.idl
  3. */
  4. #ifndef __gen_nsIModule_h__
  5. #define __gen_nsIModule_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 nsIComponentManager; /* forward declaration */
  15. /* starting interface: nsIModule */
  16. #define NS_IMODULE_IID_STR "7392d032-5371-11d3-994e-00805fd26fee"
  17. #define NS_IMODULE_IID \
  18. {0x7392d032, 0x5371, 0x11d3, \
  19. { 0x99, 0x4e, 0x00, 0x80, 0x5f, 0xd2, 0x6f, 0xee }}
  20. /**
  21. * The nsIModule interface.
  22. * @status FROZEN
  23. */
  24. class NS_NO_VTABLE nsIModule : public nsISupports {
  25. public:
  26. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IMODULE_IID)
  27. /**
  28. * Object Instance Creation
  29. *
  30. * Obtains a Class Object from a nsIModule for a given CID and IID pair.
  31. * This class object can either be query to a nsIFactory or a may be
  32. * query to a nsIClassInfo.
  33. *
  34. * @param aCompMgr : The global component manager
  35. * @param aClass : ClassID of object instance requested
  36. * @param aIID : IID of interface requested
  37. *
  38. */
  39. /* void getClassObject (in nsIComponentManager aCompMgr, in nsCIDRef aClass, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult aResult); */
  40. NS_IMETHOD GetClassObject(nsIComponentManager *aCompMgr, const nsCID & aClass, const nsIID & aIID, void * *aResult) = 0;
  41. /**
  42. * One time registration callback
  43. *
  44. * When the nsIModule is discovered, this method will be
  45. * called so that any setup registration can be preformed.
  46. *
  47. * @param aCompMgr : The global component manager
  48. * @param aLocation : The location of the nsIModule on disk
  49. * @param aLoaderStr: Opaque loader specific string
  50. * @param aType : Loader Type being used to load this module
  51. */
  52. /* void registerSelf (in nsIComponentManager aCompMgr, in nsIFile aLocation, in string aLoaderStr, in string aType); */
  53. NS_IMETHOD RegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aLocation, const char *aLoaderStr, const char *aType) = 0;
  54. /**
  55. * One time unregistration callback
  56. *
  57. * When the nsIModule is being unregistered, this method will be
  58. * called so that any unregistration can be preformed
  59. *
  60. * @param aCompMgr : The global component manager
  61. * @param aLocation : The location of the nsIModule on disk
  62. * @param aLoaderStr : Opaque loader specific string
  63. *
  64. */
  65. /* void unregisterSelf (in nsIComponentManager aCompMgr, in nsIFile aLocation, in string aLoaderStr); */
  66. NS_IMETHOD UnregisterSelf(nsIComponentManager *aCompMgr, nsIFile *aLocation, const char *aLoaderStr) = 0;
  67. /**
  68. * Module load management
  69. *
  70. * @param aCompMgr : The global component manager
  71. *
  72. * @return indicates to the caller if the module can be unloaded.
  73. * Returning PR_TRUE isn't a guarantee that the module will be
  74. * unloaded. It constitues only willingness of the module to be
  75. * unloaded. It is very important to ensure that no outstanding
  76. * references to the module's code/data exist before returning
  77. * PR_TRUE.
  78. * Returning PR_FALSE guaratees that the module wont be unloaded.
  79. */
  80. /* boolean canUnload (in nsIComponentManager aCompMgr); */
  81. NS_IMETHOD CanUnload(nsIComponentManager *aCompMgr, PRBool *_retval) = 0;
  82. };
  83. /* Use this macro when declaring classes that implement this interface. */
  84. #define NS_DECL_NSIMODULE \
  85. NS_IMETHOD GetClassObject(nsIComponentManager *aCompMgr, const nsCID & aClass, const nsIID & aIID, void * *aResult); \
  86. NS_IMETHOD RegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aLocation, const char *aLoaderStr, const char *aType); \
  87. NS_IMETHOD UnregisterSelf(nsIComponentManager *aCompMgr, nsIFile *aLocation, const char *aLoaderStr); \
  88. NS_IMETHOD CanUnload(nsIComponentManager *aCompMgr, PRBool *_retval);
  89. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  90. #define NS_FORWARD_NSIMODULE(_to) \
  91. NS_IMETHOD GetClassObject(nsIComponentManager *aCompMgr, const nsCID & aClass, const nsIID & aIID, void * *aResult) { return _to GetClassObject(aCompMgr, aClass, aIID, aResult); } \
  92. NS_IMETHOD RegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aLocation, const char *aLoaderStr, const char *aType) { return _to RegisterSelf(aCompMgr, aLocation, aLoaderStr, aType); } \
  93. NS_IMETHOD UnregisterSelf(nsIComponentManager *aCompMgr, nsIFile *aLocation, const char *aLoaderStr) { return _to UnregisterSelf(aCompMgr, aLocation, aLoaderStr); } \
  94. NS_IMETHOD CanUnload(nsIComponentManager *aCompMgr, PRBool *_retval) { return _to CanUnload(aCompMgr, _retval); }
  95. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  96. #define NS_FORWARD_SAFE_NSIMODULE(_to) \
  97. NS_IMETHOD GetClassObject(nsIComponentManager *aCompMgr, const nsCID & aClass, const nsIID & aIID, void * *aResult) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetClassObject(aCompMgr, aClass, aIID, aResult); } \
  98. NS_IMETHOD RegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aLocation, const char *aLoaderStr, const char *aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterSelf(aCompMgr, aLocation, aLoaderStr, aType); } \
  99. NS_IMETHOD UnregisterSelf(nsIComponentManager *aCompMgr, nsIFile *aLocation, const char *aLoaderStr) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterSelf(aCompMgr, aLocation, aLoaderStr); } \
  100. NS_IMETHOD CanUnload(nsIComponentManager *aCompMgr, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CanUnload(aCompMgr, _retval); }
  101. #if 0
  102. /* Use the code below as a template for the implementation class for this interface. */
  103. /* Header file */
  104. class nsModule : public nsIModule
  105. {
  106. public:
  107. NS_DECL_ISUPPORTS
  108. NS_DECL_NSIMODULE
  109. nsModule();
  110. private:
  111. ~nsModule();
  112. protected:
  113. /* additional members */
  114. };
  115. /* Implementation file */
  116. NS_IMPL_ISUPPORTS1(nsModule, nsIModule)
  117. nsModule::nsModule()
  118. {
  119. /* member initializers and constructor code */
  120. }
  121. nsModule::~nsModule()
  122. {
  123. /* destructor code */
  124. }
  125. /* void getClassObject (in nsIComponentManager aCompMgr, in nsCIDRef aClass, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult aResult); */
  126. NS_IMETHODIMP nsModule::GetClassObject(nsIComponentManager *aCompMgr, const nsCID & aClass, const nsIID & aIID, void * *aResult)
  127. {
  128. return NS_ERROR_NOT_IMPLEMENTED;
  129. }
  130. /* void registerSelf (in nsIComponentManager aCompMgr, in nsIFile aLocation, in string aLoaderStr, in string aType); */
  131. NS_IMETHODIMP nsModule::RegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aLocation, const char *aLoaderStr, const char *aType)
  132. {
  133. return NS_ERROR_NOT_IMPLEMENTED;
  134. }
  135. /* void unregisterSelf (in nsIComponentManager aCompMgr, in nsIFile aLocation, in string aLoaderStr); */
  136. NS_IMETHODIMP nsModule::UnregisterSelf(nsIComponentManager *aCompMgr, nsIFile *aLocation, const char *aLoaderStr)
  137. {
  138. return NS_ERROR_NOT_IMPLEMENTED;
  139. }
  140. /* boolean canUnload (in nsIComponentManager aCompMgr); */
  141. NS_IMETHODIMP nsModule::CanUnload(nsIComponentManager *aCompMgr, PRBool *_retval)
  142. {
  143. return NS_ERROR_NOT_IMPLEMENTED;
  144. }
  145. /* End of implementation class template. */
  146. #endif
  147. #endif /* __gen_nsIModule_h__ */