2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-10-16 07:35:52 +04:00
|
|
|
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The nsIServiceManager manager interface provides a means to obtain
|
2019-05-23 01:37:14 +03:00
|
|
|
* global services in an application. The service manager depends on the
|
2001-10-16 07:35:52 +04:00
|
|
|
* repository to find and instantiate factories to obtain services.
|
|
|
|
*
|
|
|
|
* Users of the service manager must first obtain a pointer to the global
|
2019-05-23 01:37:14 +03:00
|
|
|
* service manager by calling NS_GetServiceManager. After that,
|
2001-10-16 07:35:52 +04:00
|
|
|
* they can request specific services by calling GetService. When they are
|
|
|
|
* finished they can NS_RELEASE() the service as usual.
|
|
|
|
*
|
|
|
|
* A user of a service may keep references to particular services indefinitely
|
|
|
|
* and only must call Release when it shuts down.
|
|
|
|
*/
|
|
|
|
|
|
|
|
[scriptable, uuid(8bb35ed9-e332-462d-9155-4a002ab5c958)]
|
|
|
|
interface nsIServiceManager : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* getServiceByContractID
|
|
|
|
*
|
|
|
|
* Returns the instance that implements aClass or aContractID and the
|
|
|
|
* interface aIID. This may result in the instance being created.
|
|
|
|
*
|
2019-05-23 01:37:14 +03:00
|
|
|
* @param aClass or aContractID : aClass or aContractID of object
|
2001-10-16 07:35:52 +04:00
|
|
|
* instance requested
|
|
|
|
* @param aIID : IID of interface requested
|
2019-05-23 01:37:14 +03:00
|
|
|
* @param result : resulting service
|
2001-10-16 07:35:52 +04:00
|
|
|
*/
|
2019-05-23 01:37:14 +03:00
|
|
|
void getService(in nsCIDRef aClass,
|
|
|
|
in nsIIDRef aIID,
|
2001-10-16 07:35:52 +04:00
|
|
|
[iid_is(aIID),retval] out nsQIResult result);
|
|
|
|
|
|
|
|
void getServiceByContractID(in string aContractID,
|
2019-05-23 01:37:14 +03:00
|
|
|
in nsIIDRef aIID,
|
2001-10-16 07:35:52 +04:00
|
|
|
[iid_is(aIID),retval] out nsQIResult result);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* isServiceInstantiated
|
|
|
|
*
|
|
|
|
* isServiceInstantiated will return a true if the service has already
|
2017-08-13 02:15:19 +03:00
|
|
|
* been created, or false otherwise. Throws if the service does not
|
|
|
|
* implement the given IID.
|
2001-10-16 07:35:52 +04:00
|
|
|
*
|
2019-05-23 01:37:14 +03:00
|
|
|
* @param aClass or aContractID : aClass or aContractID of object
|
2001-10-16 07:35:52 +04:00
|
|
|
* instance requested
|
|
|
|
* @param aIID : IID of interface requested
|
2013-07-10 22:57:34 +04:00
|
|
|
* @throws NS_NOINTERFACE if the IID given isn't supported by the object
|
2001-10-16 07:35:52 +04:00
|
|
|
*/
|
|
|
|
boolean isServiceInstantiated(in nsCIDRef aClass, in nsIIDRef aIID);
|
|
|
|
boolean isServiceInstantiatedByContractID(in string aContractID, in nsIIDRef aIID);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
%{C++
|
2002-09-24 01:46:25 +04:00
|
|
|
// Observing xpcom autoregistration. Topics will be 'start' and 'stop'.
|
2001-10-16 07:35:52 +04:00
|
|
|
#define NS_XPCOM_AUTOREGISTRATION_OBSERVER_ID "xpcom-autoregistration"
|
|
|
|
|
2005-04-06 07:35:24 +04:00
|
|
|
#ifdef MOZILLA_INTERNAL_API
|
2001-10-16 07:35:52 +04:00
|
|
|
#include "nsXPCOM.h"
|
2010-06-10 22:11:11 +04:00
|
|
|
#include "nsComponentManagerUtils.h"
|
2004-11-25 01:48:45 +03:00
|
|
|
#include "nsServiceManagerUtils.h"
|
2001-10-16 07:35:52 +04:00
|
|
|
#endif
|
|
|
|
%}
|
|
|
|
|