1999-04-06 22:34:19 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; 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-04-06 22:34:19 +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-04-06 22:34:19 +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-04-06 22:34:19 +00:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 03:43:54 +00:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-04-06 22:34:19 +00:00
|
|
|
*/
|
|
|
|
|
1999-10-05 05:53:31 +00:00
|
|
|
#ifndef nsMsgIncomingServer_h__
|
|
|
|
#define nsMsgIncomingServer_h__
|
|
|
|
|
1999-04-06 22:34:19 +00:00
|
|
|
#include "nsIMsgIncomingServer.h"
|
1999-04-16 00:36:52 +00:00
|
|
|
#include "nsIPref.h"
|
2000-03-28 04:58:05 +00:00
|
|
|
#include "nsIMsgFilterList.h"
|
1999-05-18 23:55:39 +00:00
|
|
|
#include "msgCore.h"
|
1999-05-26 23:56:21 +00:00
|
|
|
#include "nsIFolder.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2000-01-26 00:54:15 +00:00
|
|
|
#include "nsWeakReference.h"
|
1999-07-17 03:26:24 +00:00
|
|
|
|
|
|
|
class nsIMsgFolderCache;
|
2000-05-31 08:00:13 +00:00
|
|
|
class nsIMsgProtocolInfo;
|
1999-07-17 03:26:24 +00:00
|
|
|
|
1999-04-06 22:34:19 +00: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 00:54:15 +00:00
|
|
|
class NS_MSG_BASE nsMsgIncomingServer : public nsIMsgIncomingServer,
|
|
|
|
public nsSupportsWeakReference
|
|
|
|
{
|
1999-04-06 22:34:19 +00:00
|
|
|
public:
|
|
|
|
nsMsgIncomingServer();
|
|
|
|
virtual ~nsMsgIncomingServer();
|
|
|
|
|
1999-09-09 04:11:38 +00:00
|
|
|
NS_DECL_ISUPPORTS
|
1999-04-06 22:34:19 +00:00
|
|
|
|
1999-09-09 04:11:38 +00:00
|
|
|
NS_DECL_NSIMSGINCOMINGSERVER
|
1999-06-15 03:47:59 +00:00
|
|
|
|
1999-04-10 20:55:30 +00:00
|
|
|
private:
|
|
|
|
nsIPref *m_prefs;
|
2000-05-31 08:00:13 +00:00
|
|
|
nsCString m_serverKey;
|
1999-08-31 04:39:43 +00:00
|
|
|
nsCString m_password;
|
1999-08-31 06:52:27 +00:00
|
|
|
PRBool m_serverBusy;
|
1999-04-06 22:34:19 +00:00
|
|
|
|
|
|
|
protected:
|
2000-01-26 00:54:15 +00:00
|
|
|
void getPrefName(const char *serverKey, const char *pref, nsCString& fullPrefName);
|
|
|
|
void getDefaultPrefName(const char *pref, nsCString& fullPrefName);
|
1999-08-31 04:39:43 +00: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-19 23:46:35 +00:00
|
|
|
NS_IMETHOD SetPrefPassword(const char * aPassword);
|
1999-04-06 22:34:19 +00:00
|
|
|
|
1999-05-26 23:56:21 +00:00
|
|
|
nsCOMPtr <nsIFolder> m_rootFolder;
|
1999-04-10 20:55:30 +00:00
|
|
|
nsresult getDefaultCharPref(const char *pref, char **);
|
1999-12-03 00:10:00 +00:00
|
|
|
nsresult getDefaultUnicharPref(const char *pref, PRUnichar **);
|
1999-04-10 20:55:30 +00:00
|
|
|
nsresult getDefaultBoolPref(const char *pref, PRBool *);
|
|
|
|
nsresult getDefaultIntPref(const char *pref, PRInt32 *);
|
1999-09-09 04:11:38 +00:00
|
|
|
|
|
|
|
nsresult CreateRootFolder();
|
2000-03-24 08:26:32 +00:00
|
|
|
nsresult StorePassword(); // stuff the password in the single signon database
|
1999-08-30 22:12:20 +00:00
|
|
|
|
2000-05-31 08:00:13 +00:00
|
|
|
nsresult getProtocolInfo(nsIMsgProtocolInfo **aResult);
|
2000-06-01 23:35:38 +00:00
|
|
|
nsCOMPtr<nsIFileSpec> mFilterFile;
|
2000-03-28 04:58:05 +00:00
|
|
|
nsCOMPtr<nsIMsgFilterList> mFilterList;
|
2000-02-11 00:55:54 +00:00
|
|
|
// pref callback to clear the user prefs
|
|
|
|
static void clearPrefEnum(const char *aPref, void *aClosure);
|
1999-04-06 22:34:19 +00:00
|
|
|
};
|
|
|
|
|
1999-10-05 05:53:31 +00:00
|
|
|
#endif // nsMsgIncomingServer_h__
|