This commit is contained in:
bienvenu%netscape.com 1999-03-31 05:16:38 +00:00
Родитель 2d9bbb8e17
Коммит cbe1d4ad20
11 изменённых файлов: 35 добавлений и 9 удалений

Просмотреть файл

@ -40,6 +40,7 @@ LLIBS=\
$(DIST)\lib\xpcom32.lib \
$(DIST)\lib\xplib.lib \
$(DIST)\lib\msgcore.lib \
$(DIST)\lib\msgcoreutil.lib \
$(DIST)\lib\imap.lib \
$(LIBNSPR) \
$(DIST)\lib\plc3.lib \

Просмотреть файл

@ -20,6 +20,7 @@
#include "nsIServiceManager.h"
#include "nsIFactory.h"
#include "nsISupports.h"
#include "nsIMAPHostSessionList.h"
#include "nsMsgLocalCID.h"
#include "pratom.h"
#include "nsCOMPtr.h"
@ -31,7 +32,7 @@
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
static NS_DEFINE_CID(kCImapUrl, NS_IMAPURL_CID);
static NS_DEFINE_CID(kCImapProtocol, NS_IMAPPROTOCOL_CID);
static NS_DEFINE_CID(kCImapHostSessionList, NS_IMAPPROTOCOL_CID);
static NS_DEFINE_CID(kCImapHostSessionList, NS_IIMAPHOSTSESSIONLIST_CID);
////////////////////////////////////////////////////////////
@ -123,6 +124,10 @@ nsresult nsImapFactory::CreateInstance(nsISupports *aOuter, const nsIID &aIID, v
inst = NS_STATIC_CAST(nsIImapProtocol *, new nsImapProtocol());
}
if (mClassID.Equals(kCImapHostSessionList))
{
inst = NS_STATIC_CAST(nsIImapHostSessionList *, new nsIMAPHostSessionList());
}
if (inst == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
@ -187,6 +192,10 @@ NSRegisterSelf(nsISupports* aServMgr, const char* path)
path, PR_TRUE, PR_TRUE);
if (NS_FAILED(rv)) goto done;
rv = compMgr->RegisterComponent(kCImapHostSessionList, nsnull, nsnull,
path, PR_TRUE, PR_TRUE);
if (NS_FAILED(rv)) goto done;
done:
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
return rv;
@ -212,6 +221,9 @@ NSUnregisterSelf(nsISupports* aServMgr, const char* path)
rv = compMgr->UnregisterFactory(kCImapProtocol, path);
if (NS_FAILED(rv)) goto done;
rv = compMgr->UnregisterFactory(kCImapHostSessionList, path);
if (NS_FAILED(rv)) goto done;
done:
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
return rv;

Просмотреть файл

@ -30,6 +30,10 @@ class nsIMAPBodyShell;
#define NS_IIMAPHOSTSESSIONLIST_IID \
{ 0x2a8e21fe, 0xe3c4, 0x11d2, {0xa5, 0x04, 0x00, 0x60, 0xb0, 0xfc, 0x04, 0xb7 } }
//479ce8fc-e725-11d2-a505-0060b0fc04b7
#define NS_IIMAPHOSTSESSIONLIST_CID \
{ 0x479ce8fc, 0xe725, 0x11d2, {0xa5, 0x05, 0x00, 0x60, 0xb0, 0xfc, 0x04, 0xb7 } }
// this is an interface to a linked list of host info's
class nsIImapHostSessionList : public nsISupports
{

Просмотреть файл

@ -109,7 +109,7 @@ public:
NS_IMETHOD GetImapAction(nsImapAction * aImapAction) = 0;
NS_IMETHOD SetImapAction(nsImapAction aImapAction) = 0;
NS_IMETHOD GetImapPartToFetch(const char **resultPart) const = 0;
NS_IMETHOD GetImapPartToFetch(char **resultPart) const = 0;
NS_IMETHOD AllocateCannonicalPath(const char *serverPath, char onlineDelimiter, char **allocatedPath ) const = 0;
};

Просмотреть файл

@ -53,6 +53,7 @@ EXPORTS= nsImapUrl.h \
nsImapProtocol.h \
nsImapCore.h \
nsImapProxyEvent.h \
nsImapHostSessionList.h \
$(NULL)
LINCS= \

Просмотреть файл

@ -24,8 +24,11 @@
#include "nsImapProxyEvent.h"
#include "nsIMAPHostSessionList.h"
#include "nsIMAPBodyShell.h"
#include "nsImapServerResponseParser.h"
#include "nspr.h"
PRLogModuleInfo *IMAP;
// netlib required files
#include "nsIStreamListener.h"
#include "nsIInputStream.h"
@ -107,13 +110,15 @@ nsImapProtocol::nsImapProtocol()
m_consumer = nsnull;
// not right, I'm just putting this in to find undefined symbols
// there should be just one of these
nsIMAPHostSessionList *hostList = new nsIMAPHostSessionList;
nsImapServerResponseParser *parser = new nsImapServerResponseParser(*this);
m_imapState = nsImapProtocol::NOT_CONNECTED;
m_currentServerCommandTagNumber = 0;
m_active = PR_FALSE;
m_threadShouldDie = PR_FALSE;
m_pseudoInterrupted = PR_FALSE;
// where should we do this? Perhaps in the factory object?
if (!IMAP)
IMAP = PR_NewLogModule("IMAP");
}
nsresult nsImapProtocol::Initialize(PLEventQueue * aSinkEventQueue)

Просмотреть файл

@ -139,7 +139,7 @@ public:
void ShowProgress() {}
void ProgressEventFunctionUsingId(PRUint32 aMsgId) {}
void ProgressEventFunctionUsingIdWithString(PRUint32 aMsgId, const char * aExtraInfo) {}
void PercentProgressUpdateEvent(char *message, PRInt32 percent);
void PercentProgressUpdateEvent(char *message, PRInt32 percent) {};
// utility function calls made by the server
char * CreateUtf7ConvertedString(const char * aSourceString, PRBool aConvertToUtf7Imap) { return nsnull;}

Просмотреть файл

@ -46,7 +46,8 @@ nsImapServerResponseParser::nsImapServerResponseParser(nsImapProtocol &imapProto
fReportingErrors(PR_TRUE),
fLastChunk(PR_FALSE),
fServerIsNetscape3xServer(PR_FALSE),
m_shell(nsnull)
m_shell(nsnull),
fHostSessionList(nsnull)
{
fSearchResults = nsImapSearchResultSequence::CreateSearchResultSequence();
fMailAccountUrl = nsnull;

Просмотреть файл

@ -172,7 +172,7 @@ protected:
virtual PRBool GetNextLineForParser(char **nextLine);
virtual void end_of_line();
nsIMAPHostSessionList *GetHostSessionList();
nsIMAPHostSessionList *GetHostSessionList() {return fHostSessionList;}
private:
PRBool fProcessingTaggedResponse;
PRBool fCurrentCommandFailed;
@ -240,6 +240,8 @@ private:
// The connection object
nsImapProtocol &fServerConnection;
nsIMAPHostSessionList *fHostSessionList;
};
#endif

Просмотреть файл

@ -638,7 +638,7 @@ NS_IMETHODIMP nsImapUrl::ToString(PRUnichar* *aString) const
return NS_OK;
}
NS_IMETHODIMP nsImapUrl::GetImapPartToFetch(const char **result) const
NS_IMETHODIMP nsImapUrl::GetImapPartToFetch(char **result) const
{
NS_LOCK_INSTANCE();
// here's the old code:

Просмотреть файл

@ -82,7 +82,7 @@ public:
NS_IMETHOD GetServerStatus(PRInt32 *status); // make obsolete
NS_IMETHOD ToString(PRUnichar* *aString) const;
NS_IMETHOD GetImapPartToFetch(const char **result) const;
NS_IMETHOD GetImapPartToFetch(char **result) const;
NS_IMETHOD AllocateCannonicalPath(const char *serverPath, char onlineDelimiter, char **allocatedPath ) const;
// nsImapUrl
nsImapUrl();