PageRenderTime 123ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/gecko_api/include/nsIServiceManager.h

http://firefox-mac-pdf.googlecode.com/
C Header | 180 lines | 81 code | 32 blank | 67 comment | 0 complexity | a4331aca162f58f1ef3a4c9ec04dfc0a MD5 | raw file
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/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 NS_SCRIPTABLE nsIServiceManager : public nsISupports {
  34. public:
  35. NS_DECLARE_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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE NS_IMETHOD IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, PRBool *_retval) = 0;
  64. /* boolean isServiceInstantiatedByContractID (in string aContractID, in nsIIDRef aIID); */
  65. NS_SCRIPTABLE NS_IMETHOD IsServiceInstantiatedByContractID(const char *aContractID, const nsIID & aIID, PRBool *_retval) = 0;
  66. };
  67. NS_DEFINE_STATIC_IID_ACCESSOR(nsIServiceManager, NS_ISERVICEMANAGER_IID)
  68. /* Use this macro when declaring classes that implement this interface. */
  69. #define NS_DECL_NSISERVICEMANAGER \
  70. NS_SCRIPTABLE NS_IMETHOD GetService(const nsCID & aClass, const nsIID & aIID, void * *result); \
  71. NS_SCRIPTABLE NS_IMETHOD GetServiceByContractID(const char *aContractID, const nsIID & aIID, void * *result); \
  72. NS_SCRIPTABLE NS_IMETHOD IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, PRBool *_retval); \
  73. NS_SCRIPTABLE NS_IMETHOD IsServiceInstantiatedByContractID(const char *aContractID, const nsIID & aIID, PRBool *_retval);
  74. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  75. #define NS_FORWARD_NSISERVICEMANAGER(_to) \
  76. NS_SCRIPTABLE NS_IMETHOD GetService(const nsCID & aClass, const nsIID & aIID, void * *result) { return _to GetService(aClass, aIID, result); } \
  77. NS_SCRIPTABLE NS_IMETHOD GetServiceByContractID(const char *aContractID, const nsIID & aIID, void * *result) { return _to GetServiceByContractID(aContractID, aIID, result); } \
  78. NS_SCRIPTABLE NS_IMETHOD IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, PRBool *_retval) { return _to IsServiceInstantiated(aClass, aIID, _retval); } \
  79. NS_SCRIPTABLE NS_IMETHOD IsServiceInstantiatedByContractID(const char *aContractID, const nsIID & aIID, PRBool *_retval) { return _to IsServiceInstantiatedByContractID(aContractID, aIID, _retval); }
  80. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  81. #define NS_FORWARD_SAFE_NSISERVICEMANAGER(_to) \
  82. NS_SCRIPTABLE NS_IMETHOD GetService(const nsCID & aClass, const nsIID & aIID, void * *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetService(aClass, aIID, result); } \
  83. NS_SCRIPTABLE NS_IMETHOD GetServiceByContractID(const char *aContractID, const nsIID & aIID, void * *result) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetServiceByContractID(aContractID, aIID, result); } \
  84. NS_SCRIPTABLE NS_IMETHOD IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsServiceInstantiated(aClass, aIID, _retval); } \
  85. NS_SCRIPTABLE NS_IMETHOD IsServiceInstantiatedByContractID(const char *aContractID, const nsIID & aIID, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsServiceInstantiatedByContractID(aContractID, aIID, _retval); }
  86. #if 0
  87. /* Use the code below as a template for the implementation class for this interface. */
  88. /* Header file */
  89. class nsServiceManager : public nsIServiceManager
  90. {
  91. public:
  92. NS_DECL_ISUPPORTS
  93. NS_DECL_NSISERVICEMANAGER
  94. nsServiceManager();
  95. private:
  96. ~nsServiceManager();
  97. protected:
  98. /* additional members */
  99. };
  100. /* Implementation file */
  101. NS_IMPL_ISUPPORTS1(nsServiceManager, nsIServiceManager)
  102. nsServiceManager::nsServiceManager()
  103. {
  104. /* member initializers and constructor code */
  105. }
  106. nsServiceManager::~nsServiceManager()
  107. {
  108. /* destructor code */
  109. }
  110. /* void getService (in nsCIDRef aClass, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result); */
  111. NS_IMETHODIMP nsServiceManager::GetService(const nsCID & aClass, const nsIID & aIID, void * *result)
  112. {
  113. return NS_ERROR_NOT_IMPLEMENTED;
  114. }
  115. /* void getServiceByContractID (in string aContractID, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result); */
  116. NS_IMETHODIMP nsServiceManager::GetServiceByContractID(const char *aContractID, const nsIID & aIID, void * *result)
  117. {
  118. return NS_ERROR_NOT_IMPLEMENTED;
  119. }
  120. /* boolean isServiceInstantiated (in nsCIDRef aClass, in nsIIDRef aIID); */
  121. NS_IMETHODIMP nsServiceManager::IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, PRBool *_retval)
  122. {
  123. return NS_ERROR_NOT_IMPLEMENTED;
  124. }
  125. /* boolean isServiceInstantiatedByContractID (in string aContractID, in nsIIDRef aIID); */
  126. NS_IMETHODIMP nsServiceManager::IsServiceInstantiatedByContractID(const char *aContractID, const nsIID & aIID, PRBool *_retval)
  127. {
  128. return NS_ERROR_NOT_IMPLEMENTED;
  129. }
  130. /* End of implementation class template. */
  131. #endif
  132. #define NS_ERROR_SERVICE_NOT_AVAILABLE NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_XPCOM, 22)
  133. /**
  134. * @status DEPRECATED
  135. */
  136. #define NS_ERROR_SERVICE_NOT_FOUND NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_XPCOM, 22)
  137. /**
  138. * @status DEPRECATED
  139. */
  140. #define NS_ERROR_SERVICE_IN_USE NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_XPCOM, 23)
  141. // Observing xpcom autoregistration. Topics will be 'start' and 'stop'.
  142. #define NS_XPCOM_AUTOREGISTRATION_OBSERVER_ID "xpcom-autoregistration"
  143. #ifdef MOZILLA_INTERNAL_API
  144. #include "nsXPCOM.h"
  145. #include "nsServiceManagerUtils.h"
  146. #include "nsIServiceManagerObsolete.h"
  147. #endif
  148. #endif /* __gen_nsIServiceManager_h__ */