add the service provider datasource to the base factory

r=sspitzer
This commit is contained in:
alecf%netscape.com 2000-02-05 01:17:03 +00:00
parent c1086d954b
commit 9c7d859963
2 changed files with 29 additions and 3 deletions

View File

@ -286,3 +286,14 @@
{ 0x60d34fb4, 0xd031, 0x11d3, \
{ 0x8b, 0x2e, 0x0, 0x60, 0xb0, 0xfc, 0x4, 0xd2}}
#endif // nsMessageBaseCID_h__
//
// nsMsgServiceProviderService
//
#define NS_MSGSERVICEPROVIDERSERVICE_PROGID \
NS_RDF_DATASOURCE_PROGID_PREFIX "ispdefaults"
/* 10998cef-d7f2-4772-b7db-bd097454984c */
#define NS_MSGSERVICEPROVIDERSERVICE_CID \
{ 0x10998cef, 0xd7f2, 0x4772, \
{ 0xb7, 0xdb, 0xbd, 0x09, 0x74, 0x54, 0x98, 0x4c}}

View File

@ -72,6 +72,8 @@
#include "nsMsgWindow.h"
#include "nsMsgViewNavigationService.h"
#include "nsMsgServiceProvider.h"
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
static NS_DEFINE_CID(kCMsgMailSessionCID, NS_MSGMAILSESSION_CID);
@ -127,6 +129,9 @@ static NS_DEFINE_CID(kMsgWindowCID, NS_MSGWINDOW_CID);
//MsgViewNavigationService
static NS_DEFINE_CID(kMsgViewNavigationServiceCID, NS_MSGVIEWNAVIGATIONSERVICE_CID);
//MsgServiceProviderService
static NS_DEFINE_CID(kMsgServiceProviderServiceCID, NS_MSGSERVICEPROVIDERSERVICE_CID);
// private factory declarations for each component we know how to produce
NS_GENERIC_FACTORY_CONSTRUCTOR(nsMessengerBootstrap)
@ -150,7 +155,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMsgStatusFeedback)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMessageView,Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMsgWindow,Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMsgViewNavigationService,Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMsgServiceProviderService, Init);
// Module implementation for the sample library
class nsMsgBaseModule : public nsIModule
{
@ -190,6 +195,7 @@ protected:
nsCOMPtr<nsIGenericFactory> mMessageViewFactory;
nsCOMPtr<nsIGenericFactory> mMsgWindowFactory;
nsCOMPtr<nsIGenericFactory> mMsgViewNavigationServiceFactory;
nsCOMPtr<nsIGenericFactory> mMsgServiceProviderServiceFactory;
};
nsMsgBaseModule::nsMsgBaseModule()
@ -240,6 +246,7 @@ void nsMsgBaseModule::Shutdown()
mMessageViewFactory = null_nsCOMPtr();
mMsgWindowFactory = null_nsCOMPtr();
mMsgViewNavigationServiceFactory = null_nsCOMPtr();
mMsgServiceProviderServiceFactory = null_nsCOMPtr();
}
// Create a factory object for creating instances of aClass.
@ -394,7 +401,13 @@ NS_IMETHODIMP nsMsgBaseModule::GetClassObject(nsIComponentManager *aCompMgr,
rv = NS_NewGenericFactory(getter_AddRefs(mMsgViewNavigationServiceFactory), &nsMsgViewNavigationServiceConstructor);
fact = mMsgViewNavigationServiceFactory;
}
else if (aClass.Equals(kMsgServiceProviderServiceCID))
{
if (!mMsgServiceProviderServiceFactory)
rv = NS_NewGenericFactory(getter_AddRefs(mMsgServiceProviderServiceFactory), &nsMsgServiceProviderServiceConstructor);
fact = mMsgServiceProviderServiceFactory;
}
if (fact)
rv = fact->QueryInterface(aIID, r_classObj);
@ -451,7 +464,9 @@ static Components gComponents[] = {
{ "Mail/News MsgWindow", &kMsgWindowCID,
NS_MSGWINDOW_PROGID},
{ "Mail/News Message Navigation Service", &kMsgViewNavigationServiceCID,
NS_MSGVIEWNAVIGATIONSERVICE_PROGID}
NS_MSGVIEWNAVIGATIONSERVICE_PROGID},
{ "Mail/News Service Provider Service", &kMsgServiceProviderServiceCID,
NS_MSGSERVICEPROVIDERSERVICE_PROGID}
};