1999-05-10 21:47:07 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
1999-11-06 03:43:54 +00:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-05-10 21:47:07 +00:00
|
|
|
*
|
1999-11-06 03:43:54 +00:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1999-05-10 21:47:07 +00:00
|
|
|
*
|
1999-11-06 03:43:54 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-05-10 21:47:07 +00:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 03:43:54 +00:00
|
|
|
* Copyright (C) 1999 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-05-10 21:47:07 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsMsgDBFolder_h__
|
|
|
|
#define nsMsgDBFolder_h__
|
|
|
|
|
|
|
|
#include "msgCore.h"
|
|
|
|
#include "nsMsgFolder.h"
|
|
|
|
#include "nsIDBFolderInfo.h"
|
|
|
|
#include "nsIMsgDatabase.h"
|
1999-08-07 03:53:12 +00:00
|
|
|
#include "nsIMessage.h"
|
1999-05-10 21:47:07 +00:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIDBChangeListener.h"
|
1999-09-15 00:59:03 +00:00
|
|
|
#include "nsIUrlListener.h"
|
1999-05-10 21:47:07 +00:00
|
|
|
|
1999-07-17 03:26:24 +00:00
|
|
|
class nsIMsgFolderCacheElement;
|
2000-02-04 05:48:50 +00:00
|
|
|
|
1999-05-10 21:47:07 +00:00
|
|
|
/*
|
|
|
|
* nsMsgDBFolder
|
|
|
|
* class derived from nsMsgFolder for those folders that use an nsIMsgDatabase
|
|
|
|
*/
|
|
|
|
|
1999-10-20 21:58:21 +00:00
|
|
|
class NS_MSG_BASE nsMsgDBFolder: public nsMsgFolder,
|
|
|
|
public nsIDBChangeListener,
|
|
|
|
public nsIUrlListener
|
1999-05-10 21:47:07 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsMsgDBFolder(void);
|
|
|
|
virtual ~nsMsgDBFolder(void);
|
1999-09-09 06:02:05 +00:00
|
|
|
NS_DECL_NSIDBCHANGELISTENER
|
|
|
|
|
1999-09-17 23:12:44 +00:00
|
|
|
NS_IMETHOD StartFolderLoading(void);
|
|
|
|
NS_IMETHOD EndFolderLoading(void);
|
2000-01-28 01:22:33 +00:00
|
|
|
NS_IMETHOD GetThreads(nsIMsgWindow *aMsgWindow, nsISimpleEnumerator** threadEnumerator);
|
1999-05-10 21:47:07 +00:00
|
|
|
NS_IMETHOD GetThreadForMessage(nsIMessage *message, nsIMsgThread **thread);
|
|
|
|
NS_IMETHOD HasMessage(nsIMessage *message, PRBool *hasMessage);
|
1999-06-03 22:56:14 +00:00
|
|
|
NS_IMETHOD GetCharset(PRUnichar * *aCharset);
|
1999-09-19 23:46:35 +00:00
|
|
|
NS_IMETHOD SetCharset(const PRUnichar * aCharset);
|
2000-06-23 03:19:17 +00:00
|
|
|
//NS_IMETHOD HasNewMessages(PRBool *hasNewMessages);
|
2000-01-28 23:25:17 +00:00
|
|
|
NS_IMETHOD GetFirstNewMessage(nsIMessage **firstNewMessage);
|
|
|
|
NS_IMETHOD ClearNewMessages();
|
2000-03-15 06:26:31 +00:00
|
|
|
NS_IMETHOD GetFlags(PRUint32 *aFlags);
|
2000-05-15 14:55:22 +00:00
|
|
|
NS_IMETHOD GetExpungedBytes(PRUint32 *count);
|
1999-05-10 21:47:07 +00:00
|
|
|
|
2000-02-03 23:40:09 +00:00
|
|
|
NS_IMETHOD GetMsgDatabase(nsIMsgWindow *aMsgWindow,
|
|
|
|
nsIMsgDatabase** aMsgDatabase);
|
1999-06-21 22:56:18 +00:00
|
|
|
|
1999-05-10 21:47:07 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
1999-09-15 00:59:03 +00:00
|
|
|
NS_DECL_NSIURLLISTENER
|
|
|
|
|
1999-07-17 20:33:15 +00:00
|
|
|
NS_IMETHOD WriteToFolderCache(nsIMsgFolderCache *folderCache);
|
|
|
|
NS_IMETHOD WriteToFolderCacheElem(nsIMsgFolderCacheElement *element);
|
1999-12-17 03:05:04 +00:00
|
|
|
NS_IMETHOD ReadFromFolderCacheElem(nsIMsgFolderCacheElement *element);
|
1999-09-13 21:36:02 +00:00
|
|
|
NS_IMETHOD ManyHeadersToDownload(PRBool *_retval);
|
1999-07-17 03:26:24 +00:00
|
|
|
|
1999-07-24 21:10:53 +00:00
|
|
|
NS_IMETHOD MarkAllMessagesRead(void);
|
2000-03-14 05:34:42 +00:00
|
|
|
NS_IMETHOD MarkThreadRead(nsIMsgThread *thread);
|
|
|
|
|
1999-07-24 21:10:53 +00:00
|
|
|
|
1999-11-14 20:36:22 +00:00
|
|
|
NS_IMETHOD Shutdown(PRBool shutdownChildren);
|
2000-03-01 05:17:53 +00:00
|
|
|
NS_IMETHOD ForceDBClosed();
|
2000-06-23 03:19:17 +00:00
|
|
|
NS_IMETHOD GetHasNewMessages(PRBool *hasNewMessages);
|
|
|
|
NS_IMETHOD SetHasNewMessages(PRBool hasNewMessages);
|
1999-11-14 20:36:22 +00:00
|
|
|
|
1999-05-10 21:47:07 +00:00
|
|
|
protected:
|
|
|
|
virtual nsresult ReadDBFolderInfo(PRBool force);
|
2000-01-28 01:22:33 +00:00
|
|
|
virtual nsresult GetDatabase(nsIMsgWindow *aMsgWindow) = 0;
|
1999-05-14 21:03:26 +00:00
|
|
|
virtual nsresult SendFlagNotifications(nsISupports *item, PRUint32 oldFlags, PRUint32 newFlags);
|
2000-06-23 03:19:17 +00:00
|
|
|
nsresult CheckWithNewMessagesStatus(PRBool messageAdded);
|
1999-11-11 00:23:29 +00:00
|
|
|
nsresult OnKeyAddedOrDeleted(nsMsgKey aKeyChanged, nsMsgKey aParentKey , PRInt32 aFlags,
|
|
|
|
nsIDBChangeListener * aInstigator, PRBool added, PRBool doFlat, PRBool doThread);
|
1999-12-07 05:51:53 +00:00
|
|
|
nsresult CreatePlatformLeafNameForDisk(const char *userLeafName, nsFileSpec &baseDir, char **resultName);
|
1999-05-10 21:47:07 +00:00
|
|
|
|
2000-02-16 05:06:37 +00:00
|
|
|
nsresult GetFolderCacheKey(nsIFileSpec **aFileSpec);
|
2000-02-04 05:48:50 +00:00
|
|
|
nsresult GetFolderCacheElemFromFileSpec(nsIFileSpec *fileSpec, nsIMsgFolderCacheElement **cacheElement);
|
1999-05-10 21:47:07 +00:00
|
|
|
protected:
|
2000-05-14 20:35:46 +00:00
|
|
|
nsCOMPtr<nsIMsgDatabase> mDatabase;
|
1999-06-03 22:56:14 +00:00
|
|
|
nsString mCharset;
|
1999-09-17 23:12:44 +00:00
|
|
|
PRBool mAddListener;
|
2000-06-23 03:19:17 +00:00
|
|
|
PRBool mNewMessages;
|
1999-05-10 21:47:07 +00:00
|
|
|
|
2000-05-14 20:35:46 +00:00
|
|
|
static nsIAtom* mFolderLoadedAtom;
|
|
|
|
static nsIAtom* mDeleteOrMoveMsgCompletedAtom;
|
1999-05-10 21:47:07 +00:00
|
|
|
|
2000-05-14 20:35:46 +00:00
|
|
|
private:
|
|
|
|
static nsrefcnt mInstanceCount;
|
1999-05-10 21:47:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|