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