1999-04-07 02:34:19 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
1999-11-06 06:43:54 +03: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-04-07 02:34:19 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03: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-04-07 02:34:19 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-04-07 02:34:19 +04:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:43:54 +03:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-04-07 02:34:19 +04:00
|
|
|
*/
|
|
|
|
|
1999-10-05 09:53:31 +04:00
|
|
|
#ifndef nsMsgIncomingServer_h__
|
|
|
|
#define nsMsgIncomingServer_h__
|
|
|
|
|
1999-04-07 02:34:19 +04:00
|
|
|
#include "nsIMsgIncomingServer.h"
|
1999-04-16 04:36:52 +04:00
|
|
|
#include "nsIPref.h"
|
2000-03-28 08:58:05 +04:00
|
|
|
#include "nsIMsgFilterList.h"
|
1999-05-19 03:55:39 +04:00
|
|
|
#include "msgCore.h"
|
1999-05-27 03:56:21 +04:00
|
|
|
#include "nsIFolder.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2000-01-26 03:54:15 +03:00
|
|
|
#include "nsWeakReference.h"
|
2001-01-02 01:00:17 +03:00
|
|
|
#include "nsIMsgDatabase.h"
|
2001-07-16 06:40:48 +04:00
|
|
|
#include "nsIFileSpec.h"
|
1999-07-17 07:26:24 +04:00
|
|
|
|
|
|
|
class nsIMsgFolderCache;
|
2000-05-31 12:00:13 +04:00
|
|
|
class nsIMsgProtocolInfo;
|
1999-07-17 07:26:24 +04:00
|
|
|
|
1999-04-07 02:34:19 +04:00
|
|
|
/*
|
|
|
|
* base class for nsIMsgIncomingServer - derive your class from here
|
|
|
|
* if you want to get some free implementation
|
|
|
|
*
|
|
|
|
* this particular implementation is not meant to be used directly.
|
|
|
|
*/
|
|
|
|
|
2000-01-26 03:54:15 +03:00
|
|
|
class NS_MSG_BASE nsMsgIncomingServer : public nsIMsgIncomingServer,
|
|
|
|
public nsSupportsWeakReference
|
|
|
|
{
|
1999-04-07 02:34:19 +04:00
|
|
|
public:
|
|
|
|
nsMsgIncomingServer();
|
|
|
|
virtual ~nsMsgIncomingServer();
|
|
|
|
|
1999-09-09 08:11:38 +04:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIMSGINCOMINGSERVER
|
1999-06-15 07:47:59 +04:00
|
|
|
|
1999-04-11 00:55:30 +04:00
|
|
|
private:
|
|
|
|
nsIPref *m_prefs;
|
2000-05-31 12:00:13 +04:00
|
|
|
nsCString m_serverKey;
|
1999-08-31 08:39:43 +04:00
|
|
|
nsCString m_password;
|
1999-08-31 10:52:27 +04:00
|
|
|
PRBool m_serverBusy;
|
1999-04-07 02:34:19 +04:00
|
|
|
|
|
|
|
protected:
|
2000-01-26 03:54:15 +03:00
|
|
|
void getPrefName(const char *serverKey, const char *pref, nsCString& fullPrefName);
|
|
|
|
void getDefaultPrefName(const char *pref, nsCString& fullPrefName);
|
1999-08-31 08:39:43 +04:00
|
|
|
|
|
|
|
// these are private pref getters and setters for the password
|
|
|
|
// field. Callers should be using Get/Set Password
|
|
|
|
NS_IMETHOD GetPrefPassword(char * *aPassword);
|
1999-09-20 03:46:35 +04:00
|
|
|
NS_IMETHOD SetPrefPassword(const char * aPassword);
|
1999-04-07 02:34:19 +04:00
|
|
|
|
1999-05-27 03:56:21 +04:00
|
|
|
nsCOMPtr <nsIFolder> m_rootFolder;
|
2001-01-02 01:00:17 +03:00
|
|
|
nsCOMPtr <nsIMsgRetentionSettings> m_retentionSettings;
|
2001-03-17 04:59:34 +03:00
|
|
|
nsCOMPtr <nsIMsgDownloadSettings> m_downloadSettings;
|
1999-04-11 00:55:30 +04:00
|
|
|
nsresult getDefaultCharPref(const char *pref, char **);
|
1999-12-03 03:10:00 +03:00
|
|
|
nsresult getDefaultUnicharPref(const char *pref, PRUnichar **);
|
1999-04-11 00:55:30 +04:00
|
|
|
nsresult getDefaultBoolPref(const char *pref, PRBool *);
|
|
|
|
nsresult getDefaultIntPref(const char *pref, PRInt32 *);
|
1999-09-09 08:11:38 +04:00
|
|
|
|
|
|
|
nsresult CreateRootFolder();
|
2000-03-24 11:26:32 +03:00
|
|
|
nsresult StorePassword(); // stuff the password in the single signon database
|
1999-08-31 02:12:20 +04:00
|
|
|
|
2000-05-31 12:00:13 +04:00
|
|
|
nsresult getProtocolInfo(nsIMsgProtocolInfo **aResult);
|
2000-06-02 03:35:38 +04:00
|
|
|
nsCOMPtr<nsIFileSpec> mFilterFile;
|
2000-03-28 08:58:05 +04:00
|
|
|
nsCOMPtr<nsIMsgFilterList> mFilterList;
|
2000-02-11 03:55:54 +03:00
|
|
|
// pref callback to clear the user prefs
|
|
|
|
static void clearPrefEnum(const char *aPref, void *aClosure);
|
2001-02-01 10:26:38 +03:00
|
|
|
|
|
|
|
// member variable for canHaveFilters
|
|
|
|
PRBool m_canHaveFilters;
|
2001-03-14 05:32:04 +03:00
|
|
|
|
|
|
|
// member variable for to check if we need display startup page
|
|
|
|
PRBool m_displayStartupPage;
|
1999-04-07 02:34:19 +04:00
|
|
|
};
|
|
|
|
|
1999-10-05 09:53:31 +04:00
|
|
|
#endif // nsMsgIncomingServer_h__
|