diff --git a/mozilla/mailnews/base/public/Makefile.in b/mozilla/mailnews/base/public/Makefile.in index 279d967d42f..6ce5d809796 100644 --- a/mozilla/mailnews/base/public/Makefile.in +++ b/mozilla/mailnews/base/public/Makefile.in @@ -22,21 +22,24 @@ srcdir = @srcdir@ include $(DEPTH)/config/autoconf.mk -IDLSRCS = \ - nsIMsgHost.idl \ +IDLSRCS = \ + nsIMsgHost.idl \ nsIMsgGroupRecord.idl \ + nsIMsgFolder.idl \ + nsIMsg.idl \ $(NULL) -EXPORTS = \ - msgCore.h \ - nsMsgFolderFlags.h \ - nsMsgHeaderMasks.h \ - nsMsgMessageFlags.h \ +EXPORTS = \ + msgCore.h \ + nsMsgFolderFlags.h \ + nsMsgHeaderMasks.h \ + nsMsgMessageFlags.h \ nsIMsgRFC822Parser.h \ - nsIMsgHost.h \ - nsIMsgGroupRecord.h \ - nsIMsgFolder.h \ - nsIMsgRDFFolder.h \ + nsIMsgHost.h \ + nsIMsgGroupRecord.h \ + nsIMsgFolder.h \ + nsIMsgRDFFolder.h \ + nsIMsg.h \ $(NULL) include $(topsrcdir)/config/config.mk diff --git a/mozilla/mailnews/base/public/makefile.win b/mozilla/mailnews/base/public/makefile.win index 6404afdd4b8..2ad84f61572 100644 --- a/mozilla/mailnews/base/public/makefile.win +++ b/mozilla/mailnews/base/public/makefile.win @@ -19,21 +19,24 @@ DEPTH=..\..\.. IGNORE_MANIFEST=1 -IDLSRCS = \ - nsIMsgHost.idl \ - nsIMsgGroupRecord.idl \ +IDLSRCS = \ + nsIMsgHost.idl \ + nsIMsgGroupRecord.idl \ + nsIMsgFolder.idl \ + nsIMsg.idl \ $(NULL) -EXPORTS = \ - nsIMsgRFC822Parser.h \ - msgCore.h \ - nsMsgFolderFlags.h \ - nsMsgHeaderMasks.h \ - nsMsgMessageFlags.h \ - nsIMsgHost.h \ - nsIMsgGroupRecord.h \ - nsIMsgFolder.h \ - nsIMsgRDFFolder.h \ +EXPORTS = \ + nsIMsgRFC822Parser.h \ + msgCore.h \ + nsMsgFolderFlags.h \ + nsMsgHeaderMasks.h \ + nsMsgMessageFlags.h \ + nsIMsgHost.h \ + nsIMsgGroupRecord.h \ + nsIMsgFolder.h \ + nsIMsgRDFFolder.h \ + nsIMsg.h \ $(NULL) MODULE=mailnews diff --git a/mozilla/mailnews/base/public/nsIMsg.h b/mozilla/mailnews/base/public/nsIMsg.h new file mode 100644 index 00000000000..ae52cdc755c --- /dev/null +++ b/mozilla/mailnews/base/public/nsIMsg.h @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +#ifndef nsIMsg_h__ +#define nsIMsg_h__ + +#include "nsIRDFNode.h" +#include "prtime.h" + +class nsString; +class nsISupportsArray; +class nsIMsgFolder; + +enum nsMsgPriority { + nsMsgPriority_NotSet, + nsMsgPriority_None, + nsMsgPriority_Lowest, + nsMsgPriority_Low, + nsMsgPriority_Normal, + nsMsgPriority_High, + nsMsgPriority_Highest +}; + +class nsIMsg : public nsISupports { +public: + + NS_IMETHOD GetSubject(nsString* *str) = 0; + NS_IMETHOD GetAuthor(nsString* *str) = 0; + NS_IMETHOD GetMessageId(nsString* *str) = 0; + NS_IMETHOD GetReferences(nsString* *str) = 0; + NS_IMETHOD GetRecipients(nsString* *str) = 0; + NS_IMETHOD GetDate(PRTime *result) = 0; + NS_IMETHOD GetMessageSize(PRUint32 *size) = 0; + NS_IMETHOD GetFlags(PRUint32 *size) = 0; + NS_IMETHOD GetNumChildren(PRUint16 *num) = 0; + NS_IMETHOD GetNumNewChildren(PRUint16 *num) = 0; + NS_IMETHOD GetPriority(nsMsgPriority *priority) = 0; + + NS_IMETHOD GetContainingFolder(nsIMsgFolder* *result) = 0; + + NS_IMETHOD GetThreadChildren(nsISupportsArray* *result) = 0; + NS_IMETHOD GetUnreadThreadChildren(nsISupportsArray* *result) = 0; + +}; + +#define NS_IMSG_IID_STR "b9b8d1b0-bbec-11d2-8177-006008119d7a" +#define NS_IMSG_IID \ + {0xb9b8d1b0, 0xbbec, 0x11d2, \ + { 0x81, 0x77, 0x00, 0x60, 0x08, 0x11, 0xd, 0x7a } } + +#endif // nsIMsg_h__ diff --git a/mozilla/mailnews/base/public/nsIMsg.idl b/mozilla/mailnews/base/public/nsIMsg.idl new file mode 100644 index 00000000000..e86dfb10566 --- /dev/null +++ b/mozilla/mailnews/base/public/nsIMsg.idl @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +#include "nsIMsgFolder.idl" + +enum nsMsgPriority { + nsMsgPriority_NotSet, + nsMsgPriority_None, + nsMsgPriority_Lowest, + nsMsgPriority_Low, + nsMsgPriority_Normal, + nsMsgPriority_High, + nsMsgPriority_Highest +}; + +[uuid(b9b8d1b0-bbec-11d2-8177-006008119d7a)] +interface nsIMsg : nsIRDFResource { + + readonly attribute string subject; + readonly attribute string author; + readonly attribute string messageId; + readonly attribute string references; + readonly attribute string recipients; + readonly attribute time date; + readonly attribute long messageSize; + readonly attribute long flags; + readonly attribute short numChildren; + readonly attribute short numNewChildren; + readonly attribute nsMsgPriority priority; + + readonly attribute nsIMsgFolder containingFolder; + + readonly attribute nsISupportsArray threadChildren; + readonly attribute nsISupportsArray unreadThreadChildren; + +}; diff --git a/mozilla/mailnews/base/public/nsIMsgFolder.h b/mozilla/mailnews/base/public/nsIMsgFolder.h index dce5a828bf8..e1d29e1c73a 100644 --- a/mozilla/mailnews/base/public/nsIMsgFolder.h +++ b/mozilla/mailnews/base/public/nsIMsgFolder.h @@ -5,8 +5,8 @@ #ifndef __gen_nsIMsgFolder_h__ #define __gen_nsIMsgFolder_h__ -#include "nsISupports.h" /* interface nsISupports */ #include "nsISupportsArray.h" /* interface nsISupportsArray */ +#include "nsIMsg.h" enum FolderType { FOLDER_MAIL, @@ -59,13 +59,13 @@ class nsIMsgFolder : public nsISupports { NS_IMETHOD HasSubFolders(PRBool *_retval) = 0; /* */ - NS_IMETHOD GetNumSubFolders(PRInt32 *_retval) = 0; + NS_IMETHOD GetNumSubFolders(PRUint32 *_retval) = 0; /* */ - NS_IMETHOD GetNumSubFoldersToDisplay(PRInt32 *_retval) = 0; + NS_IMETHOD GetNumSubFoldersToDisplay(PRUint32 *_retval) = 0; /* */ - NS_IMETHOD GetSubFolder(PRInt32 which, nsIMsgFolder **_retval) = 0; + NS_IMETHOD GetSubFolder(PRUint32 which, nsIMsgFolder **_retval) = 0; /* */ NS_IMETHOD GetSubFolders(nsISupportsArray **_retval) = 0; @@ -76,6 +76,27 @@ class nsIMsgFolder : public nsISupports { /* */ NS_IMETHOD RemoveSubFolder(const nsIMsgFolder *folder) = 0; + /* */ + NS_IMETHOD HasMessages(PRBool *_retval) = 0; + + /* */ + NS_IMETHOD GetNumMessages(PRUint32 *_retval) = 0; + + /* */ + NS_IMETHOD GetNumMessagesToDisplay(PRUint32 *_retval) = 0; + + /* */ + NS_IMETHOD GetMessage(PRUint32 which, nsIMsg **_retval) = 0; + + /* */ + NS_IMETHOD GetMessages(nsISupportsArray **_retval) = 0; + + /* */ + NS_IMETHOD AddMessage(const nsIMsg *msg) = 0; + + /* */ + NS_IMETHOD RemoveMessage(const nsIMsg *msg) = 0; + /* */ NS_IMETHOD GetDeleteIsMoveToTrash(PRBool *aDeleteIsMoveToTrash) = 0; @@ -95,13 +116,13 @@ class nsIMsgFolder : public nsISupports { NS_IMETHOD RecursiveDelete(PRBool deleteStorage) = 0; /* */ - NS_IMETHOD CreateSubfolder(const char *leafNameFromUser, nsIMsgFolder **outFolder, PRInt32 *outPos) = 0; + NS_IMETHOD CreateSubfolder(const char *leafNameFromUser, nsIMsgFolder **outFolder, PRUint32 *outPos) = 0; /* */ NS_IMETHOD Rename(const char *name) = 0; /* */ - NS_IMETHOD Adopt(const nsIMsgFolder *srcFolder, PRInt32 *outPos) = 0; + NS_IMETHOD Adopt(const nsIMsgFolder *srcFolder, PRUint32 *outPos) = 0; /* */ NS_IMETHOD ContainsChildNamed(const char *name, PRBool *_retval) = 0; @@ -119,8 +140,8 @@ class nsIMsgFolder : public nsISupports { NS_IMETHOD GenerateUniqueSubfolderName(const char *prefix, const nsIMsgFolder *otherFolder, char **_retval) = 0; /* */ - NS_IMETHOD GetDepth(PRInt32 *aDepth) = 0; - NS_IMETHOD SetDepth(PRInt32 aDepth) = 0; + NS_IMETHOD GetDepth(PRUint32 *aDepth) = 0; + NS_IMETHOD SetDepth(PRUint32 aDepth) = 0; /* */ NS_IMETHOD UpdateSummaryTotals() = 0; @@ -129,13 +150,13 @@ class nsIMsgFolder : public nsISupports { NS_IMETHOD SummaryChanged() = 0; /* */ - NS_IMETHOD GetNumUnread(PRBool deep, PRInt32 *_retval) = 0; + NS_IMETHOD GetNumUnread(PRBool deep, PRUint32 *_retval) = 0; /* */ - NS_IMETHOD GetTotalMessages(PRBool deep, PRInt32 *_retval) = 0; + NS_IMETHOD GetTotalMessages(PRBool deep, PRUint32 *_retval) = 0; /* */ - NS_IMETHOD GetExpungedBytesCount(PRInt32 *aExpungedBytesCount) = 0; + NS_IMETHOD GetExpungedBytesCount(PRUint32 *aExpungedBytesCount) = 0; /* */ NS_IMETHOD GetDeletable(PRBool *aDeletable) = 0; @@ -165,7 +186,7 @@ class nsIMsgFolder : public nsISupports { NS_IMETHOD GetRelativePathName(char * *aRelativePathName) = 0; /* */ - NS_IMETHOD GetSizeOnDisk(PRInt32 *aSizeOnDisk) = 0; + NS_IMETHOD GetSizeOnDisk(PRUint32 *aSizeOnDisk) = 0; /* */ NS_IMETHOD RememberPassword(const char *password) = 0; @@ -189,25 +210,25 @@ class nsIMsgFolder : public nsISupports { NS_IMETHOD ReplaceSubfolder(const nsIMsgFolder *oldFolder, const nsIMsgFolder *newFolder) = 0; /* */ - NS_IMETHOD SetFlag(PRInt32 flag) = 0; + NS_IMETHOD SetFlag(PRUint32 flag) = 0; /* */ - NS_IMETHOD ClearFlag(PRInt32 flag) = 0; + NS_IMETHOD ClearFlag(PRUint32 flag) = 0; /* */ - NS_IMETHOD GetFlag(PRInt32 flag, PRBool *_retval) = 0; + NS_IMETHOD GetFlag(PRUint32 flag, PRBool *_retval) = 0; /* */ - NS_IMETHOD ToggleFlag(PRInt32 flag) = 0; + NS_IMETHOD ToggleFlag(PRUint32 flag) = 0; /* */ - NS_IMETHOD OnFlagChange(PRInt32 flag) = 0; + NS_IMETHOD OnFlagChange(PRUint32 flag) = 0; /* */ - NS_IMETHOD GetFlags(PRInt32 *_retval) = 0; + NS_IMETHOD GetFlags(PRUint32 *_retval) = 0; /* */ - NS_IMETHOD GetFoldersWithFlag(PRInt32 flags, nsIMsgFolder **result, PRInt32 resultsize, PRInt32 *numFolders) = 0; + NS_IMETHOD GetFoldersWithFlag(PRUint32 flags, nsIMsgFolder **result, PRUint32 resultsize, PRUint32 *numFolders) = 0; /* */ NS_IMETHOD GetExpansionArray(const nsISupportsArray *expansionArray) = 0; diff --git a/mozilla/mailnews/base/public/nsIMsgFolder.idl b/mozilla/mailnews/base/public/nsIMsgFolder.idl index 81923de078b..ee3d790a0f0 100644 --- a/mozilla/mailnews/base/public/nsIMsgFolder.idl +++ b/mozilla/mailnews/base/public/nsIMsgFolder.idl @@ -16,8 +16,8 @@ * Reserved. */ -#include "nsISupports.idl" #include "nsISupportsArray.idl" +#include "nsIMsg.idl" enum FolderType { FOLDER_MAIL, @@ -41,13 +41,24 @@ interface nsIMsgFolder : nsISupports { string BuildFolderURL(); string GetNameFromPathName(in string pathName); + + // Accessing sub-folders: boolean HasSubFolders(); - long GetNumSubFolders() ; - long GetNumSubFoldersToDisplay(); - nsIMsgFolder GetSubFolder(in long which) ; + unsigned long GetNumSubFolders() ; + unsigned long GetNumSubFoldersToDisplay(); + nsIMsgFolder GetSubFolder(in unsigned long which) ; nsISupportsArray GetSubFolders(); void AddSubFolder(in nsIMsgFolder folder); - void RemoveSubFolder (in nsIMsgFolder folder); + void RemoveSubFolder(in nsIMsgFolder folder); + + // Accessing messages: + boolean HasMessages(); + unsigned long GetNumMessages() ; + unsigned long GetNumMessagesToDisplay(); + nsIMsgFolder GetMessage(in unsigned long which) ; + nsISupportsArray GetMessages(); + void AddMessage(in nsIMsg msg); + void RemoveMessage(in nsIMsg msg); readonly attribute boolean deleteIsMoveToTrash; readonly attribute boolean showDeletedMessages; @@ -58,10 +69,10 @@ interface nsIMsgFolder : nsISupports { void PropagateDelete(inout nsIMsgFolder folder, in boolean deleteStorage); void RecursiveDelete(in boolean deleteStorage); - void CreateSubfolder(in string leafNameFromUser, out nsIMsgFolder outFolder, out long outPos); + void CreateSubfolder(in string leafNameFromUser, out nsIMsgFolder outFolder, out unsigned long outPos); void Rename(in string name); - void Adopt(in nsIMsgFolder srcFolder, out long outPos); + void Adopt(in nsIMsgFolder srcFolder, out unsigned long outPos); boolean ContainsChildNamed(in string name); nsIMsgFolder FindChildNamed(in string name); @@ -70,14 +81,14 @@ interface nsIMsgFolder : nsISupports { string GenerateUniqueSubfolderName(in string prefix, in nsIMsgFolder otherFolder); - attribute long depth; + attribute unsigned long depth; void UpdateSummaryTotals(); void SummaryChanged(); - long GetNumUnread(in boolean deep); - long GetTotalMessages(in boolean deep); + unsigned long GetNumUnread(in boolean deep); + unsigned long GetTotalMessages(in boolean deep); - readonly attribute long expungedBytesCount; + readonly attribute unsigned long expungedBytesCount; readonly attribute boolean deletable; readonly attribute boolean canCreateChildren; readonly attribute boolean canBeRenamed; @@ -91,7 +102,7 @@ interface nsIMsgFolder : nsISupports { boolean DisplayRecipients(); readonly attribute string relativePathName; - readonly attribute long sizeOnDisk; + readonly attribute unsigned long sizeOnDisk; void RememberPassword(in string password); string GetRememberedPassword(); @@ -103,16 +114,16 @@ interface nsIMsgFolder : nsISupports { void ReplaceSubfolder(in nsIMsgFolder oldFolder, in nsIMsgFolder newFolder); - void SetFlag(in long flag); - void ClearFlag(in long flag); - boolean GetFlag(in long flag); + void SetFlag(in unsigned long flag); + void ClearFlag(in unsigned long flag); + boolean GetFlag(in unsigned long flag); - void ToggleFlag (in long flag); - void OnFlagChange (in long flag); - long GetFlags(); + void ToggleFlag (in unsigned long flag); + void OnFlagChange (in unsigned long flag); + unsigned long GetFlags(); - void GetFoldersWithFlag(in long flags, out nsIMsgFolder result, - in long resultsize, out long numFolders); + void GetFoldersWithFlag(in unsigned long flags, out nsIMsgFolder result, + in unsigned long resultsize, out unsigned long numFolders); void GetExpansionArray(in nsISupportsArray expansionArray); @@ -124,4 +135,4 @@ interface nsIMsgFolder : nsISupports { interface nsIMsgMailFolder : nsISupports { attribute string pathName; -}; \ No newline at end of file +}; diff --git a/mozilla/mailnews/base/src/Makefile.in b/mozilla/mailnews/base/src/Makefile.in index 0ea95ce7684..448a9f5535d 100644 --- a/mozilla/mailnews/base/src/Makefile.in +++ b/mozilla/mailnews/base/src/Makefile.in @@ -40,6 +40,7 @@ CPPSRCS = \ nsMsgFolder.cpp \ nsMsgRDFFolder.cpp \ nsNewsSet.cpp \ + nsMsg.cpp \ $(NULL) include $(topsrcdir)/config/config.mk diff --git a/mozilla/mailnews/base/src/makefile.win b/mozilla/mailnews/base/src/makefile.win index 34d155181f1..24542e51d59 100644 --- a/mozilla/mailnews/base/src/makefile.win +++ b/mozilla/mailnews/base/src/makefile.win @@ -34,6 +34,7 @@ CPPSRCS= nsMsgRFC822Parser.cpp \ nsMsgGroupRecord.cpp \ nsMsgRDFFolder.cpp \ nsNewsSet.cpp \ + nsMsg.cpp \ $(NULL) CPP_OBJS= .\$(OBJDIR)\nsMsgRFC822Parser.obj \ @@ -44,6 +45,7 @@ CPP_OBJS= .\$(OBJDIR)\nsMsgRFC822Parser.obj \ .\$(OBJDIR)\nsMsgGroupRecord.obj \ .\$(OBJDIR)\nsMsgRDFFolder.obj \ .\$(OBJDIR)\nsNewsSet.obj \ + .\$(OBJDIR)\nsMsg.obj \ $(NULL) diff --git a/mozilla/mailnews/base/src/nsMsg.cpp b/mozilla/mailnews/base/src/nsMsg.cpp new file mode 100644 index 00000000000..8305af529df --- /dev/null +++ b/mozilla/mailnews/base/src/nsMsg.cpp @@ -0,0 +1,151 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +#include "nsMsg.h" +#include "nsISupportsArray.h" + +//////////////////////////////////////////////////////////////////////////////// + +static NS_DEFINE_IID(kIMsgIID, NS_IMSG_IID); +static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); +static NS_DEFINE_IID(kIRDFResourceIID, NS_IRDFRESOURCE_IID); +static NS_DEFINE_IID(kIRDFNodeIID, NS_IRDFNODE_IID); + +//////////////////////////////////////////////////////////////////////////////// + +nsMsg::nsMsg(const char* uri) + : nsRDFResource(uri) +{ +} + +nsresult +nsMsg::Init(void) +{ + return NS_OK; +} + +nsMsg::~nsMsg(void) +{ +} + +NS_IMPL_ADDREF(nsMsg) +NS_IMPL_RELEASE(nsMsg) + +NS_IMETHODIMP +nsMsg::QueryInterface(REFNSIID iid, void** result) +{ + if (! result) + return NS_ERROR_NULL_POINTER; + + *result = nsnull; + if (iid.Equals(kIMsgIID) || + iid.Equals(kISupportsIID)) { + *result = NS_STATIC_CAST(nsIMsg*, this); + AddRef(); + return NS_OK; + } + return nsRDFResource::QueryInterface(iid, result); +} + +//////////////////////////////////////////////////////////////////////////////// +// nsIMsg methods: + +NS_METHOD +nsMsg::GetSubject(nsString* *str) +{ + return NS_OK; +} + +NS_METHOD +nsMsg::GetAuthor(nsString* *str) +{ + return NS_OK; +} + +NS_METHOD +nsMsg::GetMessageId(nsString* *str) +{ + return NS_OK; +} + +NS_METHOD +nsMsg::GetReferences(nsString* *str) +{ + return NS_OK; +} + +NS_METHOD +nsMsg::GetRecipients(nsString* *str) +{ + return NS_OK; +} + +NS_METHOD +nsMsg::GetDate(PRTime *result) +{ + return NS_OK; +} + +NS_METHOD +nsMsg::GetMessageSize(PRUint32 *size) +{ + return NS_OK; +} + +NS_METHOD +nsMsg::GetFlags(PRUint32 *size) +{ + return NS_OK; +} + +NS_METHOD +nsMsg::GetNumChildren(PRUint16 *num) +{ + return NS_OK; +} + +NS_METHOD +nsMsg::GetNumNewChildren(PRUint16 *num) +{ + return NS_OK; +} + +NS_METHOD +nsMsg::GetPriority(nsMsgPriority *priority) +{ + return NS_OK; +} + +NS_METHOD +nsMsg::GetContainingFolder(nsIMsgFolder* *result) +{ + return NS_OK; +} + +NS_METHOD +nsMsg::GetThreadChildren(nsISupportsArray* *result) +{ + return NS_OK; +} + +NS_METHOD +nsMsg::GetUnreadThreadChildren(nsISupportsArray* *result) +{ + return NS_OK; +} + diff --git a/mozilla/mailnews/base/src/nsMsg.h b/mozilla/mailnews/base/src/nsMsg.h new file mode 100644 index 00000000000..38312934f1c --- /dev/null +++ b/mozilla/mailnews/base/src/nsMsg.h @@ -0,0 +1,57 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +#ifndef nsMsg_h__ +#define nsMsg_h__ + +#include "nsIMsg.h" +#include "nsRDFResource.h" + +class nsMsg : public nsRDFResource, public nsIMsg { +public: + + NS_DECL_ISUPPORTS + + // nsIMsg methods: + NS_IMETHOD GetSubject(nsString* *str); + NS_IMETHOD GetAuthor(nsString* *str); + NS_IMETHOD GetMessageId(nsString* *str); + NS_IMETHOD GetReferences(nsString* *str); + NS_IMETHOD GetRecipients(nsString* *str); + NS_IMETHOD GetDate(PRTime *result); + NS_IMETHOD GetMessageSize(PRUint32 *size); + NS_IMETHOD GetFlags(PRUint32 *size); + NS_IMETHOD GetNumChildren(PRUint16 *num); + NS_IMETHOD GetNumNewChildren(PRUint16 *num); + NS_IMETHOD GetPriority(nsMsgPriority *priority); + + NS_IMETHOD GetContainingFolder(nsIMsgFolder* *result); + + NS_IMETHOD GetThreadChildren(nsISupportsArray* *result); + NS_IMETHOD GetUnreadThreadChildren(nsISupportsArray* *result); + + // nsMsg methods: + nsMsg(const char* uri); + virtual ~nsMsg(void); + nsresult Init(void); + +protected: + +}; + +#endif // nsMsg_h__ diff --git a/mozilla/mailnews/base/src/nsMsgFolder.cpp b/mozilla/mailnews/base/src/nsMsgFolder.cpp index cf47a63692e..10d114ff888 100644 --- a/mozilla/mailnews/base/src/nsMsgFolder.cpp +++ b/mozilla/mailnews/base/src/nsMsgFolder.cpp @@ -70,7 +70,7 @@ nsMsgFolder::~nsMsgFolder() { if(mSubFolders) { - PRInt32 count = mSubFolders->Count(); + PRUint32 count = mSubFolders->Count(); for (int i = count - 1; i >= 0; i--) mSubFolders->RemoveElementAt(i); @@ -401,7 +401,7 @@ NS_IMETHODIMP nsMsgFolder::HasSubFolders(PRBool *hasSubFolders) else return NS_ERROR_NULL_POINTER; } -NS_IMETHODIMP nsMsgFolder::GetNumSubFolders(PRInt32 *numSubFolders) +NS_IMETHODIMP nsMsgFolder::GetNumSubFolders(PRUint32 *numSubFolders) { if(numSubFolders) { @@ -413,7 +413,7 @@ NS_IMETHODIMP nsMsgFolder::GetNumSubFolders(PRInt32 *numSubFolders) } -NS_IMETHODIMP nsMsgFolder::GetNumSubFoldersToDisplay(PRInt32 *numSubFolders) +NS_IMETHODIMP nsMsgFolder::GetNumSubFoldersToDisplay(PRUint32 *numSubFolders) { if(numSubFolders) { @@ -423,9 +423,9 @@ NS_IMETHODIMP nsMsgFolder::GetNumSubFoldersToDisplay(PRInt32 *numSubFolders) return NS_ERROR_NULL_POINTER; } -NS_IMETHODIMP nsMsgFolder::GetSubFolder(int which, nsIMsgFolder **aFolder) +NS_IMETHODIMP nsMsgFolder::GetSubFolder(PRUint32 which, nsIMsgFolder **aFolder) { - PR_ASSERT(which >= 0 && which < mSubFolders->Count()); + PR_ASSERT(which >= 0 && which < (PRUint32)mSubFolders->Count()); // XXX fix Count return type if(aFolder) { *aFolder = nsnull; @@ -609,7 +609,7 @@ NS_IMETHODIMP nsMsgFolder::PropagateDelete (nsIMsgFolder **folder, PRBool delete } else { - PRInt32 folderDepth, childDepth; + PRUint32 folderDepth, childDepth; if(NS_SUCCEEDED((*folder)->GetDepth(&folderDepth)) && NS_SUCCEEDED(child->GetDepth(&childDepth)) && @@ -663,7 +663,7 @@ NS_IMETHODIMP nsMsgFolder::RecursiveDelete (PRBool deleteStorage) return status; } -NS_IMETHODIMP nsMsgFolder::CreateSubfolder (const char *, nsIMsgFolder**, PRInt32*) +NS_IMETHODIMP nsMsgFolder::CreateSubfolder (const char *, nsIMsgFolder**, PRUint32*) { return NS_OK; @@ -684,7 +684,7 @@ NS_IMETHODIMP nsMsgFolder::Rename (const char *name) } -NS_IMETHODIMP nsMsgFolder::Adopt (const nsIMsgFolder *srcFolder, PRInt32* outPos) +NS_IMETHODIMP nsMsgFolder::Adopt (const nsIMsgFolder *srcFolder, PRUint32* outPos) { return NS_OK; @@ -719,9 +719,9 @@ NS_IMETHODIMP nsMsgFolder::FindChildNamed (const char *name, nsIMsgFolder ** aCh nsIMsgFolder *folder = nsnull; - PRInt32 count = mSubFolders->Count(); + PRUint32 count = mSubFolders->Count(); - for (int i = 0; i < count; i++) + for (PRUint32 i = 0; i < count; i++) { nsISupports *supports; supports = mSubFolders->ElementAt(i); @@ -777,9 +777,9 @@ NS_IMETHODIMP nsMsgFolder::FindParentOf (const nsIMsgFolder * aFolder, nsIMsgFol *aParent = nsnull; - PRInt32 count = mSubFolders->Count(); + PRUint32 count = mSubFolders->Count(); - for (int i = 0; i < count && *aParent == NULL; i++) + for (PRUint32 i = 0; i < count && *aParent == NULL; i++) { nsISupports *supports = mSubFolders->ElementAt(i); nsIMsgFolder *child = nsnull; @@ -796,7 +796,7 @@ NS_IMETHODIMP nsMsgFolder::FindParentOf (const nsIMsgFolder * aFolder, nsIMsgFol NS_RELEASE(supports); } - for (int j = 0; j < count && *aParent == NULL; j++) + for (PRUint32 j = 0; j < count && *aParent == NULL; j++) { nsISupports *supports = mSubFolders->ElementAt(j); @@ -819,9 +819,9 @@ NS_IMETHODIMP nsMsgFolder::IsParentOf (const nsIMsgFolder *child, PRBool deep, P if(!isParent) return NS_ERROR_NULL_POINTER; - PRInt32 count = mSubFolders->Count(); + PRUint32 count = mSubFolders->Count(); - for (int i = 0; i < count; i++) + for (PRUint32 i = 0; i < count; i++) { nsISupports *supports = mSubFolders->ElementAt(i); nsIMsgFolder *folder; @@ -857,7 +857,7 @@ NS_IMETHODIMP nsMsgFolder::GenerateUniqueSubfolderName(const char *prefix, const } -NS_IMETHODIMP nsMsgFolder::GetDepth(PRInt32 *depth) +NS_IMETHODIMP nsMsgFolder::GetDepth(PRUint32 *depth) { if(!depth) return NS_ERROR_NULL_POINTER; @@ -866,7 +866,7 @@ NS_IMETHODIMP nsMsgFolder::GetDepth(PRInt32 *depth) } -NS_IMETHODIMP nsMsgFolder::SetDepth(PRInt32 depth) +NS_IMETHODIMP nsMsgFolder::SetDepth(PRUint32 depth) { mDepth = depth; return NS_OK; @@ -888,18 +888,18 @@ NS_IMETHODIMP nsMsgFolder::SummaryChanged() return NS_OK; } -NS_IMETHODIMP nsMsgFolder::GetNumUnread(PRBool deep, PRInt32 *numUnread) +NS_IMETHODIMP nsMsgFolder::GetNumUnread(PRBool deep, PRUint32 *numUnread) { if(!numUnread) return NS_ERROR_NULL_POINTER; - PRInt32 total = mNumUnreadMessages; + PRUint32 total = mNumUnreadMessages; if (deep) { nsIMsgFolder *folder; - PRInt32 count = mSubFolders->Count(); + PRUint32 count = mSubFolders->Count(); - for (int i = 0; i < count; i++) + for (PRUint32 i = 0; i < count; i++) { nsISupports *supports = mSubFolders->ElementAt(i); @@ -907,7 +907,7 @@ NS_IMETHODIMP nsMsgFolder::GetNumUnread(PRBool deep, PRInt32 *numUnread) { if (folder) { - PRInt32 num; + PRUint32 num; folder->GetNumUnread(deep, &num); if (num >= 0) // it's legal for counts to be negative if we don't know total += num; @@ -922,18 +922,18 @@ NS_IMETHODIMP nsMsgFolder::GetNumUnread(PRBool deep, PRInt32 *numUnread) } -NS_IMETHODIMP nsMsgFolder::GetTotalMessages(PRBool deep, PRInt32 *totalMessages) +NS_IMETHODIMP nsMsgFolder::GetTotalMessages(PRBool deep, PRUint32 *totalMessages) { if(!totalMessages) return NS_ERROR_NULL_POINTER; - PRInt32 total = mNumTotalMessages; + PRUint32 total = mNumTotalMessages; if (deep) { nsIMsgFolder *folder; - PRInt32 count = mSubFolders->Count(); + PRUint32 count = mSubFolders->Count(); - for (int i = 0; i < count; i++) + for (PRUint32 i = 0; i < count; i++) { nsISupports *supports = mSubFolders->ElementAt(i); @@ -941,7 +941,7 @@ NS_IMETHODIMP nsMsgFolder::GetTotalMessages(PRBool deep, PRInt32 *totalMessages) { if (folder) { - PRInt32 num; + PRUint32 num; folder->GetTotalMessages (deep, &num); if (num >= 0) // it's legal for counts to be negative if we don't know total += num; @@ -956,7 +956,7 @@ NS_IMETHODIMP nsMsgFolder::GetTotalMessages(PRBool deep, PRInt32 *totalMessages) } #ifdef HAVE_DB - NS_IMETHOD GetTotalMessagesInDB(PRInt32 *totalMessages) const; // How many messages in database. + NS_IMETHOD GetTotalMessagesInDB(PRUint32 *totalMessages) const; // How many messages in database. #endif #ifdef HAVE_PANE @@ -976,12 +976,12 @@ NS_IMETHODIMP nsMsgFolder::GetTotalMessages(PRBool deep, PRInt32 *totalMessages) void ChangeNumPendingTotalMessages(int32 delta); -NS_IMETHODIMP nsMsgFolder::SetFolderPrefFlags(PRInt32 flags) +NS_IMETHODIMP nsMsgFolder::SetFolderPrefFlags(PRUint32 flags) { } -NS_IMETHODIMP nsMsgFolder::GetFolderPrefFlags(PRInt32 *flags) +NS_IMETHODIMP nsMsgFolder::GetFolderPrefFlags(PRUint32 *flags) { } @@ -1008,7 +1008,7 @@ NS_IMETHODIMP nsMsgFolder::GetLastMessageLoaded() #endif -NS_IMETHODIMP nsMsgFolder::SetFlag(PRInt32 flag) +NS_IMETHODIMP nsMsgFolder::SetFlag(PRUint32 flag) { // OnFlagChange can be expensive, so don't call it if we don't need to PRBool flagSet; @@ -1026,7 +1026,7 @@ NS_IMETHODIMP nsMsgFolder::SetFlag(PRInt32 flag) return NS_OK; } -NS_IMETHODIMP nsMsgFolder::ClearFlag(PRInt32 flag) +NS_IMETHODIMP nsMsgFolder::ClearFlag(PRUint32 flag) { // OnFlagChange can be expensive, so don't call it if we don't need to PRBool flagSet; @@ -1044,13 +1044,13 @@ NS_IMETHODIMP nsMsgFolder::ClearFlag(PRInt32 flag) return NS_OK; } -NS_IMETHODIMP nsMsgFolder::GetFlag(PRInt32 flag, PRBool *_retval) +NS_IMETHODIMP nsMsgFolder::GetFlag(PRUint32 flag, PRBool *_retval) { *_retval = ((mFlags & flag) != 0); return NS_OK; } -NS_IMETHODIMP nsMsgFolder::ToggleFlag(PRInt32 flag) +NS_IMETHODIMP nsMsgFolder::ToggleFlag(PRUint32 flag) { mFlags ^= flag; OnFlagChange (flag); @@ -1058,22 +1058,22 @@ NS_IMETHODIMP nsMsgFolder::ToggleFlag(PRInt32 flag) return NS_OK; } -NS_IMETHODIMP nsMsgFolder::OnFlagChange(PRInt32 flag) +NS_IMETHODIMP nsMsgFolder::OnFlagChange(PRUint32 flag) { //Still need to implement return NS_OK; } -NS_IMETHODIMP nsMsgFolder::GetFlags(PRInt32 *_retval) +NS_IMETHODIMP nsMsgFolder::GetFlags(PRUint32 *_retval) { *_retval = mFlags; return NS_OK; } -NS_IMETHODIMP nsMsgFolder::GetFoldersWithFlag(PRInt32 flags, nsIMsgFolder **result, - PRInt32 resultsize, PRInt32 *numFolders) +NS_IMETHODIMP nsMsgFolder::GetFoldersWithFlag(PRUint32 flags, nsIMsgFolder **result, + PRUint32 resultsize, PRUint32 *numFolders) { - int num = 0; + PRUint32 num = 0; if ((flags & mFlags) == flags) { if (result && (num < resultsize)) { result[num] = this; @@ -1082,14 +1082,14 @@ NS_IMETHODIMP nsMsgFolder::GetFoldersWithFlag(PRInt32 flags, nsIMsgFolder **resu } nsIMsgFolder *folder = nsnull; - for (int i=0; i < mSubFolders->Count(); i++) { + for (PRUint32 i=0; i < (PRUint32)mSubFolders->Count(); i++) { nsISupports *supports = mSubFolders->ElementAt(i); if(NS_SUCCEEDED(supports->QueryInterface(kIMsgFolderIID, (void**)&folder))) { // CAREFUL! if NULL ise passed in for result then the caller // still wants the full count! Otherwise, the result should be at most the // number that the caller asked for. - int numSubFolders; + PRUint32 numSubFolders; if (!result) { @@ -1129,7 +1129,7 @@ NS_IMETHODIMP nsMsgFolder::GetExpansionArray(const nsISupportsArray *expansionAr if(NS_SUCCEEDED(supports->QueryInterface(kIMsgFolderIID, (void**)&folder))) { ((nsISupportsArray*)expansionArray)->InsertElementAt(folder, expansionArray->Count()); - PRInt32 flags; + PRUint32 flags; folder->GetFlags(&flags); if (!(flags & MSG_FOLDER_FLAG_ELIDED)) folder->GetExpansionArray(expansionArray); @@ -1154,7 +1154,7 @@ NS_IMETHODIMP nsMsgFolder::EscapeMessageId(const char *messageId, const char **e } #endif -NS_IMETHODIMP nsMsgFolder::GetExpungedBytesCount(PRInt32 *count) +NS_IMETHODIMP nsMsgFolder::GetExpungedBytesCount(PRUint32 *count) { if(!count) return NS_ERROR_NULL_POINTER; @@ -1328,7 +1328,7 @@ NS_IMETHODIMP nsMsgFolder::GetRelativePathName (char **pathName) } -NS_IMETHODIMP nsMsgFolder::GetSizeOnDisk(PRInt32 *size) +NS_IMETHODIMP nsMsgFolder::GetSizeOnDisk(PRUint32 *size) { if(!size) return NS_ERROR_NULL_POINTER; @@ -1456,7 +1456,7 @@ NS_IMETHODIMP nsMsgMailFolder::BuildFolderURL(char **url) } -NS_IMETHODIMP nsMsgMailFolder::CreateSubfolder(const char *leafNameFromUser, nsIMsgFolder **outFolder, PRInt32 *outPos) +NS_IMETHODIMP nsMsgMailFolder::CreateSubfolder(const char *leafNameFromUser, nsIMsgFolder **outFolder, PRUint32 *outPos) { #ifdef HAVE_PORT MsgERR status = 0; @@ -1687,7 +1687,7 @@ NS_IMETHODIMP nsMsgMailFolder::Rename (const char *newName) return NS_OK; } -NS_IMETHODIMP nsMsgMailFolder::Adopt(const nsIMsgFolder *srcFolder, PRInt32 *outPos) +NS_IMETHODIMP nsMsgMailFolder::Adopt(const nsIMsgFolder *srcFolder, PRUint32 *outPos) { #ifdef HAVE_PORT MsgERR err = eSUCCESS; @@ -1788,7 +1788,7 @@ NS_IMETHODIMP nsMsgMailFolder::GenerateUniqueSubfolderName(const char *prefix, /* only try 256 times */ for (int count = 0; (count < 256); count++) { - PRInt32 prefixSize = PL_strlen(prefix); + PRUint32 prefixSize = PL_strlen(prefix); //allocate string big enough for prefix, 256, and '\0' char *uniqueName = (char*)PR_MALLOC(prefixSize + 4); @@ -1825,7 +1825,7 @@ NS_IMETHODIMP nsMsgMailFolder::UpdateSummaryTotals() return NS_OK; } -NS_IMETHODIMP nsMsgMailFolder::GetExpungedBytesCount(PRInt32 *count) +NS_IMETHODIMP nsMsgMailFolder::GetExpungedBytesCount(PRUint32 *count) { if(!count) return NS_ERROR_NULL_POINTER; @@ -1919,7 +1919,7 @@ NS_IMETHODIMP nsMsgMailFolder::GetRelativePathName (char **pathName) } -NS_IMETHODIMP nsMsgMailFolder::GetSizeOnDisk(PRInt32 size) +NS_IMETHODIMP nsMsgMailFolder::GetSizeOnDisk(PRUint32 size) { #ifdef HAVE_PORT int32 ret = 0; @@ -2117,4 +2117,49 @@ NS_NewRDFMsgFolderResourceFactory(nsIRDFResourceFactory** aResult) return NS_OK; } +//////////////////////////////////////////////////////////////////////////////// +// Accessing Messages: +NS_IMETHODIMP +nsMsgFolder::HasMessages(PRBool *_retval) +{ + return NS_OK; +} + +NS_IMETHODIMP +nsMsgFolder::GetNumMessages(PRUint32 *_retval) +{ + return NS_OK; +} + +NS_IMETHODIMP +nsMsgFolder::GetNumMessagesToDisplay(PRUint32 *_retval) +{ + return NS_OK; +} + +NS_IMETHODIMP +nsMsgFolder::GetMessage(PRUint32 which, nsIMsg **_retval) +{ + return NS_OK; +} + +NS_IMETHODIMP +nsMsgFolder::GetMessages(nsISupportsArray **_retval) +{ + return NS_OK; +} + +NS_IMETHODIMP +nsMsgFolder::AddMessage(const nsIMsg *msg) +{ + return NS_OK; +} + +NS_IMETHODIMP +nsMsgFolder::RemoveMessage(const nsIMsg *msg) +{ + return NS_OK; +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/mailnews/base/src/nsMsgFolder.h b/mozilla/mailnews/base/src/nsMsgFolder.h index 3bdafdfe12c..720b3fea563 100644 --- a/mozilla/mailnews/base/src/nsMsgFolder.h +++ b/mozilla/mailnews/base/src/nsMsgFolder.h @@ -44,10 +44,10 @@ public: NS_IMETHOD GetType(FolderType *type); - // Gets the URL that represents the given message. Returns a newly - // created string that must be free'd using XP_FREE(). - // If the db is NULL, then returns a URL that represents the entire - // folder as a whole. + // Gets the URL that represents the given message. Returns a newly + // created string that must be free'd using XP_FREE(). + // If the db is NULL, then returns a URL that represents the entire + // folder as a whole. #ifdef HAVE_DB NS_IMETHOD BuildUrl (MessageDB *db, MessageKey key, char ** url); #endif @@ -58,39 +58,39 @@ public: #ifdef DOES_FOLDEROPERATIONS NS_IMETHOD StartAsyncCopyMessagesInto (MSG_FolderInfo *dstFolder, - MSG_Pane* sourcePane, - MessageDB *sourceDB, - IDArray *srcArray, - int32 srcCount, - MWContext *currentContext, - MSG_UrlQueue *urlQueue, - XP_Bool deleteAfterCopy, - MessageKey nextKey = MSG_MESSAGEKEYNONE); + MSG_Pane* sourcePane, + MessageDB *sourceDB, + IDArray *srcArray, + int32 srcCount, + MWContext *currentContext, + MSG_UrlQueue *urlQueue, + XP_Bool deleteAfterCopy, + MessageKey nextKey = MSG_MESSAGEKEYNONE); - NS_IMETHOD BeginCopyingMessages (MSG_FolderInfo *dstFolder, - MessageDB *sourceDB, - IDArray *srcArray, - MSG_UrlQueue *urlQueue, - int32 srcCount, - MessageCopyInfo *copyInfo); + NS_IMETHOD BeginCopyingMessages (MSG_FolderInfo *dstFolder, + MessageDB *sourceDB, + IDArray *srcArray, + MSG_UrlQueue *urlQueue, + int32 srcCount, + MessageCopyInfo *copyInfo); - NS_IMETHOD FinishCopyingMessages (MWContext *context, - MSG_FolderInfo * srcFolder, - MSG_FolderInfo *dstFolder, - MessageDB *sourceDB, - IDArray **ppSrcArray, - int32 srcCount, - msg_move_state *state); + NS_IMETHOD FinishCopyingMessages (MWContext *context, + MSG_FolderInfo * srcFolder, + MSG_FolderInfo *dstFolder, + MessageDB *sourceDB, + IDArray **ppSrcArray, + int32 srcCount, + msg_move_state *state); - NS_IMETHOD CleanupCopyMessagesInto (MessageCopyInfo **info); + NS_IMETHOD CleanupCopyMessagesInto (MessageCopyInfo **info); - NS_IMETHOD SaveMessages(IDArray *, const char *fileName, - MSG_Pane *pane, MessageDB *msgDB, - int (*doneCB)(void *, int status) = NULL, void *state = NULL, - XP_Bool addMozillaStatus = TRUE); + NS_IMETHOD SaveMessages(IDArray *, const char *fileName, + MSG_Pane *pane, MessageDB *msgDB, + int (*doneCB)(void *, int status) = NULL, void *state = NULL, + XP_Bool addMozillaStatus = TRUE); #endif NS_IMETHOD GetPrettyName(char * *aPrettyName); @@ -101,10 +101,11 @@ public: NS_IMETHOD BuildFolderURL(char ** url); NS_IMETHOD GetNameFromPathName(const char *pathName, char ** name); + NS_IMETHOD HasSubFolders(PRBool *hasSubFolders); - NS_IMETHOD GetNumSubFolders(PRInt32 *numSubFolders); - NS_IMETHOD GetNumSubFoldersToDisplay(PRInt32 *numSubFolders); - NS_IMETHOD GetSubFolder(int which, nsIMsgFolder **aFolder); + NS_IMETHOD GetNumSubFolders(PRUint32 *numSubFolders); + NS_IMETHOD GetNumSubFoldersToDisplay(PRUint32 *numSubFolders); + NS_IMETHOD GetSubFolder(PRUint32 which, nsIMsgFolder **aFolder); NS_IMETHOD GetSubFolders (nsISupportsArray ** subFolders); NS_IMETHOD AddSubFolder(const nsIMsgFolder *folder); NS_IMETHOD AddSubfolderIfUnique(const nsIMsgFolder *newSubfolder); @@ -115,6 +116,14 @@ public: NS_IMETHOD GetVisibleSubFolders (nsISupportsArray ** visibleSubFolders); #endif + NS_IMETHOD HasMessages(PRBool *_retval); + NS_IMETHOD GetNumMessages(PRUint32 *_retval); + NS_IMETHOD GetNumMessagesToDisplay(PRUint32 *_retval); + NS_IMETHOD GetMessage(PRUint32 which, nsIMsg **_retval); + NS_IMETHOD GetMessages(nsISupportsArray **_retval); + NS_IMETHOD AddMessage(const nsIMsg *msg); + NS_IMETHOD RemoveMessage(const nsIMsg *msg); + #ifdef HAVE_ADMINURL NS_IMETHOD GetAdminUrl(MWContext *context, MSG_AdminURLType type); NS_IMETHOD HaveAdminUrl(MSG_AdminURLType type, PRBool *hadAdminUrl); @@ -129,10 +138,10 @@ public: NS_IMETHOD PropagateDelete (nsIMsgFolder **folder, PRBool deleteStorage); NS_IMETHOD RecursiveDelete (PRBool deleteStorage); // called by PropagateDelete - NS_IMETHOD CreateSubfolder (const char *leafNameFromuser, nsIMsgFolder** outFolder, PRInt32* outPos); + NS_IMETHOD CreateSubfolder (const char *leafNameFromuser, nsIMsgFolder** outFolder, PRUint32* outPos); NS_IMETHOD Rename (const char *name); - NS_IMETHOD Adopt (const nsIMsgFolder *srcFolder, PRInt32*); + NS_IMETHOD Adopt (const nsIMsgFolder *srcFolder, PRUint32*); NS_IMETHOD ContainsChildNamed (const char *name, PRBool *containsChild); NS_IMETHOD FindChildNamed (const char *name, nsIMsgFolder ** aChild); @@ -140,20 +149,20 @@ public: NS_IMETHOD IsParentOf (const nsIMsgFolder *, PRBool deep, PRBool *isParent); NS_IMETHOD GenerateUniqueSubfolderName(const char *prefix, const nsIMsgFolder *otherFolder, - char **name); + char **name); - NS_IMETHOD GetDepth(PRInt32 *depth); - NS_IMETHOD SetDepth(PRInt32 depth); + NS_IMETHOD GetDepth(PRUint32 *depth); + NS_IMETHOD SetDepth(PRUint32 depth); - // updates num messages and num unread - should be pure virtual - // when I get around to implementing in all subclasses? + // updates num messages and num unread - should be pure virtual + // when I get around to implementing in all subclasses? NS_IMETHOD UpdateSummaryTotals(); NS_IMETHOD SummaryChanged(); - NS_IMETHOD GetNumUnread(PRBool deep, PRInt32 *numUnread); // How many unread messages in this folder. - NS_IMETHOD GetTotalMessages(PRBool deep, PRInt32 *totalMessages); // Total number of messages in this folder. + NS_IMETHOD GetNumUnread(PRBool deep, PRUint32 *numUnread); // How many unread messages in this folder. + NS_IMETHOD GetTotalMessages(PRBool deep, PRUint32 *totalMessages); // Total number of messages in this folder. #ifdef HAVE_DB - NS_IMETHOD GetTotalMessagesInDB(PRInt32 *totalMessages) const; // How many messages in database. + NS_IMETHOD GetTotalMessagesInDB(PRUint32 *totalMessages) const; // How many messages in database. #endif #ifdef HAVE_PANE @@ -173,8 +182,8 @@ public: void ChangeNumPendingTotalMessages(int32 delta); - NS_IMETHOD SetFolderPrefFlags(PRInt32 flags); - NS_IMETHOD GetFolderPrefFlags(PRInt32 *flags); + NS_IMETHOD SetFolderPrefFlags(PRUint32 flags); + NS_IMETHOD GetFolderPrefFlags(PRUint32 *flags); NS_IMETHOD SetFolderCSID(PRInt16 csid); NS_IMETHOD GetFolderCSID(PRInt16 *csid); @@ -183,20 +192,20 @@ public: NS_IMETHOD GetLastMessageLoaded(); #endif - NS_IMETHOD SetFlag (PRInt32 which); - NS_IMETHOD ClearFlag (PRInt32 which); - NS_IMETHOD GetFlag(PRInt32 flag, PRBool *_retval); + NS_IMETHOD SetFlag (PRUint32 which); + NS_IMETHOD ClearFlag (PRUint32 which); + NS_IMETHOD GetFlag(PRUint32 flag, PRBool *_retval); - NS_IMETHOD ToggleFlag (PRInt32 which); - NS_IMETHOD OnFlagChange (PRInt32 which); - NS_IMETHOD GetFlags(PRInt32 *flags); + NS_IMETHOD ToggleFlag (PRUint32 which); + NS_IMETHOD OnFlagChange (PRUint32 which); + NS_IMETHOD GetFlags(PRUint32 *flags); #ifdef HAVE_PANE - NS_IMETHOD SetFlagInAllFolderPanes(PRInt32 which); + NS_IMETHOD SetFlagInAllFolderPanes(PRUint32 which); #endif - NS_IMETHOD GetFoldersWithFlag(PRInt32 flags, nsIMsgFolder** result, - PRInt32 resultsize, PRInt32 *numFolders); + NS_IMETHOD GetFoldersWithFlag(PRUint32 flags, nsIMsgFolder** result, + PRUint32 resultsize, PRUint32 *numFolders); NS_IMETHOD GetExpansionArray(const nsISupportsArray *expansionArray); @@ -204,7 +213,7 @@ public: NS_IMETHOD EscapeMessageId(const char *messageId, const char **escapeMessageID); #endif - NS_IMETHOD GetExpungedBytesCount(PRInt32 *count); + NS_IMETHOD GetExpungedBytesCount(PRUint32 *count); NS_IMETHOD GetDeletable (PRBool *deletable); NS_IMETHOD GetCanCreateChildren (PRBool *canCreateChildren); @@ -245,7 +254,7 @@ public: NS_IMETHOD GetRelativePathName (char **pathName); - NS_IMETHOD GetSizeOnDisk(PRInt32 *size); + NS_IMETHOD GetSizeOnDisk(PRUint32 *size); #ifdef HAVE_NET NS_IMETHOD ShouldPerformOperationOffline(PRBool *performOffline); @@ -262,13 +271,13 @@ public: NS_IMETHOD GetUserName(char **userName); NS_IMETHOD GetHostName(char **hostName); - protected: +protected: char* mName; PRUint32 mFlags; - PRInt32 mNumUnreadMessages; /* count of unread messages (-1 means - unknown; -2 means unknown but we already - tried to find out.) */ - PRInt32 mNumTotalMessages; /* count of existing messages. */ + PRUint32 mNumUnreadMessages; /* count of unread messages (-1 means + unknown; -2 means unknown but we already + tried to find out.) */ + PRUint32 mNumTotalMessages; /* count of existing messages. */ nsISupportsArray *mSubFolders; #ifdef HAVE_MASTER MSG_Master *mMaster; @@ -276,7 +285,7 @@ public: PRInt16 mCsid; // default csid for folder/newsgroup - maintained by fe. PRUint8 mDepth; - PRInt32 mPrefFlags; // prefs like MSG_PREF_OFFLINE, MSG_PREF_ONE_PANE, etc + PRUint32 mPrefFlags; // prefs like MSG_PREF_OFFLINE, MSG_PREF_ONE_PANE, etc #ifdef HAVE_SEMAPHORE void *mSemaphoreHolder; // set when the folder is being written to #endif @@ -286,8 +295,8 @@ public: // These values are used for tricking the front end into thinking that we have more // messages than are really in the DB. This is usually after and IMAP message copy where // we don't want to do an expensive select until the user actually opens that folder - PRInt32 mNumPendingUnreadMessages; - PRInt32 mNumPendingTotalMessages; + PRUint32 mNumPendingUnreadMessages; + PRUint32 mNumPendingTotalMessages; #endif #ifdef HAVE_CACHE @@ -327,12 +336,12 @@ public: msg_move_state *state); #endif - NS_IMETHOD CreateSubfolder(const char *leafNameFromUser, nsIMsgFolder **outFolder, PRInt32 *outPos); + NS_IMETHOD CreateSubfolder(const char *leafNameFromUser, nsIMsgFolder **outFolder, PRUint32 *outPos); NS_IMETHOD RemoveSubFolder (const nsIMsgFolder *which); NS_IMETHOD Delete (); NS_IMETHOD Rename (const char *newName); - NS_IMETHOD Adopt(const nsIMsgFolder *srcFolder, PRInt32 *outPos); + NS_IMETHOD Adopt(const nsIMsgFolder *srcFolder, PRUint32 *outPos); // this override pulls the value from the db NS_IMETHOD GetName(char** name); // Name of this folder (as presented to user). @@ -344,7 +353,7 @@ public: NS_IMETHOD UpdateSummaryTotals() ; - NS_IMETHOD GetExpungedBytesCount(PRInt32 *count); + NS_IMETHOD GetExpungedBytesCount(PRUint32 *count); NS_IMETHOD GetDeletable (PRBool *deletable); NS_IMETHOD GetCanCreateChildren (PRBool *canCreateChildren) ; NS_IMETHOD GetCanBeRenamed (PRBool *canBeRenamed); @@ -354,7 +363,7 @@ public: NS_IMETHOD GetRelativePathName (char **pathName); - NS_IMETHOD GetSizeOnDisk(PRInt32 size); + NS_IMETHOD GetSizeOnDisk(PRUint32 size); NS_IMETHOD GetUserName(char** userName); NS_IMETHOD GetHostName(char** hostName); @@ -368,7 +377,7 @@ public: protected: char* mPathName; - PRInt32 mExpungedBytes; + PRUint32 mExpungedBytes; PRBool mHaveReadNameFromDB; PRBool mGettingMail; }; diff --git a/mozilla/mailnews/news/src/nsNNTPHost.cpp b/mozilla/mailnews/news/src/nsNNTPHost.cpp index e0cfaf9e222..2d881bca1fb 100644 --- a/mozilla/mailnews/news/src/nsNNTPHost.cpp +++ b/mozilla/mailnews/news/src/nsNNTPHost.cpp @@ -767,7 +767,7 @@ nsNNTPHost::ProcessLine(char* line, PRUint32 line_size) } } else { - int depth; + PRUint32 depth; rv = m_hostinfo->GetDepth(&depth); if (NS_SUCCEEDED(rv))