From eb7d665ded438f93aa702926fb07c1302feaf808 Mon Sep 17 00:00:00 2001 From: "jefft%netscape.com" Date: Wed, 21 Apr 1999 05:18:56 +0000 Subject: [PATCH] added imap resource to the factory git-svn-id: svn://10.0.0.236/trunk@28439 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/imap/build/nsImapFactory.cpp | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/mozilla/mailnews/imap/build/nsImapFactory.cpp b/mozilla/mailnews/imap/build/nsImapFactory.cpp index dc6f1c32eb8..d50d91aa287 100644 --- a/mozilla/mailnews/imap/build/nsImapFactory.cpp +++ b/mozilla/mailnews/imap/build/nsImapFactory.cpp @@ -25,6 +25,7 @@ #include "nsImapService.h" #include "pratom.h" #include "nsCOMPtr.h" +#include "nsImapMailFolder.h" // include files for components this factory creates... #include "nsImapUrl.h" @@ -36,6 +37,7 @@ static NS_DEFINE_CID(kCImapProtocol, NS_IMAPPROTOCOL_CID); static NS_DEFINE_CID(kCImapHostSessionList, NS_IIMAPHOSTSESSIONLIST_CID); static NS_DEFINE_CID(kCImapIncomingServer, NS_IMAPINCOMINGSERVER_CID); static NS_DEFINE_CID(kCImapService, NS_IMAPSERVICE_CID); +static NS_DEFINE_CID(kCImapResource, NS_IMAPRESOURCE_CID); //////////////////////////////////////////////////////////// // @@ -136,6 +138,21 @@ nsresult nsImapFactory::CreateInstance(nsISupports *aOuter, const nsIID &aIID, v { inst = NS_STATIC_CAST(nsIImapService *, new nsImapService()); } + else if (mClassID.Equals(kCImapResource)) + { + nsImapMailFolder* aImapMailFolder = new nsImapMailFolder(); + if (aImapMailFolder) + { + rv = aImapMailFolder->QueryInterface(aIID, aResult); + if (NS_FAILED(rv)) + delete aImapMailFolder; + return rv; + } + else + { + return NS_ERROR_OUT_OF_MEMORY; + } + } if (inst == nsnull) return NS_ERROR_OUT_OF_MEMORY; @@ -213,6 +230,13 @@ NSRegisterSelf(nsISupports* aServMgr, const char* path) if (NS_FAILED(rv)) goto done; + // register our RDF resource factories: + rv = compMgr->RegisterComponent(kCImapResource, + "Mail/News Imap Resource Factory", + NS_RDF_RESOURCE_FACTORY_PROGID_PREFIX "imap", + path, PR_TRUE, PR_TRUE); + if (NS_FAILED(rv)) goto done; + rv = compMgr->RegisterComponent(kCImapService, nsnull, nsnull, path, PR_TRUE, PR_TRUE);