From 3e75b8c0d28e9452d7ad9b57f8ecc5bdbf0b0c24 Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Tue, 26 Jan 1999 23:17:39 +0000 Subject: [PATCH] add declarations for factories --- mailnews/news/src/nsNNTPCategoryContainer.h | 33 ++++++++++++++++++ mailnews/news/src/nsNNTPHost.cpp | 11 ++++-- mailnews/news/src/nsNNTPNewsgroup.h | 37 +++++++++++++++++++++ mailnews/news/src/nsNNTPNewsgroupList.cpp | 2 ++ 4 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 mailnews/news/src/nsNNTPCategoryContainer.h create mode 100644 mailnews/news/src/nsNNTPNewsgroup.h diff --git a/mailnews/news/src/nsNNTPCategoryContainer.h b/mailnews/news/src/nsNNTPCategoryContainer.h new file mode 100644 index 000000000000..60b9accb86eb --- /dev/null +++ b/mailnews/news/src/nsNNTPCategoryContainer.h @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +#ifndef __nsNNTPCategoryContainer_h +#define __nsNNTPCategoryContainer_h + +#include "nsINNTPCategoryContainer.h" +#include "nsINNTPNewsgroup.h" + +NS_BEGIN_EXTERN_C +nsresult +NS_NewCategoryContainerFromNewsgroup(nsINNTPCategoryContainer **, + nsINNTPNewsgroup* ); + + +NS_END_EXTERN_C + +#endif diff --git a/mailnews/news/src/nsNNTPHost.cpp b/mailnews/news/src/nsNNTPHost.cpp index 7fa9956f5205..e430e84f939d 100644 --- a/mailnews/news/src/nsNNTPHost.cpp +++ b/mailnews/news/src/nsNNTPHost.cpp @@ -22,7 +22,10 @@ #include "nntpCore.h" #include "nsINNTPHost.h" #include "nsINNTPCategory.h" + #include "nsINNTPCategoryContainer.h" +#include "nsNNTPCategoryContainer.h" + #include "nsNNTPHost.h" #include "nsNNTPArticleSet.h" @@ -30,6 +33,8 @@ #include "nsMsgPtrArray.h" #include "nsINNTPNewsgroup.h" +#include "nsNNTPNewsgroup.h" + #include "nsIMsgFolder.h" /* for XP_FilePerm */ @@ -1863,14 +1868,14 @@ nsNNTPHost::RemoveGroup (const nsINNTPNewsgroup *newsInfo) { PRBool subscribed; if (!newsInfo) return NS_ERROR_NULL_POINTER; - nsresult rv = newsInfo->GetSubscribed(&subscribed); + nsresult rv = ((nsINNTPNewsgroup *)newsInfo)->GetSubscribed(&subscribed); if (NS_SUCCEEDED(rv) && subscribed) { - newsInfo->SetSubscribed(PR_FALSE); + ((nsINNTPNewsgroup *)newsInfo)->SetSubscribed(PR_FALSE); #ifdef HAVE_MASTER m_master->BroadcastFolderDeleted (newsInfo); #endif - nsIMsgFolder* newsFolder = getFolderFor(newsInfo); + nsIMsgFolder* newsFolder = getFolderFor((nsINNTPNewsgroup*)newsInfo); if (newsFolder) { m_hostinfo->RemoveSubfolder(newsFolder); NS_RELEASE(newsFolder); diff --git a/mailnews/news/src/nsNNTPNewsgroup.h b/mailnews/news/src/nsNNTPNewsgroup.h new file mode 100644 index 000000000000..8d780c466f4f --- /dev/null +++ b/mailnews/news/src/nsNNTPNewsgroup.h @@ -0,0 +1,37 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * + * The contents of this file are subject to the Netscape Public License + * Version 1.0 (the "NPL"); you may not use this file except in + * compliance with the NPL. You may obtain a copy of the NPL at + * http://www.mozilla.org/NPL/ + * + * Software distributed under the NPL is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL + * for the specific language governing rights and limitations under the + * NPL. + * + * The Initial Developer of this code under the NPL is Netscape + * Communications Corporation. Portions created by Netscape are + * Copyright (C) 1998 Netscape Communications Corporation. All Rights + * Reserved. + */ + +#ifndef __nsNNTPNewsgroup_h +#define __nsNNTPNewsgroup_h + +#include "nsINNTPNewsgroup.h" +#include "nsNNTPArticleSet.h" + +NS_BEGIN_EXTERN_C + +nsresult +NS_NewNewsgroup(nsINNTPNewsgroup **info, + char *line, + nsNNTPArticleSet *set, + PRBool subscribed, + nsINNTPHost *host, + int depth); + +NS_END_EXTERN_C +#endif + diff --git a/mailnews/news/src/nsNNTPNewsgroupList.cpp b/mailnews/news/src/nsNNTPNewsgroupList.cpp index 31c137a526e7..b7bbba609472 100644 --- a/mailnews/news/src/nsNNTPNewsgroupList.cpp +++ b/mailnews/news/src/nsNNTPNewsgroupList.cpp @@ -84,6 +84,7 @@ class nsNNTPNewsgroupList : public nsINNTPNewsgroupList { public: nsNNTPNewsgroupList(nsINNTPHost *, nsINNTPNewsgroup*); + nsNNTPNewsgroupList(); virtual ~nsNNTPNewsgroupList(); static void operator delete(void *); NS_DECL_ISUPPORTS; @@ -107,6 +108,7 @@ public: private: + NS_METHOD Init(nsINNTPHost *, nsINNTPNewsgroup*); NS_METHOD InitNewsgroupList(const char *url, const char *groupName); NS_METHOD CleanUp();