Added progID versions of methods to nsServiceManager (the static interface).

git-svn-id: svn://10.0.0.236/trunk@26018 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
warren%netscape.com 1999-04-02 05:17:42 +00:00
parent 42b34343f8
commit bc140cf411
4 changed files with 146 additions and 18 deletions

View File

@ -158,19 +158,41 @@ public:
class NS_COM nsServiceManager {
public:
static nsresult RegisterService(const nsCID& aClass, nsISupports* aService);
static nsresult
RegisterService(const nsCID& aClass, nsISupports* aService);
static nsresult UnregisterService(const nsCID& aClass);
static nsresult
UnregisterService(const nsCID& aClass);
static nsresult GetService(const nsCID& aClass, const nsIID& aIID,
nsISupports* *result,
nsIShutdownListener* shutdownListener = NULL);
static nsresult
GetService(const nsCID& aClass, const nsIID& aIID,
nsISupports* *result,
nsIShutdownListener* shutdownListener = NULL);
static nsresult ReleaseService(const nsCID& aClass, nsISupports* service,
nsIShutdownListener* shutdownListener = NULL);
static nsresult
ReleaseService(const nsCID& aClass, nsISupports* service,
nsIShutdownListener* shutdownListener = NULL);
////////////////////////////////////////////////////////////////////////////
// let's do it again, this time with ProgIDs...
static nsresult
RegisterService(const char* aProgID, nsISupports* aService);
static nsresult
UnregisterService(const char* aProgID);
static nsresult
GetService(const char* aProgID, const nsIID& aIID,
nsISupports* *result,
nsIShutdownListener* shutdownListener = NULL);
static nsresult
ReleaseService(const char* aProgID, nsISupports* service,
nsIShutdownListener* shutdownListener = NULL);
////////////////////////////////////////////////////////////////////////////
// Since the global Service Manager is truly global, there's no need to
// release it.
static nsresult GetGlobalServiceManager(nsIServiceManager* *result);
// This method can be called when shutting down the application. It

View File

@ -473,6 +473,48 @@ nsServiceManager::UnregisterService(const nsCID& aClass)
return mgr->UnregisterService(aClass);
}
////////////////////////////////////////////////////////////////////////////////
// let's do it again, this time with ProgIDs...
nsresult
nsServiceManager::GetService(const char* aProgID, const nsIID& aIID,
nsISupports* *result,
nsIShutdownListener* shutdownListener)
{
nsIServiceManager* mgr;
nsresult rv = GetGlobalServiceManager(&mgr);
if (NS_FAILED(rv)) return rv;
return mgr->GetService(aProgID, aIID, result, shutdownListener);
}
nsresult
nsServiceManager::ReleaseService(const char* aProgID, nsISupports* service,
nsIShutdownListener* shutdownListener)
{
nsIServiceManager* mgr;
nsresult rv = GetGlobalServiceManager(&mgr);
if (NS_FAILED(rv)) return rv;
return mgr->ReleaseService(aProgID, service, shutdownListener);
}
nsresult
nsServiceManager::RegisterService(const char* aProgID, nsISupports* aService)
{
nsIServiceManager* mgr;
nsresult rv = GetGlobalServiceManager(&mgr);
if (NS_FAILED(rv)) return rv;
return mgr->RegisterService(aProgID, aService);
}
nsresult
nsServiceManager::UnregisterService(const char* aProgID)
{
nsIServiceManager* mgr;
nsresult rv = GetGlobalServiceManager(&mgr);
if (NS_FAILED(rv)) return rv;
return mgr->UnregisterService(aProgID);
}
////////////////////////////////////////////////////////////////////////////////
// XPCOM initialization

View File

@ -158,19 +158,41 @@ public:
class NS_COM nsServiceManager {
public:
static nsresult RegisterService(const nsCID& aClass, nsISupports* aService);
static nsresult
RegisterService(const nsCID& aClass, nsISupports* aService);
static nsresult UnregisterService(const nsCID& aClass);
static nsresult
UnregisterService(const nsCID& aClass);
static nsresult GetService(const nsCID& aClass, const nsIID& aIID,
nsISupports* *result,
nsIShutdownListener* shutdownListener = NULL);
static nsresult
GetService(const nsCID& aClass, const nsIID& aIID,
nsISupports* *result,
nsIShutdownListener* shutdownListener = NULL);
static nsresult ReleaseService(const nsCID& aClass, nsISupports* service,
nsIShutdownListener* shutdownListener = NULL);
static nsresult
ReleaseService(const nsCID& aClass, nsISupports* service,
nsIShutdownListener* shutdownListener = NULL);
////////////////////////////////////////////////////////////////////////////
// let's do it again, this time with ProgIDs...
static nsresult
RegisterService(const char* aProgID, nsISupports* aService);
static nsresult
UnregisterService(const char* aProgID);
static nsresult
GetService(const char* aProgID, const nsIID& aIID,
nsISupports* *result,
nsIShutdownListener* shutdownListener = NULL);
static nsresult
ReleaseService(const char* aProgID, nsISupports* service,
nsIShutdownListener* shutdownListener = NULL);
////////////////////////////////////////////////////////////////////////////
// Since the global Service Manager is truly global, there's no need to
// release it.
static nsresult GetGlobalServiceManager(nsIServiceManager* *result);
// This method can be called when shutting down the application. It

View File

@ -473,6 +473,48 @@ nsServiceManager::UnregisterService(const nsCID& aClass)
return mgr->UnregisterService(aClass);
}
////////////////////////////////////////////////////////////////////////////////
// let's do it again, this time with ProgIDs...
nsresult
nsServiceManager::GetService(const char* aProgID, const nsIID& aIID,
nsISupports* *result,
nsIShutdownListener* shutdownListener)
{
nsIServiceManager* mgr;
nsresult rv = GetGlobalServiceManager(&mgr);
if (NS_FAILED(rv)) return rv;
return mgr->GetService(aProgID, aIID, result, shutdownListener);
}
nsresult
nsServiceManager::ReleaseService(const char* aProgID, nsISupports* service,
nsIShutdownListener* shutdownListener)
{
nsIServiceManager* mgr;
nsresult rv = GetGlobalServiceManager(&mgr);
if (NS_FAILED(rv)) return rv;
return mgr->ReleaseService(aProgID, service, shutdownListener);
}
nsresult
nsServiceManager::RegisterService(const char* aProgID, nsISupports* aService)
{
nsIServiceManager* mgr;
nsresult rv = GetGlobalServiceManager(&mgr);
if (NS_FAILED(rv)) return rv;
return mgr->RegisterService(aProgID, aService);
}
nsresult
nsServiceManager::UnregisterService(const char* aProgID)
{
nsIServiceManager* mgr;
nsresult rv = GetGlobalServiceManager(&mgr);
if (NS_FAILED(rv)) return rv;
return mgr->UnregisterService(aProgID);
}
////////////////////////////////////////////////////////////////////////////////
// XPCOM initialization