nsIServiceManager.h 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/xpcom/components/nsIServiceManager.idl
  3. */
  4. #ifndef __gen_nsIServiceManager_h__
  5. #define __gen_nsIServiceManager_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. /* starting interface: nsIServiceManager */
  14. #define NS_ISERVICEMANAGER_IID_STR "8bb35ed9-e332-462d-9155-4a002ab5c958"
  15. #define NS_ISERVICEMANAGER_IID \
  16. {0x8bb35ed9, 0xe332, 0x462d, \
  17. { 0x91, 0x55, 0x4a, 0x00, 0x2a, 0xb5, 0xc9, 0x58 }}
  18. /**
  19. * The nsIServiceManager manager interface provides a means to obtain
  20. * global services in an application. The service manager depends on the
  21. * repository to find and instantiate factories to obtain services.
  22. *
  23. * Users of the service manager must first obtain a pointer to the global
  24. * service manager by calling NS_GetServiceManager. After that,
  25. * they can request specific services by calling GetService. When they are
  26. * finished they can NS_RELEASE() the service as usual.
  27. *
  28. * A user of a service may keep references to particular services indefinitely
  29. * and only must call Release when it shuts down.
  30. *
  31. * @status FROZEN
  32. */
  33. class NS_NO_VTABLE nsIServiceManager : public nsISupports {
  34. public:
  35. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISERVICEMANAGER_IID)
  36. /**
  37. * getServiceByContractID
  38. *
  39. * Returns the instance that implements aClass or aContractID and the
  40. * interface aIID. This may result in the instance being created.
  41. *
  42. * @param aClass or aContractID : aClass or aContractID of object
  43. * instance requested
  44. * @param aIID : IID of interface requested
  45. * @param result : resulting service
  46. */
  47. /* void getService (in nsCIDRef aClass, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result); */
  48. NS_IMETHOD GetService(const nsCID & aClass, const nsIID & aIID, void * *result) = 0;
  49. /* void getServiceByContractID (in string aContractID, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result); */
  50. NS_IMETHOD GetServiceByContractID(const char *aContractID, const nsIID & aIID, void * *result) = 0;
  51. /**
  52. * isServiceInstantiated
  53. *
  54. * isServiceInstantiated will return a true if the service has already
  55. * been created, otherwise false
  56. *
  57. * @param aClass or aContractID : aClass or aContractID of object
  58. * instance requested
  59. * @param aIID : IID of interface requested
  60. * @param aIID : IID of interface requested
  61. */
  62. /* boolean isServiceInstantiated (in nsCIDRef aClass, in nsIIDRef aIID); */
  63. NS_IMETHOD IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, PRBool *_retval) = 0;
  64. /* boolean isServiceInstantiatedByContractID (in string aContractID, in nsIIDRef aIID); */
  65. NS_IMETHOD IsServiceInstantiatedByContractID(const char *aContractID, const nsIID & aIID, PRBool *_retval) = 0;
  66. };
  67. /* Use this macro when declaring classes that implement this interface. */
  68. #define NS_DECL_NSISERVICEMANAGER \
  69. NS_IMETHOD GetService(const nsCID & aClass, const nsIID & aIID, void * *result); \
  70. NS_IMETHOD GetServiceByContractID(const char *aContractID, const nsIID & aIID, void * *result); \
  71. NS_IMETHOD IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, PRBool *_retval); \
  72. NS_IMETHOD IsServiceInstantiatedByContractID(const char *aContractID, const nsIID & aIID, PRBool *_retval);
  73. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  74. #define NS_FORWARD_NSISERVICEMANAGER(_to) \
  75. NS_IMETHOD GetService(const nsCID & aClass, const nsIID & aIID, void * *result) { return _to GetService(aClass, aIID, result); } \
  76. NS_IMETHOD GetServiceByContractID(const char *aContractID, const nsIID & aIID, void * *result) { return _to GetServiceByContractID(aContractID, aIID, result); } \
  77. NS_IMETHOD IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, PRBool *_retval) { return _to IsServiceInstantiated(aClass, aIID, _retval); } \
  78. NS_IMETHOD IsServiceInstantiatedByContractID(const char *aContractID, const nsIID & aIID, PRBool *_retval) { return _to IsServiceInstantiatedByContractID(aContractID, aIID, _retval); }
  79. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  80. #define NS_FORWARD_SAFE_NSISERVICEMANAGER(_to) \
  81. NS_IMETHOD GetService(const nsCID & aClass, const nsIID & aIID, void * *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetService(aClass, aIID, result); } \
  82. NS_IMETHOD GetServiceByContractID(const char *aContractID, const nsIID & aIID, void * *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetServiceByContractID(aContractID, aIID, result); } \
  83. NS_IMETHOD IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsServiceInstantiated(aClass, aIID, _retval); } \
  84. NS_IMETHOD IsServiceInstantiatedByContractID(const char *aContractID, const nsIID & aIID, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsServiceInstantiatedByContractID(aContractID, aIID, _retval); }
  85. #if 0
  86. /* Use the code below as a template for the implementation class for this interface. */
  87. /* Header file */
  88. class nsServiceManager : public nsIServiceManager
  89. {
  90. public:
  91. NS_DECL_ISUPPORTS
  92. NS_DECL_NSISERVICEMANAGER
  93. nsServiceManager();
  94. private:
  95. ~nsServiceManager();
  96. protected:
  97. /* additional members */
  98. };
  99. /* Implementation file */
  100. NS_IMPL_ISUPPORTS1(nsServiceManager, nsIServiceManager)
  101. nsServiceManager::nsServiceManager()
  102. {
  103. /* member initializers and constructor code */
  104. }
  105. nsServiceManager::~nsServiceManager()
  106. {
  107. /* destructor code */
  108. }
  109. /* void getService (in nsCIDRef aClass, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result); */
  110. NS_IMETHODIMP nsServiceManager::GetService(const nsCID & aClass, const nsIID & aIID, void * *result)
  111. {
  112. return NS_ERROR_NOT_IMPLEMENTED;
  113. }
  114. /* void getServiceByContractID (in string aContractID, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result); */
  115. NS_IMETHODIMP nsServiceManager::GetServiceByContractID(const char *aContractID, const nsIID & aIID, void * *result)
  116. {
  117. return NS_ERROR_NOT_IMPLEMENTED;
  118. }
  119. /* boolean isServiceInstantiated (in nsCIDRef aClass, in nsIIDRef aIID); */
  120. NS_IMETHODIMP nsServiceManager::IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, PRBool *_retval)
  121. {
  122. return NS_ERROR_NOT_IMPLEMENTED;
  123. }
  124. /* boolean isServiceInstantiatedByContractID (in string aContractID, in nsIIDRef aIID); */
  125. NS_IMETHODIMP nsServiceManager::IsServiceInstantiatedByContractID(const char *aContractID, const nsIID & aIID, PRBool *_retval)
  126. {
  127. return NS_ERROR_NOT_IMPLEMENTED;
  128. }
  129. /* End of implementation class template. */
  130. #endif
  131. #define NS_ERROR_SERVICE_NOT_AVAILABLE NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_XPCOM, 22)
  132. /**
  133. * @status DEPRECATED
  134. */
  135. #define NS_ERROR_SERVICE_NOT_FOUND NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_XPCOM, 22)
  136. /**
  137. * @status DEPRECATED
  138. */
  139. #define NS_ERROR_SERVICE_IN_USE NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_XPCOM, 23)
  140. // Observing xpcom autoregistration. Topics will be 'start' and 'stop'.
  141. #define NS_XPCOM_AUTOREGISTRATION_OBSERVER_ID "xpcom-autoregistration"
  142. #ifdef MOZILLA_INTERNAL_API
  143. #include "nsXPCOM.h"
  144. #include "nsServiceManagerUtils.h"
  145. #include "nsIServiceManagerObsolete.h"
  146. #endif
  147. #endif /* __gen_nsIServiceManager_h__ */