From 9a9aae17fd6f5249c0ec20c232fe25ef8b2664d6 Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Fri, 26 Feb 1999 01:56:15 +0000 Subject: [PATCH] rev the XPIDL-generated headers, and update API calls to match includes dropping "const"ness from parameters some nsString routines were converted back to char* for the time being. also added nsIMsg.h, it seemed to be missing Also many fixes to get Unix building again. --- mailnews/base/public/Makefile.in | 1 + mailnews/base/public/nsIFolder.h | 90 ++++---- mailnews/base/public/nsIFolder.idl | 2 + mailnews/base/public/nsIMsg.h | 32 +++ mailnews/base/public/nsIMsgFolder.h | 194 ++++++++++-------- mailnews/base/public/nsIMsgFolder.idl | 49 ++--- mailnews/base/public/nsIMsgGroupRecord.h | 97 +++++---- mailnews/base/public/nsIMsgHost.h | 22 +- mailnews/base/src/nsMsgFolder.cpp | 44 ++-- mailnews/base/src/nsMsgFolder.h | 28 +-- mailnews/base/src/nsMsgImapMailFolder.cpp | 19 +- mailnews/compose/public/nsIMsgCompFields.h | 192 +++++++++-------- mailnews/compose/public/nsIMsgCompose.h | 30 ++- mailnews/compose/public/nsIMsgSend.h | 22 +- mailnews/compose/src/msgCompGlue.cpp | 4 +- mailnews/local/src/nsLocalMailFolder.cpp | 42 ++-- mailnews/local/src/nsLocalMailFolder.h | 12 +- mailnews/local/src/nsMSGFolderDataSource.cpp | 5 +- mailnews/local/src/nsPop3Protocol.cpp | 6 +- mailnews/local/src/nsPop3Sink.cpp | 6 +- mailnews/news/public/nsIMsgOfflineNewsState.h | 22 +- mailnews/news/public/nsINNTPArticleList.h | 16 ++ mailnews/news/public/nsINNTPCategory.h | 28 ++- .../news/public/nsINNTPCategoryContainer.h | 18 +- mailnews/news/public/nsINNTPHost.h | 136 ++++++------ mailnews/news/public/nsINNTPNewsgroup.h | 38 +++- mailnews/news/public/nsINNTPNewsgroupList.h | 36 +++- mailnews/news/public/nsINNTPNewsgroupPost.h | 70 ++++--- mailnews/news/src/nsNNTPHost.cpp | 194 ++++++++++-------- mailnews/news/src/nsNNTPNewsgroupPost.cpp | 12 +- mailnews/news/tests/nntp/.cvsignore | 3 + mailnews/news/tests/nsNNTPHostStub.cpp | 112 +++++----- .../news/tests/nsNNTPNewsgroupListStub.cpp | 8 +- 33 files changed, 946 insertions(+), 644 deletions(-) create mode 100644 mailnews/base/public/nsIMsg.h create mode 100644 mailnews/news/tests/nntp/.cvsignore diff --git a/mailnews/base/public/Makefile.in b/mailnews/base/public/Makefile.in index 2be540fdb48d..e65cea2c5a53 100644 --- a/mailnews/base/public/Makefile.in +++ b/mailnews/base/public/Makefile.in @@ -35,6 +35,7 @@ EXPORTS = \ nsMsgMessageFlags.h \ nsMsgLocalFolderHdrs.h \ nsMsgMD5.h \ + nsIMsg.h \ nsIMsgRFC822Parser.h \ nsIMsgHost.h \ nsIMsgGroupRecord.h \ diff --git a/mailnews/base/public/nsIFolder.h b/mailnews/base/public/nsIFolder.h index 1b2131e980cc..24673286643a 100644 --- a/mailnews/base/public/nsIFolder.h +++ b/mailnews/base/public/nsIFolder.h @@ -1,57 +1,61 @@ -/* -*- 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. +/* + * DO NOT EDIT. THIS FILE IS GENERATED FROM nsIFolder.idl */ -#ifndef nsIFolder_h__ -#define nsIFolder_h__ +#ifndef __gen_nsIFolder_h__ +#define __gen_nsIFolder_h__ -#include "nsICollection.h" -#include "nsString.h" +#include "nsISupports.h" /* interface nsISupports */ +#include "nsICollection.h" /* interface nsICollection */ +#include "nsIEnumerator.h" /* interface nsIEnumerator */ +#include "nsID.h" /* interface nsID */ -// XXX regenerate this iid -- I was on a machine w/o an network card -#define NS_IFOLDER_IID \ -{ /* fc232e90-c1f5-11d2-8612-000000000000 */ \ - 0xfc232e90, \ - 0xc1f5, \ - 0x11d2, \ - {0x86, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} \ -} +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" + + +/* starting interface nsIFolder */ + +/* {361c89b0-c481-11d2-8614-000000000001} */ +#define NS_IFOLDER_IID_STR "361c89b0-c481-11d2-8614-000000000001" +#define NS_IFOLDER_IID \ + {0x361c89b0, 0xc481, 0x11d2, \ + { 0x86, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }} -/** - * nsIFolder: Call Enumerate to get the sub-folders and folder items (the children). - */ class nsIFolder : public nsICollection { -public: + public: + static const nsIID& IID() { + static nsIID iid = NS_IFOLDER_IID; + return iid; + } - static const nsIID& IID(void) { static nsIID iid = NS_IFOLDER_IID; return iid; } + /* readonly attribute string URI; */ + NS_IMETHOD GetURI(char * *aURI) = 0; - // unique identifier for folder: - NS_IMETHOD GetURI(const char* *name) = 0; + /* attribute string name; */ + NS_IMETHOD GetName(char * *aName) = 0; + NS_IMETHOD SetName(char * aName) = 0; - NS_IMETHOD GetName(nsString& name) = 0; - NS_IMETHOD SetName(const nsString& name) = 0; + /* nsISupports GetChildNamed (in string name); */ + NS_IMETHOD GetChildNamed(char *name, nsISupports **_retval) = 0; - NS_IMETHOD GetChildNamed(const nsString& name, nsISupports* *result) = 0; + /* nsIFolder GetParent (); */ + NS_IMETHOD GetParent(nsIFolder **_retval) = 0; - // XXX does this make sense for virtual folders? - NS_IMETHOD GetParent(nsIFolder* *parent) = 0; + /* nsIEnumerator GetSubFolders (); */ + NS_IMETHOD GetSubFolders(nsIEnumerator **_retval) = 0; - // subset of Enumerate such that each element is an nsIFolder - NS_IMETHOD GetSubFolders(nsIEnumerator* *result) = 0; +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIFolder *priv); +#endif }; -#endif // nsIFolder_h__ +#endif /* __gen_nsIFolder_h__ */ diff --git a/mailnews/base/public/nsIFolder.idl b/mailnews/base/public/nsIFolder.idl index 41a9ae6ab40b..5b5c1675ccbc 100644 --- a/mailnews/base/public/nsIFolder.idl +++ b/mailnews/base/public/nsIFolder.idl @@ -26,5 +26,7 @@ interface nsIFolder : nsICollection { nsISupports GetChildNamed(in string name); nsIFolder GetParent(); + + nsIEnumerator GetSubFolders(); }; diff --git a/mailnews/base/public/nsIMsg.h b/mailnews/base/public/nsIMsg.h new file mode 100644 index 000000000000..8e519f20a56d --- /dev/null +++ b/mailnews/base/public/nsIMsg.h @@ -0,0 +1,32 @@ +/* + * DO NOT EDIT. THIS FILE IS GENERATED FROM nsIMsg.idl + */ + +#ifndef __gen_nsIMsg_h__ +#define __gen_nsIMsg_h__ + +#include "nsISupports.h" /* interface nsISupports */ +#include "nsID.h" /* interface nsID */ + +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" + + +/* starting interface nsIMsg */ +class nsIMsg : public nsISupports { + public: + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIMsg *priv); +#endif +}; + +#endif /* __gen_nsIMsg_h__ */ diff --git a/mailnews/base/public/nsIMsgFolder.h b/mailnews/base/public/nsIMsgFolder.h index 181850d67222..b75104751134 100644 --- a/mailnews/base/public/nsIMsgFolder.h +++ b/mailnews/base/public/nsIMsgFolder.h @@ -5,11 +5,26 @@ #ifndef __gen_nsIMsgFolder_h__ #define __gen_nsIMsgFolder_h__ -#include "nsIFolder.h" +#include "nsISupports.h" /* interface nsISupports */ +#include "nsISupportsArray.h" /* interface nsISupportsArray */ +#include "nsICollection.h" /* interface nsICollection */ +#include "nsIMsg.h" /* interface nsIMsg */ +#include "nsIEnumerator.h" /* interface nsIEnumerator */ +#include "nsID.h" /* interface nsID */ +#include "nsIFolder.h" /* interface nsIFolder */ + +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" + +#include "nsFileSpec.h" -class nsISupportsArray; -class nsIMessage; -class nsNativeFileSpec; /* starting interface nsIMsgFolder */ @@ -22,161 +37,169 @@ class nsNativeFileSpec; class nsIMsgFolder : public nsIFolder { public: static const nsIID& IID() { - static nsIID iid = NS_IMSGFOLDER_IID; + static nsIID iid = NS_IMSGFOLDER_IID; return iid; } + /* void AddUnique (in nsISupports element); */ + NS_IMETHOD AddUnique(nsISupports *element) = 0; - // XXX should these 2 go on nsIFolder or nsICollection? - NS_IMETHOD AddUnique(nsISupports* element) = 0; - NS_IMETHOD ReplaceElement(nsISupports* element, nsISupports* newElement) = 0; + /* void ReplaceElement (in nsISupports element, in nsISupports newElement); */ + NS_IMETHOD ReplaceElement(nsISupports *element, nsISupports *newElement) = 0; - NS_IMETHOD GetVisibleSubFolders(nsIEnumerator* *result) = 0; + /* nsIEnumerator GetMessages (); */ + NS_IMETHOD GetMessages(nsIEnumerator **_retval) = 0; - // subset of GetElements such that each element is an nsIMessage - NS_IMETHOD GetMessages(nsIEnumerator* *result) = 0; + /* nsIEnumerator GetVisibleSubFolders (); */ + NS_IMETHOD GetVisibleSubFolders(nsIEnumerator **_retval) = 0; - NS_IMETHOD GetPrettyName(nsString& name) = 0; - NS_IMETHOD SetPrettyName(const nsString& name) = 0; + /* attribute string prettyName; */ + NS_IMETHOD GetPrettyName(char * *aPrettyName) = 0; + NS_IMETHOD SetPrettyName(char * aPrettyName) = 0; - /* */ - NS_IMETHOD GetPrettiestName(nsString& aPrettiestName) = 0; + /* readonly attribute string prettiestName; */ + NS_IMETHOD GetPrettiestName(char * *aPrettiestName) = 0; - /* */ + /* string BuildFolderURL (); */ NS_IMETHOD BuildFolderURL(char **_retval) = 0; - /* */ + /* readonly attribute boolean deleteIsMoveToTrash; */ NS_IMETHOD GetDeleteIsMoveToTrash(PRBool *aDeleteIsMoveToTrash) = 0; - /* */ + /* readonly attribute boolean showDeletedMessages; */ NS_IMETHOD GetShowDeletedMessages(PRBool *aShowDeletedMessages) = 0; - /* */ + /* void OnCloseFolder (); */ NS_IMETHOD OnCloseFolder() = 0; - /* */ + /* void Delete (); */ NS_IMETHOD Delete() = 0; - /* */ + /* void PropagateDelete (inout nsIMsgFolder folder, in boolean deleteStorage); */ NS_IMETHOD PropagateDelete(nsIMsgFolder **folder, PRBool deleteStorage) = 0; - /* */ + /* void RecursiveDelete (in boolean deleteStorage); */ NS_IMETHOD RecursiveDelete(PRBool deleteStorage) = 0; - /* */ - NS_IMETHOD CreateSubfolder(const char *leafNameFromUser, nsIMsgFolder **outFolder, PRUint32 *outPos) = 0; + /* void CreateSubfolder (in string leafNameFromUser, out nsIMsgFolder outFolder, out unsigned long outPos); */ + NS_IMETHOD CreateSubfolder(char *leafNameFromUser, nsIMsgFolder **outFolder, PRUint32 *outPos) = 0; - /* */ - NS_IMETHOD Rename(const char *name) = 0; + /* void Rename (in string name); */ + NS_IMETHOD Rename(char *name) = 0; - /* */ - NS_IMETHOD Adopt(const nsIMsgFolder *srcFolder, PRUint32 *outPos) = 0; + /* void Adopt (in nsIMsgFolder srcFolder, out unsigned long outPos); */ + NS_IMETHOD Adopt(nsIMsgFolder *srcFolder, PRUint32 *outPos) = 0; - /* */ - NS_IMETHOD ContainsChildNamed(const char *name, PRBool *_retval) = 0; + /* boolean ContainsChildNamed (in string name); */ + NS_IMETHOD ContainsChildNamed(char *name, PRBool *_retval) = 0; - /* */ - NS_IMETHOD FindParentOf(const nsIMsgFolder *childFolder, nsIMsgFolder **_retval) = 0; + /* nsIMsgFolder FindParentOf (in nsIMsgFolder childFolder); */ + NS_IMETHOD FindParentOf(nsIMsgFolder *childFolder, nsIMsgFolder **_retval) = 0; - /* */ - NS_IMETHOD IsParentOf(const nsIMsgFolder *folder, PRBool deep, PRBool *_retval) = 0; + /* boolean IsParentOf (in nsIMsgFolder folder, in boolean deep); */ + NS_IMETHOD IsParentOf(nsIMsgFolder *folder, PRBool deep, PRBool *_retval) = 0; - /* */ - NS_IMETHOD GenerateUniqueSubfolderName(const char *prefix, const nsIMsgFolder *otherFolder, char **_retval) = 0; + /* string GenerateUniqueSubfolderName (in string prefix, in nsIMsgFolder otherFolder); */ + NS_IMETHOD GenerateUniqueSubfolderName(char *prefix, nsIMsgFolder *otherFolder, char **_retval) = 0; - /* */ + /* attribute unsigned long depth; */ NS_IMETHOD GetDepth(PRUint32 *aDepth) = 0; NS_IMETHOD SetDepth(PRUint32 aDepth) = 0; - /* */ + /* void UpdateSummaryTotals (); */ NS_IMETHOD UpdateSummaryTotals() = 0; - /* */ + /* void SummaryChanged (); */ NS_IMETHOD SummaryChanged() = 0; - /* */ + /* unsigned long GetNumUnread (in boolean deep); */ NS_IMETHOD GetNumUnread(PRBool deep, PRUint32 *_retval) = 0; - /* */ + /* unsigned long GetTotalMessages (in boolean deep); */ NS_IMETHOD GetTotalMessages(PRBool deep, PRUint32 *_retval) = 0; - /* */ + /* readonly attribute unsigned long expungedBytesCount; */ NS_IMETHOD GetExpungedBytesCount(PRUint32 *aExpungedBytesCount) = 0; - /* */ + /* readonly attribute boolean deletable; */ NS_IMETHOD GetDeletable(PRBool *aDeletable) = 0; - /* */ + /* readonly attribute boolean canCreateChildren; */ NS_IMETHOD GetCanCreateChildren(PRBool *aCanCreateChildren) = 0; - /* */ + /* readonly attribute boolean canBeRenamed; */ NS_IMETHOD GetCanBeRenamed(PRBool *aCanBeRenamed) = 0; - /* */ + /* readonly attribute boolean requiresCleanup; */ NS_IMETHOD GetRequiresCleanup(PRBool *aRequiresCleanup) = 0; - /* */ + /* void ClearRequiresCleanup (); */ NS_IMETHOD ClearRequiresCleanup() = 0; - /* */ + /* readonly attribute boolean knowsSearchNntpExtension; */ NS_IMETHOD GetKnowsSearchNntpExtension(PRBool *aKnowsSearchNntpExtension) = 0; - /* */ + /* readonly attribute boolean allowsPosting; */ NS_IMETHOD GetAllowsPosting(PRBool *aAllowsPosting) = 0; - /* */ + /* boolean DisplayRecipients (); */ NS_IMETHOD DisplayRecipients(PRBool *_retval) = 0; + /* void ReadDBFolderInfo (in boolean force); */ NS_IMETHOD ReadDBFolderInfo(PRBool force) = 0; - /* */ + /* readonly attribute string relativePathName; */ NS_IMETHOD GetRelativePathName(char * *aRelativePathName) = 0; - /* */ + /* readonly attribute unsigned long sizeOnDisk; */ NS_IMETHOD GetSizeOnDisk(PRUint32 *aSizeOnDisk) = 0; - /* */ - NS_IMETHOD RememberPassword(const char *password) = 0; + /* void RememberPassword (in string password); */ + NS_IMETHOD RememberPassword(char *password) = 0; - /* */ + /* string GetRememberedPassword (); */ NS_IMETHOD GetRememberedPassword(char **_retval) = 0; - /* */ + /* boolean UserNeedsToAuthenticateForFolder (in boolean displayOnly); */ NS_IMETHOD UserNeedsToAuthenticateForFolder(PRBool displayOnly, PRBool *_retval) = 0; - /* */ + /* string GetUsersName (); */ NS_IMETHOD GetUsersName(char **_retval) = 0; - /* */ + /* string GetHostName (); */ NS_IMETHOD GetHostName(char **_retval) = 0; - /* */ + /* void SetFlag (in unsigned long flag); */ NS_IMETHOD SetFlag(PRUint32 flag) = 0; - /* */ + /* void ClearFlag (in unsigned long flag); */ NS_IMETHOD ClearFlag(PRUint32 flag) = 0; - /* */ + /* boolean GetFlag (in unsigned long flag); */ NS_IMETHOD GetFlag(PRUint32 flag, PRBool *_retval) = 0; - /* */ + /* void ToggleFlag (in unsigned long flag); */ NS_IMETHOD ToggleFlag(PRUint32 flag) = 0; - /* */ + /* void OnFlagChange (in unsigned long flag); */ NS_IMETHOD OnFlagChange(PRUint32 flag) = 0; - /* */ + /* unsigned long GetFlags (); */ NS_IMETHOD GetFlags(PRUint32 *_retval) = 0; - /* */ + /* void GetFoldersWithFlag (in unsigned long flags, out nsIMsgFolder result, in unsigned long resultsize, out unsigned long numFolders); */ NS_IMETHOD GetFoldersWithFlag(PRUint32 flags, nsIMsgFolder **result, PRUint32 resultsize, PRUint32 *numFolders) = 0; - /* */ - NS_IMETHOD GetExpansionArray(const nsISupportsArray *expansionArray) = 0; + /* void GetExpansionArray (in nsISupportsArray expansionArray); */ + NS_IMETHOD GetExpansionArray(nsISupportsArray *expansionArray) = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIMsgFolder *priv); +#endif }; -//////////////////////////////////////////////////////////////////////////////// -/* starting interface nsIMsgMailFolder */ +/* starting interface nsIMsgLocalMailFolder */ /* {27D2DE40-BAF1-11d2-9578-00805F8AC615} */ #define NS_IMSGLOCALMAILFOLDER_IID_STR "27D2DE40-BAF1-11d2-9578-00805F8AC615" @@ -191,21 +214,19 @@ class nsIMsgLocalMailFolder : public nsISupports { return iid; } - /* */ - NS_IMETHOD GetPath(nsNativeFileSpec& aPathName) = 0; +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIMsgLocalMailFolder *priv); +#endif }; -//////////////////////////////////////////////////////////////////////////////// +/* starting interface nsIMsgImapMailFolder */ -/* {83ebf570-bfc6-11d2-8177-006008119d7a} */ -#define NS_IMSGIMAPMAILFOLDER_IID_STR "83ebf570-bfc6-11d2-8177-006008119d7a" -#define NS_IMSGIMAPMAILFOLDER_IID \ -{ /* 83ebf570-bfc6-11d2-8177-006008119d7a */ \ - 0x83ebf570, \ - 0xbfc6, \ - 0x11d2, \ - {0x81, 0x77, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \ -} +/* {FBFEBE79-C1DD-11d2-8A40-0060B0FC04D2} */ +#define NS_IMSGIMAPMAILFOLDER_IID_STR "FBFEBE79-C1DD-11d2-8A40-0060B0FC04D2" +#define NS_IMSGIMAPMAILFOLDER_IID \ + {0xFBFEBE79, 0xC1DD, 0x11d2, \ + { 0x8A, 0x40, 0x00, 0x60, 0xB0, 0xFC, 0x04, 0xD2 }} class nsIMsgImapMailFolder : public nsISupports { public: @@ -214,10 +235,13 @@ class nsIMsgImapMailFolder : public nsISupports { return iid; } - /* */ - NS_IMETHOD GetPathName(nsNativeFileSpec& aPathName) = 0; + /* readonly attribute nsNativeFileSpec pathName; */ + NS_IMETHOD GetPathName(nsNativeFileSpec* *aPathName) = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIMsgImapMailFolder *priv); +#endif }; -//////////////////////////////////////////////////////////////////////////////// - #endif /* __gen_nsIMsgFolder_h__ */ diff --git a/mailnews/base/public/nsIMsgFolder.idl b/mailnews/base/public/nsIMsgFolder.idl index 9acd0c9f68a3..7f4ac0cf7770 100644 --- a/mailnews/base/public/nsIMsgFolder.idl +++ b/mailnews/base/public/nsIMsgFolder.idl @@ -1,5 +1,3 @@ -XXX fix this to match the .h file - /* -*- 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 @@ -21,36 +19,31 @@ XXX fix this to match the .h file #include "nsISupportsArray.idl" #include "nsISupports.idl" #include "nsIMsg.idl" +#include "nsIFolder.idl" + +%{ C++ +#include "nsFileSpec.h" +%} + +native nsNativeFileSpec(nsNativeFileSpec*); [uuid(85e39ff0-b248-11d2-b7ef-00805f05ffa5)] -interface nsIMsgFolder : nsISupports { +interface nsIMsgFolder : nsIFolder { - readonly attribute string prettyName; - readonly attribute string name; - void SetName(in string name); - readonly attribute string prettiestName; + /* already exists in nsIFolder */ + /* readonly attribute string name; */ + /* void SetName(in string name); */ - string BuildFolderURL(); - // XXX should these 2 go on nsIFolder or nsICollection? + /* XXX should these 2 go on nsIFolder or nsICollection? */ void AddUnique(in nsISupports element); void ReplaceElement(in nsISupports element, in nsISupports newElement); - boolean HasSubFolders(); - unsigned long GetNumSubFolders() ; - unsigned long GetNumSubFoldersToDisplay(); - nsIMsgFolder GetSubFolder(in unsigned long which) ; - nsISupportsArray GetSubFolders(); - void AddSubFolder(in nsIMsgFolder folder); - void RemoveSubFolder(in nsIMsgFolder folder); - - boolean HasMessages(); - unsigned long GetNumMessages() ; - unsigned long GetNumMessagesToDisplay(); - nsIMsgFolder GetAMessage(in unsigned long which) ; - nsISupportsArray GetMessages(); - void AddMessage(in nsIMsg msg); - void RemoveMessage(in nsIMsg msg); + nsIEnumerator GetMessages(); + nsIEnumerator GetVisibleSubFolders(); + attribute string prettyName; + readonly attribute string prettiestName; + string BuildFolderURL(); readonly attribute boolean deleteIsMoveToTrash; readonly attribute boolean showDeletedMessages; @@ -67,7 +60,6 @@ interface nsIMsgFolder : nsISupports { void Adopt(in nsIMsgFolder srcFolder, out unsigned long outPos); boolean ContainsChildNamed(in string name); - nsIMsgFolder FindChildNamed(in string name); nsIMsgFolder FindParentOf(in nsIMsgFolder childFolder); boolean IsParentOf(in nsIMsgFolder folder, in boolean deep); @@ -104,9 +96,6 @@ interface nsIMsgFolder : nsISupports { string GetUsersName(); string GetHostName(); - void AddSubfolderIfUnique(in nsIMsgFolder newSubfolder); - void ReplaceSubfolder(in nsIMsgFolder oldFolder, - in nsIMsgFolder newFolder); void SetFlag(in unsigned long flag); void ClearFlag(in unsigned long flag); @@ -123,16 +112,16 @@ interface nsIMsgFolder : nsISupports { }; + [uuid(27D2DE40-BAF1-11d2-9578-00805F8AC615)] interface nsIMsgLocalMailFolder : nsISupports { - readonly attribute nsNativeFileSpec pathName; }; [uuid(FBFEBE79-C1DD-11d2-8A40-0060B0FC04D2)] interface nsIMsgImapMailFolder : nsISupports { - + readonly attribute nsNativeFileSpec pathName; }; diff --git a/mailnews/base/public/nsIMsgGroupRecord.h b/mailnews/base/public/nsIMsgGroupRecord.h index 657aa65177f2..3ee23c30acce 100644 --- a/mailnews/base/public/nsIMsgGroupRecord.h +++ b/mailnews/base/public/nsIMsgGroupRecord.h @@ -6,6 +6,17 @@ #define __gen_nsIMsgGroupRecord_h__ #include "nsISupports.h" /* interface nsISupports */ +#include "nsID.h" /* interface nsID */ + +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" /* starting interface nsIMsgGroupRecord */ @@ -17,110 +28,112 @@ { 0xb7, 0xf0, 0x00, 0x80, 0x5f, 0x05, 0xff, 0xa5 }} class nsIMsgGroupRecord : public nsISupports { - private: - void operator delete(void *); // NOT TO BE IMPLEMENTED - public: static const nsIID& IID() { static nsIID iid = NS_IMSGGROUPRECORD_IID; return iid; } - /* */ + /* void InitializeSibling (); */ NS_IMETHOD InitializeSibling() = 0; - /* */ - NS_IMETHOD GroupNameCompare(const char *name1, const char *name2, char delimeter, PRBool caseSensitive, PRInt16 *_retval) = 0; + /* short GroupNameCompare (in string name1, in string name2, in char delimeter, in boolean caseSensitive); */ + NS_IMETHOD GroupNameCompare(char *name1, char *name2, char delimeter, PRBool caseSensitive, PRInt16 *_retval) = 0; - /* */ - NS_IMETHOD FindDescendant(const char *name, nsIMsgGroupRecord **_retval) = 0; + /* nsIMsgGroupRecord FindDescendant (in string name); */ + NS_IMETHOD FindDescendant(char *name, nsIMsgGroupRecord **_retval) = 0; - /* */ + /* readonly attribute nsIMsgGroupRecord parent; */ NS_IMETHOD GetParent(nsIMsgGroupRecord * *aParent) = 0; - /* */ + /* readonly attribute nsIMsgGroupRecord children; */ NS_IMETHOD GetChildren(nsIMsgGroupRecord * *aChildren) = 0; - /* */ + /* readonly attribute nsIMsgGroupRecord sibling; */ NS_IMETHOD GetSibling(nsIMsgGroupRecord * *aSibling) = 0; - /* */ + /* nsIMsgGroupRecord GetSiblingOrAncestorSibling (); */ NS_IMETHOD GetSiblingOrAncestorSibling(nsIMsgGroupRecord **_retval) = 0; - /* */ + /* nsIMsgGroupRecord GetNextAlphabetic (); */ NS_IMETHOD GetNextAlphabetic(nsIMsgGroupRecord **_retval) = 0; - /* */ + /* nsIMsgGroupRecord GetNextAlphabeticNoCategories (); */ NS_IMETHOD GetNextAlphabeticNoCategories(nsIMsgGroupRecord **_retval) = 0; - /* */ + /* readonly attribute string partName; */ NS_IMETHOD GetPartName(char * *aPartName) = 0; - /* */ + /* readonly attribute string fullname; */ NS_IMETHOD GetFullname(char * *aFullname) = 0; - /* */ + /* attribute string prettyName; */ NS_IMETHOD GetPrettyName(char * *aPrettyName) = 0; NS_IMETHOD SetPrettyName(char * aPrettyName) = 0; - /* */ + /* readonly attribute long long addTime; */ NS_IMETHOD GetAddTime(PRInt64 *aAddTime) = 0; - /* */ + /* boolean IsCategory (); */ NS_IMETHOD IsCategory(PRBool *_retval) = 0; - /* */ - NS_IMETHOD IsIsCategoryContainer(PRBool *aIsIsCategoryContainer) = 0; + /* attribute boolean IsCategoryContainer; */ + NS_IMETHOD GetIsCategoryContainer(PRBool *aIsCategoryContainer) = 0; NS_IMETHOD SetIsCategoryContainer(PRBool aIsCategoryContainer) = 0; - /* */ + /* readonly attribute nsIMsgGroupRecord categoryContainer; */ NS_IMETHOD GetCategoryContainer(nsIMsgGroupRecord * *aCategoryContainer) = 0; - /* */ - NS_IMETHOD IsVirtual(PRBool *aIsVirtual) = 0; + /* attribute boolean virtual; */ + NS_IMETHOD GetVirtual(PRBool *aVirtual) = 0; NS_IMETHOD SetVirtual(PRBool aVirtual) = 0; - /* */ - NS_IMETHOD IsGroup(PRBool *aIsGroup) = 0; + /* attribute boolean group; */ + NS_IMETHOD GetGroup(PRBool *aGroup) = 0; NS_IMETHOD SetGroup(PRBool aGroup) = 0; - /* */ - NS_IMETHOD IsExpanded(PRBool *aIsExpanded) = 0; + /* attribute boolean expanded; */ + NS_IMETHOD GetExpanded(PRBool *aExpanded) = 0; NS_IMETHOD SetExpanded(PRBool aExpanded) = 0; - /* */ - NS_IMETHOD IsHtmlOk(PRBool *aIsHtmlOk) = 0; + /* attribute boolean htmlOk; */ + NS_IMETHOD GetHtmlOk(PRBool *aHtmlOk) = 0; NS_IMETHOD SetHtmlOk(PRBool aHtmlOk) = 0; - /* */ - NS_IMETHOD IsNeedsExtraInfo(PRBool *aIsNeedsExtraInfo) = 0; + /* attribute boolean needsExtraInfo; */ + NS_IMETHOD GetNeedsExtraInfo(PRBool *aNeedsExtraInfo) = 0; NS_IMETHOD SetNeedsExtraInfo(PRBool aNeedsExtraInfo) = 0; - /* */ - NS_IMETHOD IsOnServer(PRBool *aIsOnServer) = 0; + /* attribute boolean onServer; */ + NS_IMETHOD GetOnServer(PRBool *aOnServer) = 0; NS_IMETHOD SetOnServer(PRBool aOnServer) = 0; - /* */ + /* readonly attribute long uniqueID; */ NS_IMETHOD GetUniqueID(PRInt32 *aUniqueID) = 0; - /* */ + /* attribute long fileOffset; */ NS_IMETHOD GetFileOffset(PRInt32 *aFileOffset) = 0; NS_IMETHOD SetFileOffset(PRInt32 aFileOffset) = 0; - /* */ + /* readonly attribute long numKids; */ NS_IMETHOD GetNumKids(PRInt32 *aNumKids) = 0; - /* */ + /* readonly attribute string saveString; */ NS_IMETHOD GetSaveString(char * *aSaveString) = 0; - /* */ - NS_IMETHOD IsDirty(PRBool *aIsDirty) = 0; + /* readonly attribute boolean dirty; */ + NS_IMETHOD GetDirty(PRBool *aDirty) = 0; - /* */ + /* readonly attribute long depth; */ NS_IMETHOD GetDepth(PRInt32 *aDepth) = 0; - /* */ + /* readonly attribute char hierarchySeparator; */ NS_IMETHOD GetHierarchySeparator(char *aHierarchySeparator) = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIMsgGroupRecord *priv); +#endif }; #endif /* __gen_nsIMsgGroupRecord_h__ */ diff --git a/mailnews/base/public/nsIMsgHost.h b/mailnews/base/public/nsIMsgHost.h index be3e4943290e..7d4385ae03ea 100644 --- a/mailnews/base/public/nsIMsgHost.h +++ b/mailnews/base/public/nsIMsgHost.h @@ -6,6 +6,17 @@ #define __gen_nsIMsgHost_h__ #include "nsISupports.h" /* interface nsISupports */ +#include "nsID.h" /* interface nsID */ + +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" /* starting interface nsIMsgHost */ @@ -23,17 +34,22 @@ class nsIMsgHost : public nsISupports { return iid; } - /* */ + /* attribute string hostname; */ NS_IMETHOD GetHostname(char * *aHostname) = 0; NS_IMETHOD SetHostname(char * aHostname) = 0; - /* */ + /* attribute string uiName; */ NS_IMETHOD GetUiName(char * *aUiName) = 0; NS_IMETHOD SetUiName(char * aUiName) = 0; - /* */ + /* attribute long port; */ NS_IMETHOD GetPort(PRInt32 *aPort) = 0; NS_IMETHOD SetPort(PRInt32 aPort) = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIMsgHost *priv); +#endif }; #endif /* __gen_nsIMsgHost_h__ */ diff --git a/mailnews/base/src/nsMsgFolder.cpp b/mailnews/base/src/nsMsgFolder.cpp index b2cfa72d53a0..7a7fbba4862d 100644 --- a/mailnews/base/src/nsMsgFolder.cpp +++ b/mailnews/base/src/nsMsgFolder.cpp @@ -22,7 +22,7 @@ #include "nsMsgFolderFlags.h" #include "prprf.h" #include "nsMsgKeyArray.h" -#include "nsMsgDataBase.h" +#include "nsMsgDatabase.h" #include "nsDBFolderInfo.h" #include "nsISupportsArray.h" @@ -33,9 +33,11 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); nsMsgFolder::nsMsgFolder(const char* uri) - : nsRDFResource(uri), mFlags(0), mDepth(0), + : nsRDFResource(uri), mFlags(0), mNumUnreadMessages(-1), mNumTotalMessages(0), - mPrefFlags(0), mCsid(0) + mCsid(0), + mDepth(0), + mPrefFlags(0) { NS_INIT_REFCNT(); @@ -359,13 +361,15 @@ NS_IMETHODIMP nsMsgFolder::SaveMessages(nsMsgKeyArray *, const char *fileName, } #endif -NS_IMETHODIMP nsMsgFolder::GetPrettyName(nsString& name) +NS_IMETHODIMP nsMsgFolder::GetPrettyName(char ** name) { - name = mName; + char *cmName = mName.ToNewCString(); + if (name) *name = PL_strdup(cmName); + delete[] cmName; return NS_OK; } -NS_IMETHODIMP nsMsgFolder::SetPrettyName(const nsString& name) +NS_IMETHODIMP nsMsgFolder::SetPrettyName(char *name) { mName = name; return NS_OK; @@ -398,19 +402,21 @@ NS_IMETHODIMP nsMsgFolder::Clear(void) return mSubFolders->Clear(); } -NS_IMETHODIMP nsMsgFolder::GetName(nsString& name) +NS_IMETHODIMP nsMsgFolder::GetName(char **name) { - name = mName; + char *cmName = mName.ToNewCString(); + if (name) *name = PL_strdup(cmName); + delete[] cmName; return NS_OK; } -NS_IMETHODIMP nsMsgFolder::SetName(const nsString& name) +NS_IMETHODIMP nsMsgFolder::SetName(char * name) { mName = name; return NS_OK; } -NS_IMETHODIMP nsMsgFolder::GetChildNamed(const nsString& name, nsISupports* *result) +NS_IMETHODIMP nsMsgFolder::GetChildNamed(char* name, nsISupports* *result) { return NS_ERROR_NOT_IMPLEMENTED; } @@ -420,7 +426,7 @@ NS_IMETHODIMP nsMsgFolder::GetParent(nsIFolder* *parent) return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP nsMsgFolder::GetPrettiestName(nsString& name) +NS_IMETHODIMP nsMsgFolder::GetPrettiestName(char **name) { if (NS_SUCCEEDED(GetPrettyName(name))) return NS_OK; @@ -430,8 +436,8 @@ NS_IMETHODIMP nsMsgFolder::GetPrettiestName(nsString& name) static PRBool nsCanBeInFolderPane(nsISupports* element, void* data) { - nsIMsgFolder* subFolder = NS_STATIC_CAST(nsIMsgFolder*, element); #ifdef HAVE_PANE + nsIMsgFolder* subFolder = NS_STATIC_CAST(nsIMsgFolder*, element); return subFolder->CanBeInFolderPane(); #else return PR_TRUE; @@ -595,7 +601,7 @@ NS_IMETHODIMP nsMsgFolder::CreateSubfolder(const char *, nsIMsgFolder**, PRUint3 } -NS_IMETHODIMP nsMsgFolder::Rename(const char *name) +NS_IMETHODIMP nsMsgFolder::Rename(char *name) { nsresult status = NS_OK; status = SetName(name); @@ -615,7 +621,7 @@ NS_IMETHODIMP nsMsgFolder::Adopt(const nsIMsgFolder *srcFolder, PRUint32* outPos } -NS_IMETHODIMP nsMsgFolder::ContainsChildNamed(const char *name, PRBool* containsChild) +NS_IMETHODIMP nsMsgFolder::ContainsChildNamed(char *name, PRBool* containsChild) { nsIMsgFolder *child; @@ -634,7 +640,7 @@ NS_IMETHODIMP nsMsgFolder::ContainsChildNamed(const char *name, PRBool* contains return NS_ERROR_NULL_POINTER; } -NS_IMETHODIMP nsMsgFolder::FindParentOf(const nsIMsgFolder * aFolder, nsIMsgFolder ** aParent) +NS_IMETHODIMP nsMsgFolder::FindParentOf(nsIMsgFolder * aFolder, nsIMsgFolder ** aParent) { if(!aParent) return NS_ERROR_NULL_POINTER; @@ -678,7 +684,7 @@ NS_IMETHODIMP nsMsgFolder::FindParentOf(const nsIMsgFolder * aFolder, nsIMsgFold } -NS_IMETHODIMP nsMsgFolder::IsParentOf(const nsIMsgFolder *child, PRBool deep, PRBool *isParent) +NS_IMETHODIMP nsMsgFolder::IsParentOf(nsIMsgFolder *child, PRBool deep, PRBool *isParent) { if(!isParent) return NS_ERROR_NULL_POINTER; @@ -708,7 +714,7 @@ NS_IMETHODIMP nsMsgFolder::IsParentOf(const nsIMsgFolder *child, PRBool deep, PR } -NS_IMETHODIMP nsMsgFolder::GenerateUniqueSubfolderName(const char *prefix, const nsIMsgFolder *otherFolder, +NS_IMETHODIMP nsMsgFolder::GenerateUniqueSubfolderName(char *prefix, nsIMsgFolder *otherFolder, char **name) { if(!name) @@ -1002,7 +1008,7 @@ NS_IMETHODIMP nsMsgFolder::GetFoldersWithFlag(PRUint32 flags, nsIMsgFolder **res return NS_OK; } -NS_IMETHODIMP nsMsgFolder::GetExpansionArray(const nsISupportsArray *expansionArray) +NS_IMETHODIMP nsMsgFolder::GetExpansionArray(nsISupportsArray *expansionArray) { // the application of flags in GetExpansionArray is subtly different // than in GetFoldersWithFlag @@ -1163,7 +1169,7 @@ NS_IMETHODIMP nsMsgFolder::ReadDBFolderInfo(PRBool force) { nsDBFolderInfo *folderInfo; nsMsgDatabase *db; - if(result = NS_SUCCEEDED(GetDBFolderInfoAndDB(&folderInfo, &db))) + if((result = NS_SUCCEEDED(GetDBFolderInfoAndDB(&folderInfo, &db)))) { mIsCachable = TRUE; if (folderInfo) diff --git a/mailnews/base/src/nsMsgFolder.h b/mailnews/base/src/nsMsgFolder.h index 4d4cb163575e..a729482fdebc 100644 --- a/mailnews/base/src/nsMsgFolder.h +++ b/mailnews/base/src/nsMsgFolder.h @@ -30,7 +30,7 @@ #include "nsRDFResource.h" #include "nsIRDFResourceFactory.h" #include "nsDBFolderInfo.h" -#include "nsMsgDataBase.h" +#include "nsMsgDatabase.h" /* * MsgFolder @@ -52,10 +52,10 @@ public: NS_IMETHOD Clear(void); // nsIFolder methods: - NS_IMETHOD GetURI(const char* *name) { return nsRDFResource::GetValue(name); } - NS_IMETHOD GetName(nsString& name); - NS_IMETHOD SetName(const nsString& name); - NS_IMETHOD GetChildNamed(const nsString& name, nsISupports* *result); + NS_IMETHOD GetURI(char* *name) { return nsRDFResource::GetValue((const char**)&name); } + NS_IMETHOD GetName(char **name); + NS_IMETHOD SetName(char *name); + NS_IMETHOD GetChildNamed(char *name, nsISupports* *result); NS_IMETHOD GetParent(nsIFolder* *parent); NS_IMETHOD GetSubFolders(nsIEnumerator* *result); @@ -64,8 +64,8 @@ public: NS_IMETHOD ReplaceElement(nsISupports* element, nsISupports* newElement); NS_IMETHOD GetVisibleSubFolders(nsIEnumerator* *result); NS_IMETHOD GetMessages(nsIEnumerator* *result); - NS_IMETHOD GetPrettyName(nsString& name); - NS_IMETHOD SetPrettyName(const nsString& name); + NS_IMETHOD GetPrettyName(char ** name); + NS_IMETHOD SetPrettyName(char * name); #if 0 static nsresult GetRoot(nsIMsgFolder* *result); #endif @@ -121,7 +121,7 @@ public: NS_IMETHOD BuildFolderURL(char ** url); - NS_IMETHOD GetPrettiestName(nsString& name); + NS_IMETHOD GetPrettiestName(char ** name); #ifdef HAVE_ADMINURL NS_IMETHOD GetAdminUrl(MWContext *context, MSG_AdminURLType type); @@ -139,14 +139,14 @@ public: NS_IMETHOD CreateSubfolder(const char *leafNameFromuser, nsIMsgFolder** outFolder, PRUint32* outPos); - NS_IMETHOD Rename(const char *name); + NS_IMETHOD Rename(char *name); NS_IMETHOD Adopt(const nsIMsgFolder *srcFolder, PRUint32*); - NS_IMETHOD ContainsChildNamed(const char *name, PRBool *containsChild); - NS_IMETHOD FindParentOf(const nsIMsgFolder * aFolder, nsIMsgFolder ** aParent); - NS_IMETHOD IsParentOf(const nsIMsgFolder *, PRBool deep, PRBool *isParent); + NS_IMETHOD ContainsChildNamed(char *name, PRBool *containsChild); + NS_IMETHOD FindParentOf(nsIMsgFolder * aFolder, nsIMsgFolder ** aParent); + NS_IMETHOD IsParentOf(nsIMsgFolder *, PRBool deep, PRBool *isParent); - NS_IMETHOD GenerateUniqueSubfolderName(const char *prefix, const nsIMsgFolder *otherFolder, + NS_IMETHOD GenerateUniqueSubfolderName(char *prefix, nsIMsgFolder *otherFolder, char **name); NS_IMETHOD GetDepth(PRUint32 *depth); @@ -205,7 +205,7 @@ public: NS_IMETHOD GetFoldersWithFlag(PRUint32 flags, nsIMsgFolder** result, PRUint32 resultsize, PRUint32 *numFolders); - NS_IMETHOD GetExpansionArray(const nsISupportsArray *expansionArray); + NS_IMETHOD GetExpansionArray(nsISupportsArray *expansionArray); #ifdef HAVE_NET NS_IMETHOD EscapeMessageId(const char *messageId, const char **escapeMessageID); diff --git a/mailnews/base/src/nsMsgImapMailFolder.cpp b/mailnews/base/src/nsMsgImapMailFolder.cpp index 8c1588c6ed84..81cc8b03f667 100644 --- a/mailnews/base/src/nsMsgImapMailFolder.cpp +++ b/mailnews/base/src/nsMsgImapMailFolder.cpp @@ -117,28 +117,31 @@ nsMsgImapMailFolder::FindChildNamed(const char *name, nsIMsgFolder ** aChild) if (NS_SUCCEEDED(supports->QueryInterface(kISupportsIID, (void**)&folder))) { - nsString folderName; + char *folderName; - folder->GetName(folderName); + folder->GetName(&folderName); // IMAP INBOX is case insensitive - if (/* XXX type == FOLDER_IMAPSERVERCONTAINER && */ - !folderName.EqualsIgnoreCase("INBOX") - // !PL_strcasecmp(folderName, "INBOX") + if (// !folderName.EqualsIgnoreCase("INBOX") + folderName && + !PL_strcasecmp(folderName, "INBOX") ) { NS_RELEASE(supports); + PR_FREEIF(folderName); continue; } // For IMAP, folder names are case sensitive - if ( - !folderName.EqualsIgnoreCase(name) - // !PL_strcmp(folderName, name) + if (folderName && + //!folderName.EqualsIgnoreCase(name) + !PL_strcmp(folderName, name) ) { + PR_FREEIF(folderName); *aChild = folder; return NS_OK; } + PR_FREEIF(folderName); } NS_RELEASE(supports); } diff --git a/mailnews/compose/public/nsIMsgCompFields.h b/mailnews/compose/public/nsIMsgCompFields.h index cd02a7fd5d9b..68abaa1e3e47 100644 --- a/mailnews/compose/public/nsIMsgCompFields.h +++ b/mailnews/compose/public/nsIMsgCompFields.h @@ -1,11 +1,22 @@ /* - * DO NOT EDIT. THIS FILE IS GENERATED FROM nsImsgCompFields.idl + * DO NOT EDIT. THIS FILE IS GENERATED FROM nsIMsgCompFields.idl */ -#ifndef __gen_nsImsgCompFields_h__ -#define __gen_nsImsgCompFields_h__ +#ifndef __gen_nsIMsgCompFields_h__ +#define __gen_nsIMsgCompFields_h__ #include "nsISupports.h" /* interface nsISupports */ +#include "nsID.h" /* interface nsID */ + +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" /* starting interface nsIMsgCompFields */ @@ -23,179 +34,184 @@ class nsIMsgCompFields : public nsISupports { return iid; } - /* */ + /* void Test (); */ NS_IMETHOD Test() = 0; - /* */ - NS_IMETHOD Copy(const nsIMsgCompFields *pMsgCompFields) = 0; + /* void Copy (in nsIMsgCompFields pMsgCompFields); */ + NS_IMETHOD Copy(nsIMsgCompFields *pMsgCompFields) = 0; - /* */ - NS_IMETHOD SetHeader(PRInt32 header, const char *value, PRInt32 *_retval) = 0; + /* long SetHeader (in long header, in string value); */ + NS_IMETHOD SetHeader(PRInt32 header, char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetHeader (in long header); */ NS_IMETHOD GetHeader(PRInt32 header, char **_retval) = 0; - /* */ + /* long SetBoolHeader (in long header, in boolean bValue); */ NS_IMETHOD SetBoolHeader(PRInt32 header, PRBool bValue, PRInt32 *_retval) = 0; - /* */ + /* boolean GetBoolHeader (in long header); */ NS_IMETHOD GetBoolHeader(PRInt32 header, PRBool *_retval) = 0; - /* */ - NS_IMETHOD SetFrom(const char *value, PRInt32 *_retval) = 0; + /* long SetFrom (in string value); */ + NS_IMETHOD SetFrom(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetFrom (); */ NS_IMETHOD GetFrom(char **_retval) = 0; - /* */ - NS_IMETHOD SetReplyTo(const char *value, PRInt32 *_retval) = 0; + /* long SetReplyTo (in string value); */ + NS_IMETHOD SetReplyTo(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetReplyTo (); */ NS_IMETHOD GetReplyTo(char **_retval) = 0; - /* */ - NS_IMETHOD SetTo(const char *value, PRInt32 *_retval) = 0; + /* long SetTo (in string value); */ + NS_IMETHOD SetTo(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetTo (); */ NS_IMETHOD GetTo(char **_retval) = 0; - /* */ - NS_IMETHOD SetCc(const char *value, PRInt32 *_retval) = 0; + /* long SetCc (in string value); */ + NS_IMETHOD SetCc(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetCc (); */ NS_IMETHOD GetCc(char **_retval) = 0; - /* */ - NS_IMETHOD SetBcc(const char *value, PRInt32 *_retval) = 0; + /* long SetBcc (in string value); */ + NS_IMETHOD SetBcc(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetBcc (); */ NS_IMETHOD GetBcc(char **_retval) = 0; - /* */ - NS_IMETHOD SetFcc(const char *value, PRInt32 *_retval) = 0; + /* long SetFcc (in string value); */ + NS_IMETHOD SetFcc(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetFcc (); */ NS_IMETHOD GetFcc(char **_retval) = 0; - /* */ - NS_IMETHOD SetNewsFcc(const char *value, PRInt32 *_retval) = 0; + /* long SetNewsFcc (in string value); */ + NS_IMETHOD SetNewsFcc(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetNewsFcc (); */ NS_IMETHOD GetNewsFcc(char **_retval) = 0; - /* */ - NS_IMETHOD SetNewsBcc(const char *value, PRInt32 *_retval) = 0; + /* long SetNewsBcc (in string value); */ + NS_IMETHOD SetNewsBcc(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetNewsBcc (); */ NS_IMETHOD GetNewsBcc(char **_retval) = 0; - /* */ - NS_IMETHOD SetNewsgroups(const char *value, PRInt32 *_retval) = 0; + /* long SetNewsgroups (in string value); */ + NS_IMETHOD SetNewsgroups(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetNewsgroups (); */ NS_IMETHOD GetNewsgroups(char **_retval) = 0; - /* */ - NS_IMETHOD SetFollowupTo(const char *value, PRInt32 *_retval) = 0; + /* long SetFollowupTo (in string value); */ + NS_IMETHOD SetFollowupTo(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetFollowupTo (); */ NS_IMETHOD GetFollowupTo(char **_retval) = 0; - /* */ - NS_IMETHOD SetSubject(const char *value, PRInt32 *_retval) = 0; + /* long SetSubject (in string value); */ + NS_IMETHOD SetSubject(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetSubject (); */ NS_IMETHOD GetSubject(char **_retval) = 0; - /* */ - NS_IMETHOD SetAttachments(const char *value, PRInt32 *_retval) = 0; + /* long SetAttachments (in string value); */ + NS_IMETHOD SetAttachments(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetAttachments (); */ NS_IMETHOD GetAttachments(char **_retval) = 0; - /* */ - NS_IMETHOD SetOrganization(const char *value, PRInt32 *_retval) = 0; + /* long SetOrganization (in string value); */ + NS_IMETHOD SetOrganization(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetOrganization (); */ NS_IMETHOD GetOrganization(char **_retval) = 0; - /* */ - NS_IMETHOD SetReferences(const char *value, PRInt32 *_retval) = 0; + /* long SetReferences (in string value); */ + NS_IMETHOD SetReferences(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetReferences (); */ NS_IMETHOD GetReferences(char **_retval) = 0; - /* */ - NS_IMETHOD SetOtherRandomHeaders(const char *value, PRInt32 *_retval) = 0; + /* long SetOtherRandomHeaders (in string value); */ + NS_IMETHOD SetOtherRandomHeaders(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetOtherRandomHeaders (); */ NS_IMETHOD GetOtherRandomHeaders(char **_retval) = 0; - /* */ - NS_IMETHOD SetNewspostUrl(const char *value, PRInt32 *_retval) = 0; + /* long SetNewspostUrl (in string value); */ + NS_IMETHOD SetNewspostUrl(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetNewspostUrl (); */ NS_IMETHOD GetNewspostUrl(char **_retval) = 0; - /* */ - NS_IMETHOD SetDefaultBody(const char *value, PRInt32 *_retval) = 0; + /* long SetDefaultBody (in string value); */ + NS_IMETHOD SetDefaultBody(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetDefaultBody (); */ NS_IMETHOD GetDefaultBody(char **_retval) = 0; - /* */ - NS_IMETHOD SetPriority(const char *value, PRInt32 *_retval) = 0; + /* long SetPriority (in string value); */ + NS_IMETHOD SetPriority(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetPriority (); */ NS_IMETHOD GetPriority(char **_retval) = 0; - /* */ - NS_IMETHOD SetMessageEncoding(const char *value, PRInt32 *_retval) = 0; + /* long SetMessageEncoding (in string value); */ + NS_IMETHOD SetMessageEncoding(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetMessageEncoding (); */ NS_IMETHOD GetMessageEncoding(char **_retval) = 0; - /* */ - NS_IMETHOD SetCharacterSet(const char *value, PRInt32 *_retval) = 0; + /* long SetCharacterSet (in string value); */ + NS_IMETHOD SetCharacterSet(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetCharacterSet (); */ NS_IMETHOD GetCharacterSet(char **_retval) = 0; - /* */ - NS_IMETHOD SetMessageId(const char *value, PRInt32 *_retval) = 0; + /* long SetMessageId (in string value); */ + NS_IMETHOD SetMessageId(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetMessageId (); */ NS_IMETHOD GetMessageId(char **_retval) = 0; - /* */ - NS_IMETHOD SetHTMLPart(const char *value, PRInt32 *_retval) = 0; + /* long SetHTMLPart (in string value); */ + NS_IMETHOD SetHTMLPart(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetHTMLPart (); */ NS_IMETHOD GetHTMLPart(char **_retval) = 0; - /* */ - NS_IMETHOD SetTemplateName(const char *value, PRInt32 *_retval) = 0; + /* long SetTemplateName (in string value); */ + NS_IMETHOD SetTemplateName(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetTemplateName (); */ NS_IMETHOD GetTemplateName(char **_retval) = 0; - /* */ + /* long SetReturnReceipt (in boolean value); */ NS_IMETHOD SetReturnReceipt(PRBool value, PRInt32 *_retval) = 0; - /* */ + /* boolean GetReturnReceipt (); */ NS_IMETHOD GetReturnReceipt(PRBool *_retval) = 0; - /* */ + /* long SetAttachVCard (in boolean value); */ NS_IMETHOD SetAttachVCard(PRBool value, PRInt32 *_retval) = 0; - /* */ + /* boolean GetAttachVCard (); */ NS_IMETHOD GetAttachVCard(PRBool *_retval) = 0; - /* */ - NS_IMETHOD SetBody(const char *value, PRInt32 *_retval) = 0; + /* long SetBody (in string value); */ + NS_IMETHOD SetBody(char *value, PRInt32 *_retval) = 0; - /* */ + /* string GetBody (); */ NS_IMETHOD GetBody(char **_retval) = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIMsgCompFields *priv); +#endif }; -#endif /* __gen_nsImsgCompFields_h__ */ +#endif /* __gen_nsIMsgCompFields_h__ */ diff --git a/mailnews/compose/public/nsIMsgCompose.h b/mailnews/compose/public/nsIMsgCompose.h index 8121ab90b03c..ad6915b4ffc9 100644 --- a/mailnews/compose/public/nsIMsgCompose.h +++ b/mailnews/compose/public/nsIMsgCompose.h @@ -7,6 +7,17 @@ #include "nsISupports.h" /* interface nsISupports */ #include "nsIMsgCompFields.h" /* interface nsIMsgCompFields */ +#include "nsID.h" /* interface nsID */ + +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" /* starting interface nsIMsgCompose */ @@ -24,14 +35,25 @@ class nsIMsgCompose : public nsISupports { return iid; } + /* void Test (); */ NS_IMETHOD Test() = 0; -/* - NS_IMETHOD CreateAndInit(PRInt32 a_context, PRInt32 old_context, PRInt32 prefs, const nsIMsgCompFields *initfields, PRInt32 master) = 0; + /* void CreateAndInit (in long a_context, in long old_context, in long prefs, in nsIMsgCompFields initfields, in long master); */ + NS_IMETHOD CreateAndInit(PRInt32 a_context, PRInt32 old_context, PRInt32 prefs, nsIMsgCompFields *initfields, PRInt32 master) = 0; + + /* void Create (in long a_context, in long prefs, in long master); */ NS_IMETHOD Create(PRInt32 a_context, PRInt32 prefs, PRInt32 master) = 0; - NS_IMETHOD Initialize(PRInt32 old_context, const nsIMsgCompFields *initfields) = 0; + + /* void Initialize (in long old_context, in nsIMsgCompFields initfields); */ + NS_IMETHOD Initialize(PRInt32 old_context, nsIMsgCompFields *initfields) = 0; + + /* void Dispose (); */ NS_IMETHOD Dispose() = 0; -*/ + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIMsgCompose *priv); +#endif }; #endif /* __gen_nsIMsgCompose_h__ */ diff --git a/mailnews/compose/public/nsIMsgSend.h b/mailnews/compose/public/nsIMsgSend.h index 31b77abf6631..78f321f17ee9 100644 --- a/mailnews/compose/public/nsIMsgSend.h +++ b/mailnews/compose/public/nsIMsgSend.h @@ -7,6 +7,17 @@ #include "nsISupports.h" /* interface nsISupports */ #include "nsIMsgCompFields.h" /* interface nsIMsgCompFields */ +#include "nsID.h" /* interface nsID */ + +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" /* starting interface nsIMsgSend */ @@ -24,11 +35,16 @@ class nsIMsgSend : public nsISupports { return iid; } - /* */ + /* void Test (); */ NS_IMETHOD Test() = 0; - /* */ - NS_IMETHOD SendMessage(const nsIMsgCompFields *fields) = 0; + /* void SendMessage (in nsIMsgCompFields fields); */ + NS_IMETHOD SendMessage(nsIMsgCompFields *fields) = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIMsgSend *priv); +#endif }; #endif /* __gen_nsIMsgSend_h__ */ diff --git a/mailnews/compose/src/msgCompGlue.cpp b/mailnews/compose/src/msgCompGlue.cpp index 8054cb8eab71..c0dfb6906b07 100644 --- a/mailnews/compose/src/msgCompGlue.cpp +++ b/mailnews/compose/src/msgCompGlue.cpp @@ -23,7 +23,7 @@ URL_Struct * NET_CreateURLStruct (const char *, NET_ReloadMethod) {return NULL; char * NET_UnEscape (char * ) {return NULL;} char * NET_EscapeHTML(const char * string) {return NULL;} char * NET_ParseURL (const char *, int ) {return NULL;} -int NET_URL_Type (CONST char *) {return NULL;} +int NET_URL_Type (const char *) {return NULL;} XP_Bool NET_IsLocalFileURL(char *address) {return PR_TRUE;} char * NET_Escape (const char * str, int mask) {return PL_strdup(str);} int NET_InterruptWindow(MWContext * window_id) {return 0;} @@ -38,7 +38,7 @@ char * XP_StripLine (char *) {return NULL;} XP_File XP_FileOpen (const char* name, XP_FileType type, const XP_FilePerm permissions) {return NULL;} int XP_Stat(const char * name, XP_StatStruct * outStat, XP_FileType type) {return 0;} int XP_FileTruncate(const char* name, XP_FileType type, int32 length) {return 0;} -char * XP_AppVersion = "5.0a0"; +const char * XP_AppVersion = "5.0a0"; XP_BEGIN_PROTOS int XP_LocalZoneOffset() {return -480;} XP_END_PROTOS Bool XP_IsContextBusy(MWContext * context) {return PR_FALSE;} diff --git a/mailnews/local/src/nsLocalMailFolder.cpp b/mailnews/local/src/nsLocalMailFolder.cpp index 3033eaf17322..c0a40bedd3a6 100644 --- a/mailnews/local/src/nsLocalMailFolder.cpp +++ b/mailnews/local/src/nsLocalMailFolder.cpp @@ -26,7 +26,7 @@ #include "nsIPref.h" #include "nsIServiceManager.h" #include "nsIEnumerator.h" -#include "nsMailDataBase.h" +#include "nsMailDatabase.h" // we need this because of an egcs 1.0 (and possibly gcc) compiler bug // that doesn't allow you to call ::nsISupports::IID() inside of a class @@ -50,7 +50,7 @@ static const char kRootPrefix[] = "mailbox:/"; static const char kMsgRootFolderPref[] = "mailnews.rootFolder"; static nsresult -nsURI2Path(const char* uriStr, nsNativeFileSpec& pathResult) +nsURI2Path(char* uriStr, nsNativeFileSpec& pathResult) { nsAutoString path; nsAutoString uri = uriStr; @@ -125,7 +125,7 @@ nsPath2URI(nsNativeFileSpec& path, const char* *uri) } static nsresult -nsURI2Name(const char* uriStr, nsString& name) +nsURI2Name(char* uriStr, nsString& name) { nsAutoString uri = uriStr; if (uri.Find(kRootPrefix) != 0) // if doesn't start with kRootPrefix @@ -207,7 +207,8 @@ nsMsgLocalMailFolder::CreateSubFolders(void) nsNativeFileSpec path; rv = GetPath(path); if (NS_FAILED(rv)) return rv; - for (nsDirectoryIterator dir(path); dir; dir++) { + + for (nsDirectoryIterator dir(path); (const nsFileSpec&)dir; dir++) { nsNativeFileSpec currentFolderPath = (nsNativeFileSpec&)dir; #if 0 if (currentFolderName) @@ -343,15 +344,16 @@ NS_IMETHODIMP nsMsgLocalMailFolder::BuildFolderURL(char **url) if(!url) return NS_ERROR_NULL_POINTER; - nsNativeFileSpec path; + nsFileSpec path; nsresult rv = GetPath(path); if (NS_FAILED(rv)) return rv; - *url = PR_smprintf("%s%s", urlScheme, path); + const char *pathName = path; + *url = PR_smprintf("%s%s", urlScheme, pathName); return NS_OK; } -NS_IMETHODIMP nsMsgLocalMailFolder::CreateSubfolder(const char *leafNameFromUser, +NS_IMETHODIMP nsMsgLocalMailFolder::CreateSubfolder(char *leafNameFromUser, nsIMsgFolder **outFolder, PRUint32 *outPos) { @@ -454,7 +456,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::CreateSubfolder(const char *leafNameFromUser return NS_OK; } -NS_IMETHODIMP nsMsgLocalMailFolder::RemoveSubFolder(const nsIMsgFolder *which) +NS_IMETHODIMP nsMsgLocalMailFolder::RemoveSubFolder(nsIMsgFolder *which) { #if 0 // Let the base class do list management @@ -501,7 +503,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Delete() return NS_OK; } -NS_IMETHODIMP nsMsgLocalMailFolder::Rename (const char *newName) +NS_IMETHODIMP nsMsgLocalMailFolder::Rename (char *newName) { #ifdef HAVE_PORT // change the leaf name (stored separately) @@ -572,7 +574,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Rename (const char *newName) return NS_OK; } -NS_IMETHODIMP nsMsgLocalMailFolder::Adopt(const nsIMsgFolder *srcFolder, PRUint32 *outPos) +NS_IMETHODIMP nsMsgLocalMailFolder::Adopt(nsIMsgFolder *srcFolder, PRUint32 *outPos) { #ifdef HAVE_PORT nsresult err = NS_OK; @@ -641,14 +643,16 @@ nsMsgLocalMailFolder::GetChildNamed(nsString& name, nsISupports ** aChild) if(folder) NS_RELEASE(folder); if(NS_SUCCEEDED(supports->QueryInterface(kISupportsIID, (void**)&folder))) { - nsAutoString folderName; + char *folderName; - folder->GetName(folderName); + folder->GetName(&folderName); // case-insensitive compare is probably LCD across OS filesystems - if (!name.EqualsIgnoreCase(folderName)) { + if (folderName && !name.EqualsIgnoreCase(folderName)) { *aChild = folder; + PR_FREEIF(folderName); return NS_OK; } + PR_FREEIF(folderName); } NS_RELEASE(supports); } @@ -686,8 +690,14 @@ NS_IMETHODIMP nsMsgLocalMailFolder::GetPrettyName(nsString& prettyName) // override the name here to say "Local Mail" prettyName = PL_strdup("Local Mail"); } - else - return nsMsgFolder::GetPrettyName(prettyName); + else { + nsresult rv = NS_ERROR_NULL_POINTER; + char *pName = prettyName.ToNewCString(); + if (pName) + rv = nsMsgFolder::GetPrettyName(&pName); + delete[] pName; + return rv; + } return NS_OK; } @@ -860,7 +870,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::UserNeedsToAuthenticateForFolder(PRBool disp return NS_OK; } -NS_IMETHODIMP nsMsgLocalMailFolder::RememberPassword(const char *password) +NS_IMETHODIMP nsMsgLocalMailFolder::RememberPassword(char *password) { #ifdef HAVE_DB MailDB *mailDb = NULL; diff --git a/mailnews/local/src/nsLocalMailFolder.h b/mailnews/local/src/nsLocalMailFolder.h index 10d8ed09dba6..a5c20494c39f 100644 --- a/mailnews/local/src/nsLocalMailFolder.h +++ b/mailnews/local/src/nsLocalMailFolder.h @@ -26,7 +26,7 @@ #define nsMsgLocalMailFolder_h__ #include "nsMsgFolder.h" /* include the interface we are going to support */ -#include "nsMailDataBase.h" +#include "nsMailDatabase.h" #include "nsFileSpec.h" class nsMsgLocalMailFolder : public nsMsgFolder, public nsIMsgLocalMailFolder @@ -68,12 +68,12 @@ public: msg_move_state *state); #endif - NS_IMETHOD CreateSubfolder(const char *leafNameFromUser, nsIMsgFolder **outFolder, PRUint32 *outPos); + NS_IMETHOD CreateSubfolder(char *leafNameFromUser, nsIMsgFolder **outFolder, PRUint32 *outPos); - NS_IMETHOD RemoveSubFolder (const nsIMsgFolder *which); + NS_IMETHOD RemoveSubFolder (nsIMsgFolder *which); NS_IMETHOD Delete (); - NS_IMETHOD Rename (const char *newName); - NS_IMETHOD Adopt(const nsIMsgFolder *srcFolder, PRUint32 *outPos); + NS_IMETHOD Rename (char *newName); + NS_IMETHOD Adopt(nsIMsgFolder *srcFolder, PRUint32 *outPos); NS_IMETHOD GetChildNamed(nsString& name, nsISupports ** aChild); @@ -96,7 +96,7 @@ public: NS_IMETHOD GetUsersName(char** userName); NS_IMETHOD GetHostName(char** hostName); NS_IMETHOD UserNeedsToAuthenticateForFolder(PRBool displayOnly, PRBool *authenticate); - NS_IMETHOD RememberPassword(const char *password); + NS_IMETHOD RememberPassword(char *password); NS_IMETHOD GetRememberedPassword(char ** password); virtual nsresult GetDBFolderInfoAndDB(nsDBFolderInfo **folderInfo, nsMsgDatabase **db); diff --git a/mailnews/local/src/nsMSGFolderDataSource.cpp b/mailnews/local/src/nsMSGFolderDataSource.cpp index 52f7f896e7d9..42b91b413835 100644 --- a/mailnews/local/src/nsMSGFolderDataSource.cpp +++ b/mailnews/local/src/nsMSGFolderDataSource.cpp @@ -259,9 +259,10 @@ NS_IMETHODIMP nsMSGFolderDataSource::GetTarget(nsIRDFResource* source, nsresult rv; if (peq(kNC_Name, property)) { - nsString name; - rv = folder->GetName(name); + char *name; + rv = folder->GetName(&name); createNode(name, target); + PR_FREEIF(name); } else { rv = NS_ERROR_RDF_NO_VALUE; diff --git a/mailnews/local/src/nsPop3Protocol.cpp b/mailnews/local/src/nsPop3Protocol.cpp index d46ede2358aa..78d431253d55 100644 --- a/mailnews/local/src/nsPop3Protocol.cpp +++ b/mailnews/local/src/nsPop3Protocol.cpp @@ -224,7 +224,8 @@ net_pop3_load_state(const char* searchhost, } } } - fileStream.close(); + // new API - closes when it goes out of scope? + // fileStream.close(); PR_Free(buf); } @@ -299,7 +300,8 @@ net_pop3_write_state(Pop3UidlHost* host, const char* mailDirectory) net_pop3_write_mapper, &outFileStream); } } - outFileStream.close(); + // new API - closes when it goes out of scope? + // outFileStream.close(); } /* diff --git a/mailnews/local/src/nsPop3Sink.cpp b/mailnews/local/src/nsPop3Sink.cpp index 18fa15c5cd7f..2682be9a2b7d 100644 --- a/mailnews/local/src/nsPop3Sink.cpp +++ b/mailnews/local/src/nsPop3Sink.cpp @@ -143,7 +143,8 @@ nsPop3Sink::EndMailDelivery() { if (m_outFileStream) { - m_outFileStream->close(); + // new API - closes when it gets deleted? + // m_outFileStream->close(); delete m_outFileStream; m_outFileStream = 0; } @@ -164,7 +165,8 @@ nsPop3Sink::AbortMailDelivery() { if (m_outFileStream) { - m_outFileStream->close(); + // new API - closes when it gets deleted? + // m_outFileStream->close(); delete m_outFileStream; m_outFileStream = 0; } diff --git a/mailnews/news/public/nsIMsgOfflineNewsState.h b/mailnews/news/public/nsIMsgOfflineNewsState.h index ee308a7bf960..972feb6206f4 100644 --- a/mailnews/news/public/nsIMsgOfflineNewsState.h +++ b/mailnews/news/public/nsIMsgOfflineNewsState.h @@ -7,8 +7,19 @@ #include "nsISupports.h" /* interface nsISupports */ #include "nsINNTPNewsgroup.h" /* interface nsINNTPNewsgroup */ +#include "nsID.h" /* interface nsID */ #include "nsINNTPNewsgroupList.h" /* interface nsINNTPNewsgroupList */ +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" + /* starting interface nsIMsgOfflineNewsState */ @@ -25,15 +36,20 @@ class nsIMsgOfflineNewsState : public nsISupports { return iid; } - /* */ + /* attribute nsINNTPNewsgroup newsgroup; */ NS_IMETHOD GetNewsgroup(nsINNTPNewsgroup * *aNewsgroup) = 0; NS_IMETHOD SetNewsgroup(nsINNTPNewsgroup * aNewsgroup) = 0; - /* */ + /* long Process (out string outputBuffer, in long bufferSize); */ NS_IMETHOD Process(char **outputBuffer, PRInt32 bufferSize, PRInt32 *_retval) = 0; - /* */ + /* long Interrupt (); */ NS_IMETHOD Interrupt(PRInt32 *_retval) = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsIMsgOfflineNewsState *priv); +#endif }; #endif /* __gen_nsIMsgOfflineNewsState_h__ */ diff --git a/mailnews/news/public/nsINNTPArticleList.h b/mailnews/news/public/nsINNTPArticleList.h index fe03dea994d9..f26e21ae9b6b 100644 --- a/mailnews/news/public/nsINNTPArticleList.h +++ b/mailnews/news/public/nsINNTPArticleList.h @@ -7,9 +7,20 @@ #include "nsISupports.h" /* interface nsISupports */ #include "nsINNTPNewsgroup.h" /* interface nsINNTPNewsgroup */ +#include "nsID.h" /* interface nsID */ #include "nsINNTPNewsgroupList.h" /* interface nsINNTPNewsgroupList */ #include "nsINNTPHost.h" /* interface nsINNTPHost */ +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" + /* starting interface nsINNTPArticleList */ @@ -34,6 +45,11 @@ class nsINNTPArticleList : public nsISupports { /* void FinishAddingArticleKeys (); */ NS_IMETHOD FinishAddingArticleKeys() = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsINNTPArticleList *priv); +#endif }; #endif /* __gen_nsINNTPArticleList_h__ */ diff --git a/mailnews/news/public/nsINNTPCategory.h b/mailnews/news/public/nsINNTPCategory.h index d5566d1d2ca6..be3bdaa3b86f 100644 --- a/mailnews/news/public/nsINNTPCategory.h +++ b/mailnews/news/public/nsINNTPCategory.h @@ -7,9 +7,20 @@ #include "nsISupports.h" /* interface nsISupports */ #include "nsINNTPNewsgroup.h" /* interface nsINNTPNewsgroup */ +#include "nsID.h" /* interface nsID */ #include "nsIMsgGroupRecord.h" /* interface nsIMsgGroupRecord */ #include "nsINNTPNewsgroupList.h" /* interface nsINNTPNewsgroupList */ +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" + /* starting interface nsINNTPCategory */ @@ -26,17 +37,22 @@ class nsINNTPCategory : public nsISupports { return iid; } - /* */ - NS_IMETHOD BuildCategoryTree(const nsINNTPNewsgroup *parent, const char *catName, const nsIMsgGroupRecord *group, PRInt16 depth, nsINNTPNewsgroup **_retval) = 0; + /* nsINNTPNewsgroup BuildCategoryTree (in nsINNTPNewsgroup parent, in string catName, in nsIMsgGroupRecord group, in short depth); */ + NS_IMETHOD BuildCategoryTree(nsINNTPNewsgroup *parent, char *catName, nsIMsgGroupRecord *group, PRInt16 depth, nsINNTPNewsgroup **_retval) = 0; - /* */ - NS_IMETHOD AddToCategoryTree(const nsINNTPNewsgroup *parent, const char *groupName, const nsIMsgGroupRecord *group, nsINNTPNewsgroup **_retval) = 0; + /* nsINNTPNewsgroup AddToCategoryTree (in nsINNTPNewsgroup parent, in string groupName, in nsIMsgGroupRecord group); */ + NS_IMETHOD AddToCategoryTree(nsINNTPNewsgroup *parent, char *groupName, nsIMsgGroupRecord *group, nsINNTPNewsgroup **_retval) = 0; - /* */ + /* nsINNTPNewsgroup CloneIntoNewsFolder (); */ NS_IMETHOD CloneIntoNewsFolder(nsINNTPNewsgroup **_retval) = 0; - /* */ + /* nsINNTPNewsgroup GetRootCategory (); */ NS_IMETHOD GetRootCategory(nsINNTPNewsgroup **_retval) = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsINNTPCategory *priv); +#endif }; #endif /* __gen_nsINNTPCategory_h__ */ diff --git a/mailnews/news/public/nsINNTPCategoryContainer.h b/mailnews/news/public/nsINNTPCategoryContainer.h index f6c705cad161..d2e0db5c24f0 100644 --- a/mailnews/news/public/nsINNTPCategoryContainer.h +++ b/mailnews/news/public/nsINNTPCategoryContainer.h @@ -7,8 +7,19 @@ #include "nsISupports.h" /* interface nsISupports */ #include "nsINNTPNewsgroup.h" /* interface nsINNTPNewsgroup */ +#include "nsID.h" /* interface nsID */ #include "nsINNTPNewsgroupList.h" /* interface nsINNTPNewsgroupList */ +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" + /* starting interface nsINNTPCategoryContainer */ @@ -25,9 +36,14 @@ class nsINNTPCategoryContainer : public nsISupports { return iid; } - /* */ + /* attribute nsINNTPNewsgroup rootCategory; */ NS_IMETHOD GetRootCategory(nsINNTPNewsgroup * *aRootCategory) = 0; NS_IMETHOD SetRootCategory(nsINNTPNewsgroup * aRootCategory) = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsINNTPCategoryContainer *priv); +#endif }; #endif /* __gen_nsINNTPCategoryContainer_h__ */ diff --git a/mailnews/news/public/nsINNTPHost.h b/mailnews/news/public/nsINNTPHost.h index 1227fe08095a..951ff259aa2c 100644 --- a/mailnews/news/public/nsINNTPHost.h +++ b/mailnews/news/public/nsINNTPHost.h @@ -7,8 +7,19 @@ #include "nsISupports.h" /* interface nsISupports */ #include "nsINNTPNewsgroup.h" /* interface nsINNTPNewsgroup */ +#include "nsID.h" /* interface nsID */ #include "nsINNTPNewsgroupList.h" /* interface nsINNTPNewsgroupList */ +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" + /* starting interface nsINNTPHost */ @@ -25,121 +36,126 @@ class nsINNTPHost : public nsISupports { return iid; } - /* */ + /* attribute boolean supportsExtensions; */ NS_IMETHOD GetSupportsExtensions(PRBool *aSupportsExtensions) = 0; NS_IMETHOD SetSupportsExtensions(PRBool aSupportsExtensions) = 0; - /* */ - NS_IMETHOD AddExtension(const char *extension) = 0; + /* void AddExtension (in string extension); */ + NS_IMETHOD AddExtension(char *extension) = 0; - /* */ - NS_IMETHOD QueryExtension(const char *extension, PRBool *_retval) = 0; + /* boolean QueryExtension (in string extension); */ + NS_IMETHOD QueryExtension(char *extension, PRBool *_retval) = 0; - /* */ + /* attribute boolean postingAllowed; */ NS_IMETHOD GetPostingAllowed(PRBool *aPostingAllowed) = 0; NS_IMETHOD SetPostingAllowed(PRBool aPostingAllowed) = 0; - /* */ + /* attribute boolean pushAuth; */ NS_IMETHOD GetPushAuth(PRBool *aPushAuth) = 0; NS_IMETHOD SetPushAuth(PRBool aPushAuth) = 0; - /* */ + /* attribute long long lastUpdatedTime; */ NS_IMETHOD GetLastUpdatedTime(PRInt64 *aLastUpdatedTime) = 0; NS_IMETHOD SetLastUpdatedTime(PRInt64 aLastUpdatedTime) = 0; - /* */ - NS_IMETHOD GetNewsgroupList(const char *groupname, nsINNTPNewsgroupList **_retval) = 0; + /* nsINNTPNewsgroupList GetNewsgroupList (in string groupname); */ + NS_IMETHOD GetNewsgroupList(char *groupname, nsINNTPNewsgroupList **_retval) = 0; - /* */ - NS_IMETHOD FindNewsgroup(const char *groupname, PRBool create, nsINNTPNewsgroup **_retval) = 0; + /* nsINNTPNewsgroup FindNewsgroup (in string groupname, in boolean create); */ + NS_IMETHOD FindNewsgroup(char *groupname, PRBool create, nsINNTPNewsgroup **_retval) = 0; - /* */ - NS_IMETHOD AddPropertyForGet(const char *name, const char *value) = 0; + /* void AddPropertyForGet (in string name, in string value); */ + NS_IMETHOD AddPropertyForGet(char *name, char *value) = 0; - /* */ - NS_IMETHOD QueryPropertyForGet(const char *name, char **_retval) = 0; + /* string QueryPropertyForGet (in string name); */ + NS_IMETHOD QueryPropertyForGet(char *name, char **_retval) = 0; - /* */ - NS_IMETHOD AddSearchableGroup(const char *groupname) = 0; + /* void AddSearchableGroup (in string groupname); */ + NS_IMETHOD AddSearchableGroup(char *groupname) = 0; - /* */ - NS_IMETHOD QuerySearchableGroup(const char *groupname, PRBool *_retval) = 0; + /* boolean QuerySearchableGroup (in string groupname); */ + NS_IMETHOD QuerySearchableGroup(char *groupname, PRBool *_retval) = 0; - /* */ - NS_IMETHOD AddVirtualGroup(const char *responseText) = 0; + /* void AddVirtualGroup (in string responseText); */ + NS_IMETHOD AddVirtualGroup(char *responseText) = 0; - /* */ - NS_IMETHOD SetIsVirtualGroup(const char *groupname, PRBool isVirtual) = 0; + /* void SetIsVirtualGroup (in string groupname, in boolean isVirtual); */ + NS_IMETHOD SetIsVirtualGroup(char *groupname, PRBool isVirtual) = 0; - /* */ - NS_IMETHOD GetIsVirtualGroup(const char *groupname, PRBool *_retval) = 0; + /* boolean GetIsVirtualGroup (in string groupname); */ + NS_IMETHOD GetIsVirtualGroup(char *groupname, PRBool *_retval) = 0; - /* */ - NS_IMETHOD AddSearchableHeader(const char *headerName) = 0; + /* void AddSearchableHeader (in string headerName); */ + NS_IMETHOD AddSearchableHeader(char *headerName) = 0; - /* */ - NS_IMETHOD QuerySearchableHeader(const char *headerName, PRBool *_retval) = 0; + /* boolean QuerySearchableHeader (in string headerName); */ + NS_IMETHOD QuerySearchableHeader(char *headerName, PRBool *_retval) = 0; - /* */ - NS_IMETHOD GroupNotFound(const char *group, PRBool opening) = 0; + /* void GroupNotFound (in string group, in boolean opening); */ + NS_IMETHOD GroupNotFound(char *group, PRBool opening) = 0; - /* */ - NS_IMETHOD AddNewNewsgroup(const char *groupname, PRInt32 first, PRInt32 last, const char *flags, PRBool xactiveFlags) = 0; + /* void AddNewNewsgroup (in string groupname, in long first, in long last, in string flags, in boolean xactiveFlags); */ + NS_IMETHOD AddNewNewsgroup(char *groupname, PRInt32 first, PRInt32 last, char *flags, PRBool xactiveFlags) = 0; - /* */ + /* long GetNumGroupsNeedingCounts (); */ NS_IMETHOD GetNumGroupsNeedingCounts(PRInt32 *_retval) = 0; - /* */ + /* string GetFirstGroupNeedingCounts (); */ NS_IMETHOD GetFirstGroupNeedingCounts(char **_retval) = 0; - /* */ - NS_IMETHOD DisplaySubscribedGroup(const char *groupname, PRInt32 first_message, PRInt32 last_message, PRInt32 total_messages, PRBool visit_now) = 0; + /* void DisplaySubscribedGroup (in string groupname, in long first_message, in long last_message, in long total_messages, in boolean visit_now); */ + NS_IMETHOD DisplaySubscribedGroup(char *groupname, PRInt32 first_message, PRInt32 last_message, PRInt32 total_messages, PRBool visit_now) = 0; - /* */ + /* string GetFirstGroupNeedingExtraInfo (); */ NS_IMETHOD GetFirstGroupNeedingExtraInfo(char **_retval) = 0; - /* */ - NS_IMETHOD SetGroupNeedsExtraInfo(const char *groupname, PRBool needsExtraInfo) = 0; + /* void SetGroupNeedsExtraInfo (in string groupname, in boolean needsExtraInfo); */ + NS_IMETHOD SetGroupNeedsExtraInfo(char *groupname, PRBool needsExtraInfo) = 0; - /* */ - NS_IMETHOD GetNewsgroupAndNumberOfID(const char *message_id, nsINNTPNewsgroup **group, PRUint32 *message_number) = 0; + /* void GetNewsgroupAndNumberOfID (in string message_id, out nsINNTPNewsgroup group, out unsigned long message_number); */ + NS_IMETHOD GetNewsgroupAndNumberOfID(char *message_id, nsINNTPNewsgroup **group, PRUint32 *message_number) = 0; - /* */ - NS_IMETHOD SetPrettyName(const char *groupName, const char *prettyName) = 0; + /* void SetPrettyName (in string groupName, in string prettyName); */ + NS_IMETHOD SetPrettyName(char *groupName, char *prettyName) = 0; - /* */ + /* void LoadNewsrc (); */ NS_IMETHOD LoadNewsrc() = 0; - /* */ + /* void WriteNewsrc (); */ NS_IMETHOD WriteNewsrc() = 0; - /* */ + /* void WriteIfDirty (); */ NS_IMETHOD WriteIfDirty() = 0; - /* */ + /* void MarkDirty (); */ NS_IMETHOD MarkDirty() = 0; - /* */ + /* attribute string newsRCFilename; */ NS_IMETHOD GetNewsRCFilename(char * *aNewsRCFilename) = 0; NS_IMETHOD SetNewsRCFilename(char * aNewsRCFilename) = 0; - /* */ - NS_IMETHOD FindGroup(const char *name, nsINNTPNewsgroup **_retval) = 0; + /* nsINNTPNewsgroup FindGroup (in string name); */ + NS_IMETHOD FindGroup(char *name, nsINNTPNewsgroup **_retval) = 0; - /* */ - NS_IMETHOD AddGroup(const char *groupname, nsINNTPNewsgroup **_retval) = 0; + /* nsINNTPNewsgroup AddGroup (in string groupname); */ + NS_IMETHOD AddGroup(char *groupname, nsINNTPNewsgroup **_retval) = 0; - /* */ - NS_IMETHOD RemoveGroupByName(const char *groupName) = 0; + /* void RemoveGroupByName (in string groupName); */ + NS_IMETHOD RemoveGroupByName(char *groupName) = 0; - /* */ - NS_IMETHOD RemoveGroup(const nsINNTPNewsgroup *group) = 0; + /* void RemoveGroup (in nsINNTPNewsgroup group); */ + NS_IMETHOD RemoveGroup(nsINNTPNewsgroup *group) = 0; - /* */ + /* readonly attribute string dbDirName; */ NS_IMETHOD GetDbDirName(char * *aDbDirName) = 0; - /* */ + /* string GetGroupList (); */ NS_IMETHOD GetGroupList(char **_retval) = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsINNTPHost *priv); +#endif }; #endif /* __gen_nsINNTPHost_h__ */ diff --git a/mailnews/news/public/nsINNTPNewsgroup.h b/mailnews/news/public/nsINNTPNewsgroup.h index e3f16d8d69e9..ad6e8b9c7411 100644 --- a/mailnews/news/public/nsINNTPNewsgroup.h +++ b/mailnews/news/public/nsINNTPNewsgroup.h @@ -6,8 +6,19 @@ #define __gen_nsINNTPNewsgroup_h__ #include "nsISupports.h" /* interface nsISupports */ +#include "nsID.h" /* interface nsID */ #include "nsINNTPNewsgroupList.h" /* interface nsINNTPNewsgroupList */ +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" + /* starting interface nsINNTPNewsgroup */ @@ -24,47 +35,52 @@ class nsINNTPNewsgroup : public nsISupports { return iid; } - /* */ + /* attribute string name; */ NS_IMETHOD GetName(char * *aName) = 0; NS_IMETHOD SetName(char * aName) = 0; - /* */ + /* attribute string prettyName; */ NS_IMETHOD GetPrettyName(char * *aPrettyName) = 0; NS_IMETHOD SetPrettyName(char * aPrettyName) = 0; - /* */ + /* attribute string password; */ NS_IMETHOD GetPassword(char * *aPassword) = 0; NS_IMETHOD SetPassword(char * aPassword) = 0; - /* */ + /* attribute string username; */ NS_IMETHOD GetUsername(char * *aUsername) = 0; NS_IMETHOD SetUsername(char * aUsername) = 0; - /* */ + /* attribute boolean needsExtraInfo; */ NS_IMETHOD GetNeedsExtraInfo(PRBool *aNeedsExtraInfo) = 0; NS_IMETHOD SetNeedsExtraInfo(PRBool aNeedsExtraInfo) = 0; - /* */ + /* boolean IsOfflineArticle (in long num); */ NS_IMETHOD IsOfflineArticle(PRInt32 num, PRBool *_retval) = 0; - /* */ + /* attribute boolean category; */ NS_IMETHOD GetCategory(PRBool *aCategory) = 0; NS_IMETHOD SetCategory(PRBool aCategory) = 0; - /* */ + /* attribute boolean subscribed; */ NS_IMETHOD GetSubscribed(PRBool *aSubscribed) = 0; NS_IMETHOD SetSubscribed(PRBool aSubscribed) = 0; - /* */ + /* attribute boolean wantNewTotals; */ NS_IMETHOD GetWantNewTotals(PRBool *aWantNewTotals) = 0; NS_IMETHOD SetWantNewTotals(PRBool aWantNewTotals) = 0; - /* */ + /* attribute nsINNTPNewsgroupList newsgroupList; */ NS_IMETHOD GetNewsgroupList(nsINNTPNewsgroupList * *aNewsgroupList) = 0; NS_IMETHOD SetNewsgroupList(nsINNTPNewsgroupList * aNewsgroupList) = 0; - /* */ + /* void UpdateSummaryFromNNTPInfo (in long oldest, in long youngest, in long total_messages); */ NS_IMETHOD UpdateSummaryFromNNTPInfo(PRInt32 oldest, PRInt32 youngest, PRInt32 total_messages) = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsINNTPNewsgroup *priv); +#endif }; #endif /* __gen_nsINNTPNewsgroup_h__ */ diff --git a/mailnews/news/public/nsINNTPNewsgroupList.h b/mailnews/news/public/nsINNTPNewsgroupList.h index c45200403ac0..4a4638d1ad57 100644 --- a/mailnews/news/public/nsINNTPNewsgroupList.h +++ b/mailnews/news/public/nsINNTPNewsgroupList.h @@ -6,6 +6,17 @@ #define __gen_nsINNTPNewsgroupList_h__ #include "nsISupports.h" /* interface nsISupports */ +#include "nsID.h" /* interface nsID */ + +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" /* starting interface nsINNTPNewsgroupList */ @@ -23,29 +34,34 @@ class nsINNTPNewsgroupList : public nsISupports { return iid; } - /* */ + /* long GetRangeOfArtsToDownload (in long first_message, in long last_message, in long maxextra, out long real_first_message, out long real_last_message); */ NS_IMETHOD GetRangeOfArtsToDownload(PRInt32 first_message, PRInt32 last_message, PRInt32 maxextra, PRInt32 *real_first_message, PRInt32 *real_last_message, PRInt32 *_retval) = 0; - /* */ + /* void AddToKnownArticles (in long first_message, in long last_message); */ NS_IMETHOD AddToKnownArticles(PRInt32 first_message, PRInt32 last_message) = 0; - /* */ + /* void InitXOVER (in long first_message, in long last_message); */ NS_IMETHOD InitXOVER(PRInt32 first_message, PRInt32 last_message) = 0; - /* */ - NS_IMETHOD ProcessXOVER(const char *line, PRInt32 *status) = 0; + /* void ProcessXOVER (in string line, out long status); */ + NS_IMETHOD ProcessXOVER(char *line, PRInt32 *status) = 0; - /* */ - NS_IMETHOD ProcessNonXOVER(const char *line) = 0; + /* void ProcessNonXOVER (in string line); */ + NS_IMETHOD ProcessNonXOVER(char *line) = 0; - /* */ + /* void ResetXOVER (); */ NS_IMETHOD ResetXOVER() = 0; - /* */ + /* void FinishXOVER (in long status, out long newstatus); */ NS_IMETHOD FinishXOVER(PRInt32 status, PRInt32 *newstatus) = 0; - /* */ + /* void ClearXOVERState (); */ NS_IMETHOD ClearXOVERState() = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsINNTPNewsgroupList *priv); +#endif }; #endif /* __gen_nsINNTPNewsgroupList_h__ */ diff --git a/mailnews/news/public/nsINNTPNewsgroupPost.h b/mailnews/news/public/nsINNTPNewsgroupPost.h index dd9a3dfda5ff..d4c40b25b88c 100644 --- a/mailnews/news/public/nsINNTPNewsgroupPost.h +++ b/mailnews/news/public/nsINNTPNewsgroupPost.h @@ -6,6 +6,17 @@ #define __gen_nsINNTPNewsgroupPost_h__ #include "nsISupports.h" /* interface nsISupports */ +#include "nsID.h" /* interface nsID */ + +#ifdef XPIDL_JS_STUBS +#include "jsapi.h" +#endif +#include "nsDebug.h" +#include "nsTraceRefcnt.h" +#include "nsID.h" +#include "nsIID.h" +#include "nsError.h" +#include "nsISupportsUtils.h" /* starting interface nsINNTPNewsgroupPost */ @@ -23,92 +34,97 @@ class nsINNTPNewsgroupPost : public nsISupports { return iid; } - /* */ + /* attribute string relayVersion; */ NS_IMETHOD GetRelayVersion(char * *aRelayVersion) = 0; NS_IMETHOD SetRelayVersion(char * aRelayVersion) = 0; - /* */ + /* attribute string postingVersion; */ NS_IMETHOD GetPostingVersion(char * *aPostingVersion) = 0; NS_IMETHOD SetPostingVersion(char * aPostingVersion) = 0; - /* */ + /* attribute string from; */ NS_IMETHOD GetFrom(char * *aFrom) = 0; NS_IMETHOD SetFrom(char * aFrom) = 0; - /* */ + /* attribute string date; */ NS_IMETHOD GetDate(char * *aDate) = 0; NS_IMETHOD SetDate(char * aDate) = 0; - /* */ - NS_IMETHOD AddNewsgroup(const char *newsgroupName) = 0; + /* void AddNewsgroup (in string newsgroupName); */ + NS_IMETHOD AddNewsgroup(char *newsgroupName) = 0; - /* */ + /* readonly attribute string newsgroups; */ NS_IMETHOD GetNewsgroups(char * *aNewsgroups) = 0; - /* */ + /* attribute string subject; */ NS_IMETHOD GetSubject(char * *aSubject) = 0; NS_IMETHOD SetSubject(char * aSubject) = 0; - /* */ + /* readonly attribute string messageID; */ NS_IMETHOD GetMessageID(char * *aMessageID) = 0; - /* */ + /* attribute string path; */ NS_IMETHOD GetPath(char * *aPath) = 0; NS_IMETHOD SetPath(char * aPath) = 0; - /* */ + /* boolean isValid (); */ NS_IMETHOD isValid(PRBool *_retval) = 0; - /* */ + /* attribute string replyTo; */ NS_IMETHOD GetReplyTo(char * *aReplyTo) = 0; NS_IMETHOD SetReplyTo(char * aReplyTo) = 0; - /* */ + /* attribute string sender; */ NS_IMETHOD GetSender(char * *aSender) = 0; NS_IMETHOD SetSender(char * aSender) = 0; - /* */ + /* attribute string followupTo; */ NS_IMETHOD GetFollowupTo(char * *aFollowupTo) = 0; NS_IMETHOD SetFollowupTo(char * aFollowupTo) = 0; - /* */ + /* attribute string dateRecieved; */ NS_IMETHOD GetDateRecieved(char * *aDateRecieved) = 0; NS_IMETHOD SetDateRecieved(char * aDateRecieved) = 0; - /* */ + /* attribute string expires; */ NS_IMETHOD GetExpires(char * *aExpires) = 0; NS_IMETHOD SetExpires(char * aExpires) = 0; - /* */ - NS_IMETHOD AddReference(const char *referenceID) = 0; + /* void AddReference (in string referenceID); */ + NS_IMETHOD AddReference(char *referenceID) = 0; - /* */ + /* readonly attribute string references; */ NS_IMETHOD GetReferences(char * *aReferences) = 0; - /* */ + /* attribute string control; */ NS_IMETHOD GetControl(char * *aControl) = 0; NS_IMETHOD SetControl(char * aControl) = 0; - /* */ + /* attribute string distribution; */ NS_IMETHOD GetDistribution(char * *aDistribution) = 0; NS_IMETHOD SetDistribution(char * aDistribution) = 0; - /* */ + /* attribute string organization; */ NS_IMETHOD GetOrganization(char * *aOrganization) = 0; NS_IMETHOD SetOrganization(char * aOrganization) = 0; - /* */ + /* attribute string body; */ NS_IMETHOD GetBody(char * *aBody) = 0; NS_IMETHOD SetBody(char * aBody) = 0; - /* */ - NS_IMETHOD MakeControlCancel(const char *messageID) = 0; + /* void MakeControlCancel (in string messageID); */ + NS_IMETHOD MakeControlCancel(char *messageID) = 0; - /* */ + /* readonly attribute boolean isControl; */ NS_IMETHOD GetIsControl(PRBool *aIsControl) = 0; - /* */ + /* string GetFullMessage (); */ NS_IMETHOD GetFullMessage(char **_retval) = 0; + +#ifdef XPIDL_JS_STUBS + static NS_EXPORT_(JSObject *) InitJSClass(JSContext *cx); + static NS_EXPORT_(JSObject *) GetJSObject(JSContext *cx, nsINNTPNewsgroupPost *priv); +#endif }; #endif /* __gen_nsINNTPNewsgroupPost_h__ */ diff --git a/mailnews/news/src/nsNNTPHost.cpp b/mailnews/news/src/nsNNTPHost.cpp index 2ee282d6ba24..c303e60cd018 100644 --- a/mailnews/news/src/nsNNTPHost.cpp +++ b/mailnews/news/src/nsNNTPHost.cpp @@ -93,8 +93,8 @@ public: NS_IMPL_CLASS_GETSET(SupportsExtensions, PRBool, m_supportsExtensions); - NS_IMETHOD AddExtension (const char *ext); - NS_IMETHOD QueryExtension (const char *ext, PRBool *_retval); + NS_IMETHOD AddExtension (char *ext); + NS_IMETHOD QueryExtension (char *ext, PRBool *_retval); NS_IMPL_CLASS_GETSET(PostingAllowed, PRBool, m_postingAllowed); @@ -103,35 +103,35 @@ public: NS_IMPL_CLASS_GETSET(LastUpdatedTime, PRInt64, m_lastGroupUpdate); - NS_IMETHOD GetNewsgroupList(const char *groupname, + NS_IMETHOD GetNewsgroupList(char *groupname, nsINNTPNewsgroupList **_retval) { NS_ASSERTION(0, "unimplemented"); return NS_OK;}; - NS_IMETHOD GetNewsgroupAndNumberOfID(const char *message_id, + NS_IMETHOD GetNewsgroupAndNumberOfID(char *message_id, nsINNTPNewsgroup **group, PRUint32 *messageNumber); /* get this from MSG_Master::FindNewsFolder */ - NS_IMETHOD FindNewsgroup(const char *groupname, PRBool create, + NS_IMETHOD FindNewsgroup(char *groupname, PRBool create, nsINNTPNewsgroup **_retval) { NS_ASSERTION(0, "unimplemented!"); return NS_OK;} - NS_IMETHOD AddPropertyForGet (const char *property, const char *value); - NS_IMETHOD QueryPropertyForGet (const char *property, char **_retval); + NS_IMETHOD AddPropertyForGet (char *property, char *value); + NS_IMETHOD QueryPropertyForGet (char *property, char **_retval); - NS_IMETHOD AddSearchableGroup(const char *groupname); + NS_IMETHOD AddSearchableGroup(char *groupname); // should these go into interfaces? - NS_IMETHOD QuerySearchableGroup (const char *group, PRBool *); - NS_IMETHOD QuerySearchableGroupCharsets(const char *group, char **); + NS_IMETHOD QuerySearchableGroup (char *group, PRBool *); + NS_IMETHOD QuerySearchableGroupCharsets(char *group, char **); // Virtual groups - NS_IMETHOD AddVirtualGroup(const char *responseText) { return NS_OK;} - NS_IMETHOD SetIsVirtualGroup(const char *groupname, PRBool isVirtual); - NS_IMETHOD SetIsVirtualGroup(const char *groupname, PRBool isVirtual, + NS_IMETHOD AddVirtualGroup(char *responseText) { return NS_OK;} + NS_IMETHOD SetIsVirtualGroup(char *groupname, PRBool isVirtual); + NS_IMETHOD SetIsVirtualGroup(char *groupname, PRBool isVirtual, nsMsgGroupRecord *inGroupRecord); - NS_IMETHOD GetIsVirtualGroup(const char *groupname, PRBool *_retval); + NS_IMETHOD GetIsVirtualGroup(char *groupname, PRBool *_retval); // custom/searchable headers - NS_IMETHOD AddSearchableHeader(const char *headerName); - NS_IMETHOD QuerySearchableHeader(const char *headerName, PRBool *_retval); + NS_IMETHOD AddSearchableHeader(char *headerName); + NS_IMETHOD QuerySearchableHeader(char *headerName, PRBool *_retval); // Go load the newsrc for this host. Creates the subscribed hosts as // children of the given nsIMsgFolder. @@ -158,21 +158,21 @@ public: // (this is what the pre-mozilla API looked like) char *GetNewsrcFileName() { return m_filename; }; - NS_IMETHOD FindGroup(const char* name, nsINNTPNewsgroup* *_retval); - NS_IMETHOD AddGroup(const char *groupname, + NS_IMETHOD FindGroup(char* name, nsINNTPNewsgroup* *_retval); + NS_IMETHOD AddGroup(char *groupname, nsINNTPNewsgroup **retval); - NS_IMETHOD AddGroup(const char *groupname, + NS_IMETHOD AddGroup(char *groupname, nsMsgGroupRecord *groupRecord, nsINNTPNewsgroup **retval); - NS_IMETHOD RemoveGroupByName(const char *groupName); - NS_IMETHOD RemoveGroup(const nsINNTPNewsgroup*); + NS_IMETHOD RemoveGroupByName(char *groupName); + NS_IMETHOD RemoveGroup(nsINNTPNewsgroup*); - NS_IMETHOD AddNewNewsgroup(const char *groupName, + NS_IMETHOD AddNewNewsgroup(char *groupName, PRInt32 first, PRInt32 last, - const char *flags, + char *flags, PRBool xactiveFlags); /* Name of directory to store newsgroup @@ -189,7 +189,7 @@ public: individual strings must not be free'd. */ NS_IMETHOD GetGroupList(char **_retval) { return NS_OK;} - NS_IMETHOD DisplaySubscribedGroup(const char *groupname, + NS_IMETHOD DisplaySubscribedGroup(char *groupname, PRInt32 first_message, PRInt32 last_message, PRInt32 total_messages, @@ -283,50 +283,50 @@ private: // Returns the pretty name for the given group. The resulting string // must be free'd using delete[]. - char* GetPrettyName(const char* groupname); - NS_IMETHOD SetPrettyName(const char* groupname, const char* prettyname); + char* GetPrettyName(char* groupname); + NS_IMETHOD SetPrettyName(char* groupname, char* prettyname); - time_t GetAddTime(const char* groupname); + time_t GetAddTime(char* groupname); // Returns a unique integer associated with this newsgroup. This is // mostly used by Win16 to generate a 8.3 filename. - PRInt32 GetUniqueID(const char* groupname); + PRInt32 GetUniqueID(char* groupname); - PRBool IsCategory(const char* groupname); - PRBool IsCategoryContainer(const char* groupname); - int SetIsCategoryContainer(const char* groupname, PRBool value, nsMsgGroupRecord *inGroupRecord = NULL); + PRBool IsCategory(char* groupname); + PRBool IsCategoryContainer(char* groupname); + int SetIsCategoryContainer(char* groupname, PRBool value, nsMsgGroupRecord *inGroupRecord = NULL); - NS_IMETHOD SetGroupNeedsExtraInfo(const char *groupname, PRBool value); + NS_IMETHOD SetGroupNeedsExtraInfo(char *groupname, PRBool value); // Finds the container newsgroup for this category (or NULL if this isn't // a category). The resulting string must be free'd using delete[]. - char* GetCategoryContainer(const char* groupname, nsMsgGroupRecord *inGroupRecord = NULL); - nsINNTPNewsgroup *GetCategoryContainerFolderInfo(const char *groupname); + char* GetCategoryContainer(char* groupname, nsMsgGroupRecord *inGroupRecord = NULL); + nsINNTPNewsgroup *GetCategoryContainerFolderInfo(char *groupname); // Get/Set whether this is a real group (as opposed to a container of // other groups, like "mcom".) - PRBool IsGroup(const char* groupname); - int SetIsGroup(const char* groupname, PRBool value); + PRBool IsGroup(char* groupname); + int SetIsGroup(char* groupname, PRBool value); // Returns PR_TRUE if it's OK to post HTML in this group (either because the // bit is on for this group, or one of this group's ancestor's has marked // all of its descendents as being OK for HTML.) - PRBool IsHTMLOk(const char* groupname); + PRBool IsHTMLOk(char* groupname); // Get/Set if it's OK to post HTML in just this group. - PRBool IsHTMLOKGroup(const char* groupname); - int SetIsHTMLOKGroup(const char* groupname, PRBool value); + PRBool IsHTMLOKGroup(char* groupname); + int SetIsHTMLOKGroup(char* groupname, PRBool value); // Get/Set if it's OK to post HTML in this group and all of its subgroups. - PRBool IsHTMLOKTree(const char* groupname); - int SetIsHTMLOKTree(const char* groupname, PRBool value); + PRBool IsHTMLOKTree(char* groupname); + int SetIsHTMLOKTree(char* groupname, PRBool value); // Create the given group (if not already present). Returns 0 if the // group is already present, 1 if we had to create it, negative on error. // The given group will have the "isgroup" bit set on it (in other words, // it is not to be just a container of other groups, like "mcom" is.) - int NoticeNewGroup(const char* groupname, nsMsgGroupRecord **outGroupRecord = NULL); + int NoticeNewGroup(char* groupname, nsMsgGroupRecord **outGroupRecord = NULL); // Makes sure that we have records in memory for all known descendants @@ -351,7 +351,7 @@ private: nsMsgGroupRecord* GetGroupTree() {return m_groupTree;} time_t GetFirstNewDate() {return m_firstnewdate;} - NS_IMETHOD GroupNotFound(const char *groupName, PRBool opening); + NS_IMETHOD GroupNotFound(char *groupName, PRBool opening); int ReorderGroup (nsINNTPNewsgroup *groupToMove, nsINNTPNewsgroup *groupToMoveBefore, PRInt32 *newIdx); @@ -364,13 +364,13 @@ protected: int CreateFileHeader(); int ReadInitialPart(); nsMsgGroupRecord* FindGroupInBlock(nsMsgGroupRecord* parent, - const char* groupname, + char* groupname, PRInt32* comp); nsMsgGroupRecord* LoadSingleEntry(nsMsgGroupRecord* parent, - const char* groupname, + char* groupname, PRInt32 min, PRInt32 max); static PRInt32 InhaleLine(char* line, PRUint32 length, void* closure); - nsMsgGroupRecord* FindOrCreateGroup(const char* groupname, + nsMsgGroupRecord* FindOrCreateGroup(char* groupname, int* statusOfMakingGroup = NULL); nsINNTPCategoryContainer *SwitchNewsToCategoryContainer(nsINNTPNewsgroup *newsInfo); @@ -487,7 +487,7 @@ NS_IMPL_ISUPPORTS(nsNNTPHost, IID()) #ifdef HAVE_MASTER -nsNNTPHost::nsNNTPHost(MSG_Master* master, const char* name, +nsNNTPHost::nsNNTPHost(MSG_Master* master, char* name, PRInt32 port) { m_master = master; @@ -1623,7 +1623,7 @@ nsNNTPHost::EmptyInhale() nsresult -nsNNTPHost::FindGroup(const char* name, nsINNTPNewsgroup* *retval) +nsNNTPHost::FindGroup(char* name, nsINNTPNewsgroup* *retval) { nsresult result = NS_ERROR_NOT_INITIALIZED; @@ -1646,7 +1646,7 @@ nsNNTPHost::FindGroup(const char* name, nsINNTPNewsgroup* *retval) } nsresult -nsNNTPHost::AddGroup(const char *groupName, +nsNNTPHost::AddGroup(char *groupName, nsINNTPNewsgroup **retval) { return AddGroup(groupName, NULL, retval); @@ -1654,7 +1654,7 @@ nsNNTPHost::AddGroup(const char *groupName, nsresult -nsNNTPHost::AddGroup(const char *groupName, +nsNNTPHost::AddGroup(char *groupName, nsMsgGroupRecord *inGroupRecord, nsINNTPNewsgroup **retval) { @@ -1906,7 +1906,7 @@ nsNNTPHost::SwitchCategoryContainerToNews(nsINNTPCategoryContainer* } nsresult -nsNNTPHost::RemoveGroup (const nsINNTPNewsgroup *newsInfo) +nsNNTPHost::RemoveGroup (nsINNTPNewsgroup *newsInfo) { PRBool subscribed; if (!newsInfo) return NS_ERROR_NULL_POINTER; @@ -1932,7 +1932,7 @@ nsNNTPHost::RemoveGroup (const nsINNTPNewsgroup *newsInfo) } nsresult -nsNNTPHost::RemoveGroupByName(const char* groupName) +nsNNTPHost::RemoveGroupByName(char* groupName) { nsINNTPNewsgroup *newsInfo = NULL; @@ -2090,7 +2090,7 @@ PRBool nsNNTPHost::NeedsExtension (const char * /*extension*/) } nsresult -nsNNTPHost::AddExtension (const char *ext) +nsNNTPHost::AddExtension (char *ext) { PRBool alreadyHasExtension=FALSE; QueryExtension(ext, &alreadyHasExtension); @@ -2104,7 +2104,7 @@ nsNNTPHost::AddExtension (const char *ext) } nsresult -nsNNTPHost::QueryExtension (const char *ext, PRBool *retval) +nsNNTPHost::QueryExtension (char *ext, PRBool *retval) { *retval = PR_FALSE; for (int i = 0; i < m_supportedExtensions.Count(); i++) @@ -2116,7 +2116,7 @@ nsNNTPHost::QueryExtension (const char *ext, PRBool *retval) } nsresult -nsNNTPHost::AddSearchableGroup (const char *group) +nsNNTPHost::AddSearchableGroup (char *group) { PRBool searchableGroup; nsresult rv = QuerySearchableGroup(group, &searchableGroup); @@ -2141,7 +2141,7 @@ nsNNTPHost::AddSearchableGroup (const char *group) } nsresult -nsNNTPHost::QuerySearchableGroup (const char *group, PRBool *_retval) +nsNNTPHost::QuerySearchableGroup (char *group, PRBool *_retval) { *_retval = FALSE; for (int i = 0; i < m_searchableGroups.Count(); i++) @@ -2171,7 +2171,7 @@ nsNNTPHost::QuerySearchableGroup (const char *group, PRBool *_retval) // ### mwelch This should have been merged into one routine with QuerySearchableGroup, // but with two interfaces. nsresult -nsNNTPHost::QuerySearchableGroupCharsets(const char *group, char **result) +nsNNTPHost::QuerySearchableGroupCharsets(char *group, char **result) { // Very similar to the above, but this time we look up charsets. PRBool gotGroup = PR_FALSE; @@ -2204,7 +2204,7 @@ nsNNTPHost::QuerySearchableGroupCharsets(const char *group, char **result) } nsresult -nsNNTPHost::AddSearchableHeader (const char *header) +nsNNTPHost::AddSearchableHeader (char *header) { PRBool searchable; nsresult rv = QuerySearchableHeader(header, &searchable); @@ -2218,7 +2218,7 @@ nsNNTPHost::AddSearchableHeader (const char *header) } nsresult -nsNNTPHost::QuerySearchableHeader(const char *header, PRBool *retval) +nsNNTPHost::QuerySearchableHeader(char *header, PRBool *retval) { *retval=PR_FALSE; for (int i = 0; i < m_searchableHeaders.Count(); i++) @@ -2230,7 +2230,7 @@ nsNNTPHost::QuerySearchableHeader(const char *header, PRBool *retval) } nsresult -nsNNTPHost::AddPropertyForGet (const char *property, const char *value) +nsNNTPHost::AddPropertyForGet (char *property, char *value) { char *tmp = NULL; @@ -2247,7 +2247,7 @@ nsNNTPHost::AddPropertyForGet (const char *property, const char *value) } nsresult -nsNNTPHost::QueryPropertyForGet (const char *property, char **retval) +nsNNTPHost::QueryPropertyForGet (char *property, char **retval) { *retval=NULL; for (int i = 0; i < m_propertiesForGet.Count(); i++) @@ -2338,7 +2338,7 @@ int nsNNTPHost::RemoveHost() char* -nsNNTPHost::GetPrettyName(const char* groupname) +nsNNTPHost::GetPrettyName(char* groupname) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (group) { @@ -2356,7 +2356,7 @@ nsNNTPHost::GetPrettyName(const char* groupname) nsresult -nsNNTPHost::SetPrettyName(const char* groupname, const char* prettyname) +nsNNTPHost::SetPrettyName(char* groupname, char* prettyname) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) return MK_OUT_OF_MEMORY; @@ -2379,7 +2379,7 @@ nsNNTPHost::SetPrettyName(const char* groupname, const char* prettyname) time_t -nsNNTPHost::GetAddTime(const char* groupname) +nsNNTPHost::GetAddTime(char* groupname) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) return 0; @@ -2388,7 +2388,7 @@ nsNNTPHost::GetAddTime(const char* groupname) PRInt32 -nsNNTPHost::GetUniqueID(const char* groupname) +nsNNTPHost::GetUniqueID(char* groupname) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) return 0; @@ -2397,7 +2397,7 @@ nsNNTPHost::GetUniqueID(const char* groupname) PRBool -nsNNTPHost::IsCategory(const char* groupname) +nsNNTPHost::IsCategory(char* groupname) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) return PR_FALSE; @@ -2406,7 +2406,7 @@ nsNNTPHost::IsCategory(const char* groupname) PRBool -nsNNTPHost::IsCategoryContainer(const char* groupname) +nsNNTPHost::IsCategoryContainer(char* groupname) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) return PR_FALSE; @@ -2414,7 +2414,7 @@ nsNNTPHost::IsCategoryContainer(const char* groupname) } int -nsNNTPHost::SetIsCategoryContainer(const char* groupname, PRBool value, nsMsgGroupRecord *inGroupRecord) +nsNNTPHost::SetIsCategoryContainer(char* groupname, PRBool value, nsMsgGroupRecord *inGroupRecord) { nsresult rv; nsMsgGroupRecord* group = (inGroupRecord) ? inGroupRecord : FindOrCreateGroup(groupname); @@ -2472,7 +2472,7 @@ nsNNTPHost::SetIsCategoryContainer(const char* groupname, PRBool value, nsMsgGro } nsresult -nsNNTPHost::SetGroupNeedsExtraInfo(const char *groupname, PRBool value) +nsNNTPHost::SetGroupNeedsExtraInfo(char *groupname, PRBool value) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) return MK_OUT_OF_MEMORY; @@ -2483,7 +2483,7 @@ nsNNTPHost::SetGroupNeedsExtraInfo(const char *groupname, PRBool value) char* -nsNNTPHost::GetCategoryContainer(const char* groupname, nsMsgGroupRecord *inGroupRecord) +nsNNTPHost::GetCategoryContainer(char* groupname, nsMsgGroupRecord *inGroupRecord) { nsMsgGroupRecord* group = (inGroupRecord) ? inGroupRecord : FindOrCreateGroup(groupname); if (group) { @@ -2494,7 +2494,7 @@ nsNNTPHost::GetCategoryContainer(const char* groupname, nsMsgGroupRecord *inGrou } nsINNTPNewsgroup * -nsNNTPHost::GetCategoryContainerFolderInfo(const char *groupname) +nsNNTPHost::GetCategoryContainerFolderInfo(char *groupname) { nsINNTPNewsgroup *newsgroup=NULL; nsresult rv; @@ -2517,7 +2517,7 @@ nsNNTPHost::GetCategoryContainerFolderInfo(const char *groupname) nsresult -nsNNTPHost::GetIsVirtualGroup(const char* groupname, PRBool *retval) +nsNNTPHost::GetIsVirtualGroup(char* groupname, PRBool *retval) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) { @@ -2530,12 +2530,12 @@ nsNNTPHost::GetIsVirtualGroup(const char* groupname, PRBool *retval) nsresult -nsNNTPHost::SetIsVirtualGroup(const char* groupname, PRBool value) +nsNNTPHost::SetIsVirtualGroup(char* groupname, PRBool value) { return SetIsVirtualGroup(groupname, value, nsnull); } nsresult -nsNNTPHost::SetIsVirtualGroup(const char* groupname, PRBool value, +nsNNTPHost::SetIsVirtualGroup(char* groupname, PRBool value, nsMsgGroupRecord* inGroupRecord) { nsMsgGroupRecord* group = (inGroupRecord) ? inGroupRecord : FindOrCreateGroup(groupname); @@ -2550,7 +2550,7 @@ nsNNTPHost::SetIsVirtualGroup(const char* groupname, PRBool value, PRBool -nsNNTPHost::IsGroup(const char* groupname) +nsNNTPHost::IsGroup(char* groupname) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) return PR_FALSE; @@ -2559,7 +2559,7 @@ nsNNTPHost::IsGroup(const char* groupname) int -nsNNTPHost::SetIsGroup(const char* groupname, PRBool value) +nsNNTPHost::SetIsGroup(char* groupname, PRBool value) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) return MK_OUT_OF_MEMORY; @@ -2570,7 +2570,7 @@ nsNNTPHost::SetIsGroup(const char* groupname, PRBool value) PRBool -nsNNTPHost::IsHTMLOk(const char* groupname) +nsNNTPHost::IsHTMLOk(char* groupname) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) return PR_FALSE; @@ -2583,7 +2583,7 @@ nsNNTPHost::IsHTMLOk(const char* groupname) PRBool -nsNNTPHost::IsHTMLOKGroup(const char* groupname) +nsNNTPHost::IsHTMLOKGroup(char* groupname) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) return PR_FALSE; @@ -2592,7 +2592,7 @@ nsNNTPHost::IsHTMLOKGroup(const char* groupname) int -nsNNTPHost::SetIsHTMLOKGroup(const char* groupname, PRBool value) +nsNNTPHost::SetIsHTMLOKGroup(char* groupname, PRBool value) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) return MK_OUT_OF_MEMORY; @@ -2603,7 +2603,7 @@ nsNNTPHost::SetIsHTMLOKGroup(const char* groupname, PRBool value) PRBool -nsNNTPHost::IsHTMLOKTree(const char* groupname) +nsNNTPHost::IsHTMLOKTree(char* groupname) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) return PR_FALSE; @@ -2612,7 +2612,7 @@ nsNNTPHost::IsHTMLOKTree(const char* groupname) int -nsNNTPHost::SetIsHTMLOKTree(const char* groupname, PRBool value) +nsNNTPHost::SetIsHTMLOKTree(char* groupname, PRBool value) { nsMsgGroupRecord* group = FindOrCreateGroup(groupname); if (!group) return MK_OUT_OF_MEMORY; @@ -2627,7 +2627,7 @@ nsNNTPHost::SetIsHTMLOKTree(const char* groupname, PRBool value) nsMsgGroupRecord* nsNNTPHost::FindGroupInBlock(nsMsgGroupRecord* parent, - const char* groupname, + char* groupname, PRInt32* comp) { #ifdef UNREADY_CODE @@ -2720,7 +2720,7 @@ RELOAD: nsMsgGroupRecord* -nsNNTPHost::LoadSingleEntry(nsMsgGroupRecord* parent, const char* groupname, +nsNNTPHost::LoadSingleEntry(nsMsgGroupRecord* parent, char* groupname, PRInt32 min, PRInt32 max) { #ifdef UNREADY_CODE @@ -2774,7 +2774,7 @@ nsNNTPHost::LoadSingleEntry(nsMsgGroupRecord* parent, const char* groupname, nsMsgGroupRecord* -nsNNTPHost::FindOrCreateGroup(const char* groupname, +nsNNTPHost::FindOrCreateGroup(char* groupname, int* statusOfMakingGroup) { char buf[256]; @@ -2859,7 +2859,7 @@ nsNNTPHost::FindOrCreateGroup(const char* groupname, int -nsNNTPHost::NoticeNewGroup(const char* groupname, nsMsgGroupRecord **outGroupRecord) +nsNNTPHost::NoticeNewGroup(char* groupname, nsMsgGroupRecord **outGroupRecord) { int status = 0; nsMsgGroupRecord* group = FindOrCreateGroup(groupname, &status); @@ -2922,7 +2922,7 @@ nsNNTPHost::AssureAllDescendentsLoaded(nsMsgGroupRecord* group) } nsresult -nsNNTPHost::GroupNotFound(const char *groupName, PRBool opening) +nsNNTPHost::GroupNotFound(char *groupName, PRBool opening) { // if no group command has succeeded, don't blow away categories. // The server might be wedged... @@ -3091,7 +3091,7 @@ int nsNNTPHost::DeleteFiles () * (stolen from msgglue.cpp - MSG_NewsGroupAndNumberOfID) */ nsresult -nsNNTPHost::GetNewsgroupAndNumberOfID(const char *message_id, +nsNNTPHost::GetNewsgroupAndNumberOfID(char *message_id, nsINNTPNewsgroup **group, PRUint32 *messageNumber) { @@ -3119,10 +3119,10 @@ nsNNTPHost::GetNewsgroupAndNumberOfID(const char *message_id, /* this function originally lived in a pane */ nsresult -nsNNTPHost::AddNewNewsgroup(const char *groupName, +nsNNTPHost::AddNewNewsgroup(char *groupName, PRInt32 first, PRInt32 last, - const char *flags, + char *flags, PRBool xactiveFlags) { nsMsgGroupRecord *groupRecord = NULL; @@ -3190,7 +3190,7 @@ nsNNTPHost::AddNewNewsgroup(const char *groupName, } nsresult -nsNNTPHost::DisplaySubscribedGroup(const char *group, +nsNNTPHost::DisplaySubscribedGroup(char *group, PRInt32 first_message, PRInt32 last_message, PRInt32 total_messages, @@ -3236,4 +3236,16 @@ nsNNTPHost::getFolderFor(_type * _class) {\ MSG_IMPL_GETFOLDER(nsINNTPNewsgroup) MSG_IMPL_GETFOLDER(nsINNTPCategoryContainer) - + +// this is just to make sure we can instantiate a news host +nsresult +NS_NewNNTPHost(nsINNTPHost *aNNTPHost) +{ + nsresult rv; + nsNNTPHost *aHost = new nsNNTPHost("news", 119); + if (aHost) + return aHost->QueryInterface(nsINNTPHost::IID(), + (void **)aNNTPHost); + return NS_ERROR_NOT_INITIALIZED; + +} diff --git a/mailnews/news/src/nsNNTPNewsgroupPost.cpp b/mailnews/news/src/nsNNTPNewsgroupPost.cpp index 55cd6df0f86b..11baaab21a98 100644 --- a/mailnews/news/src/nsNNTPNewsgroupPost.cpp +++ b/mailnews/news/src/nsNNTPNewsgroupPost.cpp @@ -72,7 +72,7 @@ public: NS_IMPL_CLASS_GETSET_STR(Date, m_header[HEADER_DATE]); NS_IMPL_CLASS_GETSET_STR(Subject, m_header[HEADER_SUBJECT]); - NS_IMETHOD AddNewsgroup(const char *newsgroupName); + NS_IMETHOD AddNewsgroup(char *newsgroupName); NS_IMPL_CLASS_GETTER_STR(GetNewsgroups, m_header[HEADER_NEWSGROUPS]); NS_IMETHOD GetMessageID(char * *aMessageID); @@ -90,13 +90,13 @@ public: NS_IMPL_CLASS_GETSET_STR(Organization, m_header[HEADER_ORGANIZATION]); NS_IMPL_CLASS_GETSET_STR(Body, m_body); - NS_IMETHOD AddReference(const char *referenceID); + NS_IMETHOD AddReference(char *referenceID); NS_IMPL_CLASS_GETTER_STR(GetReferences, m_header[HEADER_REFERENCES]); NS_IMETHOD isValid(PRBool *_retval); - NS_IMETHOD MakeControlCancel(const char *messageID); + NS_IMETHOD MakeControlCancel(char *messageID); NS_IMPL_CLASS_GETTER(GetIsControl, PRBool, m_isControl); @@ -189,7 +189,7 @@ nsNNTPNewsgroupPost::isValid(PRBool *_retval) /* XXX - I'm just guessing at how this works, see RFC850 for more */ nsresult -nsNNTPNewsgroupPost::MakeControlCancel(const char *messageID) +nsNNTPNewsgroupPost::MakeControlCancel(char *messageID) { char *new_subject = (char *)PR_Calloc(PL_strlen(messageID) + PL_strlen("CANCEL ") + 1, @@ -272,13 +272,13 @@ nsNNTPNewsgroupPost::appendAndAlloc(char *string, } nsresult -nsNNTPNewsgroupPost::AddNewsgroup(const char *newsgroup) +nsNNTPNewsgroupPost::AddNewsgroup(char *newsgroup) { m_header[HEADER_NEWSGROUPS]=appendAndAlloc(m_header[HEADER_NEWSGROUPS], newsgroup, PR_TRUE); return NS_OK; } nsresult -nsNNTPNewsgroupPost::AddReference(const char *reference) +nsNNTPNewsgroupPost::AddReference(char *reference) { m_header[HEADER_REFERENCES]=appendAndAlloc(m_header[HEADER_REFERENCES], reference, PR_FALSE); return NS_OK; diff --git a/mailnews/news/tests/nntp/.cvsignore b/mailnews/news/tests/nntp/.cvsignore new file mode 100644 index 000000000000..c0941b1705ad --- /dev/null +++ b/mailnews/news/tests/nntp/.cvsignore @@ -0,0 +1,3 @@ +Makefile +nntpTest + diff --git a/mailnews/news/tests/nsNNTPHostStub.cpp b/mailnews/news/tests/nsNNTPHostStub.cpp index 3b1391942d00..0321674ef697 100644 --- a/mailnews/news/tests/nsNNTPHostStub.cpp +++ b/mailnews/news/tests/nsNNTPHostStub.cpp @@ -37,7 +37,7 @@ class nsNNTPHostStub : public nsINNTPHost { public: - nsNNTPHostStub(const char *name, PRInt32 port); + nsNNTPHostStub(char *name, PRInt32 port); virtual ~nsNNTPHostStub(); @@ -49,8 +49,8 @@ public: NS_IMETHOD GetSupportsExtensions(PRBool *aSupportsExtensions); NS_IMETHOD SetSupportsExtensions(PRBool aSupportsExtensions); - NS_IMETHOD AddExtension (const char *ext); - NS_IMETHOD QueryExtension (const char *ext, PRBool *_retval); + NS_IMETHOD AddExtension (char *ext); + NS_IMETHOD QueryExtension (char *ext, PRBool *_retval); NS_IMETHOD GetPostingAllowed(PRBool * aPostingAllowed); NS_IMETHOD SetPostingAllowed(PRBool aPostingAllowed); @@ -60,32 +60,32 @@ public: NS_IMPL_CLASS_GETSET(LastUpdatedTime, PRInt64, m_lastGroupUpdate); - NS_IMETHOD GetNewsgroupList(const char *groupname, nsINNTPNewsgroupList **_retval); + NS_IMETHOD GetNewsgroupList(char *groupname, nsINNTPNewsgroupList **_retval); - NS_IMETHOD GetNewsgroupAndNumberOfID(const char *message_id, + NS_IMETHOD GetNewsgroupAndNumberOfID(char *message_id, nsINNTPNewsgroup **group, PRUint32 *messageNumber); /* get this from MSG_Master::FindNewsFolder */ - NS_IMETHOD FindNewsgroup(const char *groupname, PRBool create, + NS_IMETHOD FindNewsgroup(char *groupname, PRBool create, nsINNTPNewsgroup **_retval) { return FindGroup(groupname, _retval);} - NS_IMETHOD AddPropertyForGet (const char *property, const char *value); - NS_IMETHOD QueryPropertyForGet (const char *property, char **_retval); + NS_IMETHOD AddPropertyForGet (char *property, char *value); + NS_IMETHOD QueryPropertyForGet (char *property, char **_retval); - NS_IMETHOD AddSearchableGroup(const char *groupname); + NS_IMETHOD AddSearchableGroup(char *groupname); // should these go into interfaces? - NS_IMETHOD QuerySearchableGroup (const char *group, PRBool *); - //NS_IMETHOD QuerySearchableGroupCharsets(const char *group, char **); + NS_IMETHOD QuerySearchableGroup (char *group, PRBool *); + //NS_IMETHOD QuerySearchableGroupCharsets(char *group, char **); // Virtual groups - NS_IMETHOD AddVirtualGroup(const char *responseText) { return NS_OK;} - NS_IMETHOD SetIsVirtualGroup(const char *groupname, PRBool isVirtual); - NS_IMETHOD GetIsVirtualGroup(const char *groupname, PRBool *_retval); + NS_IMETHOD AddVirtualGroup(char *responseText) { return NS_OK;} + NS_IMETHOD SetIsVirtualGroup(char *groupname, PRBool isVirtual); + NS_IMETHOD GetIsVirtualGroup(char *groupname, PRBool *_retval); // custom/searchable headers - NS_IMETHOD AddSearchableHeader(const char *headerName); - NS_IMETHOD QuerySearchableHeader(const char *headerName, PRBool *_retval); + NS_IMETHOD AddSearchableHeader(char *headerName); + NS_IMETHOD QuerySearchableHeader(char *headerName, PRBool *_retval); // Go load the newsrc for this host. Creates the subscribed hosts as // children of the given nsIMsgFolder. @@ -108,21 +108,21 @@ public: NS_IMETHOD SetNewsRCFilename(char *); - NS_IMETHOD FindGroup(const char* name, nsINNTPNewsgroup* *_retval); - NS_IMETHOD AddGroup(const char *groupname, + NS_IMETHOD FindGroup(char* name, nsINNTPNewsgroup* *_retval); + NS_IMETHOD AddGroup(char *groupname, nsINNTPNewsgroup **retval); - //NS_IMETHOD AddGroup(const char *groupname, + //NS_IMETHOD AddGroup(char *groupname, // nsMsgGroupRecord *groupRecord, // nsINNTPNewsgroup **retval); - NS_IMETHOD RemoveGroupByName(const char *groupName); - NS_IMETHOD RemoveGroup(const nsINNTPNewsgroup*); + NS_IMETHOD RemoveGroupByName(char *groupName); + NS_IMETHOD RemoveGroup(nsINNTPNewsgroup*); - NS_IMETHOD AddNewNewsgroup(const char *groupName, + NS_IMETHOD AddNewNewsgroup(char *groupName, PRInt32 first, PRInt32 last, - const char *flags, + char *flags, PRBool xactiveFlags); /* Name of directory to store newsgroup @@ -137,7 +137,7 @@ public: individual strings must not be free'd. */ NS_IMETHOD GetGroupList(char **_retval); - NS_IMETHOD DisplaySubscribedGroup(const char *groupname, + NS_IMETHOD DisplaySubscribedGroup(char *groupname, PRInt32 first_message, PRInt32 last_message, PRInt32 total_messages, @@ -169,19 +169,19 @@ private: // Returns the pretty name for the given group. The resulting string // must be free'd using delete[]. - char* GetPrettyName(const char* groupname) { return m_prettyName;} - NS_IMETHOD SetPrettyName(const char* groupname, const char* prettyname); + char* GetPrettyName(char* groupname) { return m_prettyName;} + NS_IMETHOD SetPrettyName(char* groupname, char* prettyname); - NS_IMETHOD SetGroupNeedsExtraInfo(const char *groupname, PRBool value); + NS_IMETHOD SetGroupNeedsExtraInfo(char *groupname, PRBool value); // Finds the container newsgroup for this category (or NULL if this isn't // a category). The resulting string must be free'd using delete[]. - char* GetCategoryContainer(const char* groupname, nsMsgGroupRecord *inGroupRecord = NULL); - nsINNTPNewsgroup *GetCategoryContainerFolderInfo(const char *groupname); + char* GetCategoryContainer(char* groupname, nsMsgGroupRecord *inGroupRecord = NULL); + nsINNTPNewsgroup *GetCategoryContainerFolderInfo(char *groupname); nsMsgGroupRecord* GetGroupTree() {return m_groupTree;} - NS_IMETHOD GroupNotFound(const char *groupName, PRBool opening); + NS_IMETHOD GroupNotFound(char *groupName, PRBool opening); protected: @@ -246,7 +246,7 @@ protected: NS_IMPL_ISUPPORTS(nsNNTPHostStub, nsINNTPHost::IID()); -nsNNTPHostStub::nsNNTPHostStub(const char * name, PRInt32 port) +nsNNTPHostStub::nsNNTPHostStub(char * name, PRInt32 port) { NS_INIT_REFCNT(); m_supportsExtensions = PR_FALSE; @@ -276,13 +276,13 @@ nsresult nsNNTPHostStub::SetSupportsExtensions(PRBool aSupportsExtensions) } -nsresult nsNNTPHostStub::AddExtension(const char * extension) +nsresult nsNNTPHostStub::AddExtension(char * extension) { printf("Adding extension: %s. \n", extension ? extension : "invalid extension"); return NS_OK; } -nsresult nsNNTPHostStub::QueryExtension(const char * extension, PRBool * aRetValue) +nsresult nsNNTPHostStub::QueryExtension(char * extension, PRBool * aRetValue) { printf("Querying extension %s. \n", extension ? extension : "invalid extension"); if (PL_strstr(extension, "SEARCH")) @@ -323,7 +323,7 @@ nsresult nsNNTPHostStub::SetPushAuth(PRBool aPushAuth) } -nsresult nsNNTPHostStub::AddPropertyForGet (const char *property, const char *value) +nsresult nsNNTPHostStub::AddPropertyForGet (char *property, char *value) { char *tmp = NULL; @@ -341,11 +341,11 @@ nsresult nsNNTPHostStub::AddPropertyForGet (const char *property, const char *va return NS_OK; } -nsresult nsNNTPHostStub::QueryPropertyForGet (const char *property, char **retval) +nsresult nsNNTPHostStub::QueryPropertyForGet (char *property, char **retval) { *retval=NULL; for (int i = 0; i < m_propertiesForGet.Count(); i++) - if (!PL_strcasecmp(property, (const char *) m_propertiesForGet[i])) { + if (!PL_strcasecmp(property, (char *) m_propertiesForGet[i])) { *retval = (char *)m_valuesForGet[i]; printf("Retrieving property %s for get. \n", *retval); return NS_OK; @@ -354,7 +354,7 @@ nsresult nsNNTPHostStub::QueryPropertyForGet (const char *property, char **retva return NS_OK; } -nsresult nsNNTPHostStub::AddSearchableGroup (const char *group) +nsresult nsNNTPHostStub::AddSearchableGroup (char *group) { PRBool searchableGroup; nsresult rv = QuerySearchableGroup(group, &searchableGroup); @@ -379,12 +379,12 @@ nsresult nsNNTPHostStub::AddSearchableGroup (const char *group) return NS_OK; } -nsresult nsNNTPHostStub::QuerySearchableGroup (const char *group, PRBool *_retval) +nsresult nsNNTPHostStub::QuerySearchableGroup (char *group, PRBool *_retval) { *_retval = PR_FALSE; for (int i = 0; i < m_searchableGroups.Count(); i++) { - const char *searchableGroup = (const char*) m_searchableGroups[i]; + char *searchableGroup = (char*) m_searchableGroups[i]; char *starInSearchableGroup = NULL; if (!PL_strcmp(searchableGroup, "*")) { @@ -406,18 +406,18 @@ nsresult nsNNTPHostStub::QuerySearchableGroup (const char *group, PRBool *_retva return NS_OK; } -nsresult nsNNTPHostStub::SetIsVirtualGroup(const char * groupname, PRBool isVirtual) +nsresult nsNNTPHostStub::SetIsVirtualGroup(char * groupname, PRBool isVirtual) { return NS_OK; } -nsresult nsNNTPHostStub::GetIsVirtualGroup(const char * groupname, PRBool * isVirtual) +nsresult nsNNTPHostStub::GetIsVirtualGroup(char * groupname, PRBool * isVirtual) { *isVirtual = PR_FALSE; return NS_OK; } -nsresult nsNNTPHostStub::AddSearchableHeader (const char *header) +nsresult nsNNTPHostStub::AddSearchableHeader (char *header) { PRBool searchable; nsresult rv = QuerySearchableHeader(header, &searchable); @@ -432,7 +432,7 @@ nsresult nsNNTPHostStub::AddSearchableHeader (const char *header) return NS_OK; } -nsresult nsNNTPHostStub::QuerySearchableHeader(const char *header, PRBool *retval) +nsresult nsNNTPHostStub::QuerySearchableHeader(char *header, PRBool *retval) { *retval=PR_FALSE; for (int i = 0; i < m_searchableHeaders.Count(); i++) @@ -443,16 +443,16 @@ nsresult nsNNTPHostStub::QuerySearchableHeader(const char *header, PRBool *retva return NS_OK; } -nsresult nsNNTPHostStub::GroupNotFound(const char *groupName, PRBool opening) +nsresult nsNNTPHostStub::GroupNotFound(char *groupName, PRBool opening) { printf("Group %s not found. \n", groupName); return NS_OK; } -nsresult nsNNTPHostStub::AddNewNewsgroup(const char *groupName, +nsresult nsNNTPHostStub::AddNewNewsgroup(char *groupName, PRInt32 first, PRInt32 last, - const char *flags, + char *flags, PRBool xactiveFlags) { printf ("Adding new newsgroup: %s. \n", groupName); @@ -496,7 +496,7 @@ nsresult nsNNTPHostStub::GetFirstGroupNeedingCounts(char ** aFirstGroup) return NS_OK; } -nsresult nsNNTPHostStub::DisplaySubscribedGroup(const char * groupname, PRInt32 first_message, PRInt32 last_message, PRInt32 total_messages, +nsresult nsNNTPHostStub::DisplaySubscribedGroup(char * groupname, PRInt32 first_message, PRInt32 last_message, PRInt32 total_messages, PRBool visit_now) { printf("Displaying subscribed group %s which has %d total messages. \n", groupname, total_messages); @@ -536,18 +536,18 @@ nsresult nsNNTPHostStub::GetFirstGroupNeedingExtraInfo(char ** retval) return NS_OK; } -nsresult nsNNTPHostStub::SetGroupNeedsExtraInfo(const char * groupName, PRBool needsExtraInfo) +nsresult nsNNTPHostStub::SetGroupNeedsExtraInfo(char * groupName, PRBool needsExtraInfo) { printf("Setting group %s to need extra info.\n", groupName); return NS_OK; } -nsresult nsNNTPHostStub::GetNewsgroupAndNumberOfID(const char *messageID, nsINNTPNewsgroup ** group, PRUint32 * messageNumber) +nsresult nsNNTPHostStub::GetNewsgroupAndNumberOfID(char *messageID, nsINNTPNewsgroup ** group, PRUint32 * messageNumber) { return NS_OK; } -nsresult nsNNTPHostStub::SetPrettyName(const char * groupname, const char * prettyname) +nsresult nsNNTPHostStub::SetPrettyName(char * groupname, char * prettyname) { printf("Setting group %s to have pretty name %s. \n", groupname, prettyname); return NS_OK; @@ -590,7 +590,7 @@ nsresult nsNNTPHostStub::SetNewsRCFilename(char * fileName) return NS_OK; } -nsresult nsNNTPHostStub::GetNewsgroupList(const char *groupname, nsINNTPNewsgroupList **_retval) +nsresult nsNNTPHostStub::GetNewsgroupList(char *groupname, nsINNTPNewsgroupList **_retval) { nsresult rv = NS_OK; // find group with the group name... @@ -605,7 +605,7 @@ nsresult nsNNTPHostStub::GetNewsgroupList(const char *groupname, nsINNTPNewsgrou return rv; } -nsresult nsNNTPHostStub::FindGroup(const char * name, nsINNTPNewsgroup ** retVal) +nsresult nsNNTPHostStub::FindGroup(char * name, nsINNTPNewsgroup ** retVal) { PRBool found = PR_FALSE; *retVal = nsnull; @@ -637,7 +637,7 @@ nsresult nsNNTPHostStub::FindGroup(const char * name, nsINNTPNewsgroup ** retVal return NS_OK; } -nsresult nsNNTPHostStub::AddGroup(const char *groupname, nsINNTPNewsgroup **retval) +nsresult nsNNTPHostStub::AddGroup(char *groupname, nsINNTPNewsgroup **retval) { nsresult rv = NS_OK; printf ("Adding group %s to host.\n", groupname); @@ -667,7 +667,7 @@ nsresult nsNNTPHostStub::AddGroup(const char *groupname, nsINNTPNewsgroup **retv return NS_OK; } -nsresult nsNNTPHostStub::RemoveGroup(const nsINNTPNewsgroup * group) +nsresult nsNNTPHostStub::RemoveGroup(nsINNTPNewsgroup * group) { char * name = nsnull; ((nsINNTPNewsgroup *) group)->GetName(&name); @@ -677,7 +677,7 @@ nsresult nsNNTPHostStub::RemoveGroup(const nsINNTPNewsgroup * group) return NS_OK; } -nsresult nsNNTPHostStub::RemoveGroupByName(const char *groupName) +nsresult nsNNTPHostStub::RemoveGroupByName(char *groupName) { printf ("Removing group %s. \n", groupName); return NS_OK; @@ -699,7 +699,7 @@ nsresult nsNNTPHostStub::GetGroupList(char ** retVal) NS_BEGIN_EXTERN_C -nsresult NS_NewNNTPHost(nsINNTPHost ** aInstancePtr, const char * name, PRUint32 port) +nsresult NS_NewNNTPHost(nsINNTPHost ** aInstancePtr, char * name, PRUint32 port) { nsresult rv = NS_OK; if (aInstancePtr) diff --git a/mailnews/news/tests/nsNNTPNewsgroupListStub.cpp b/mailnews/news/tests/nsNNTPNewsgroupListStub.cpp index e0d83319321b..ef06d0aa724c 100644 --- a/mailnews/news/tests/nsNNTPNewsgroupListStub.cpp +++ b/mailnews/news/tests/nsNNTPNewsgroupListStub.cpp @@ -50,9 +50,9 @@ class nsNNTPNewsgroupListStub : public nsINNTPNewsgroupList { NS_IMETHOD InitXOVER(PRInt32 first_message, PRInt32 last_message); - NS_IMETHOD ProcessXOVER(const char *line, PRInt32 *status); + NS_IMETHOD ProcessXOVER(char *line, PRInt32 *status); - NS_IMETHOD ProcessNonXOVER(const char *line); + NS_IMETHOD ProcessNonXOVER(char *line); NS_IMETHOD ResetXOVER(); NS_IMETHOD FinishXOVER(PRInt32 status, PRInt32 *newstatus); @@ -222,7 +222,7 @@ nsresult nsNNTPNewsgroupListStub::InitXOVER(PRInt32 first_msg, PRInt32 last_msg) #define NEWS_ART_DISPLAY_FREQ 10 -nsresult nsNNTPNewsgroupListStub::ProcessXOVER(const char *line, int *status) +nsresult nsNNTPNewsgroupListStub::ProcessXOVER(char *line, int *status) { const char *next; PRUint32 message_number=0; @@ -288,7 +288,7 @@ nsNNTPNewsgroupListStub::ResetXOVER() slow anyway that this just doesn't matter. */ -nsresult nsNNTPNewsgroupListStub::ProcessNonXOVER (const char * /*line*/) +nsresult nsNNTPNewsgroupListStub::ProcessNonXOVER (char * /*line*/) { // ### dmb write me return NS_OK;