1999-04-10 21:04:50 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
1999-04-06 22:35:13 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
1999-09-09 04:11:38 +00:00
|
|
|
#include "nsIFileSpec.idl"
|
1999-04-06 22:35:13 +00:00
|
|
|
|
1999-05-26 23:51:53 +00:00
|
|
|
interface nsIFolder;
|
1999-07-17 03:26:24 +00:00
|
|
|
interface nsIMsgFolderCache;
|
1999-07-01 06:00:55 +00:00
|
|
|
/*
|
|
|
|
* Interface for incoming mail/news host
|
|
|
|
* this is the base interface for all mail server types (imap, pop, nntp, etc)
|
|
|
|
* often you will want to add extra interfaces that give you server-specific
|
|
|
|
* attributes and methods.
|
|
|
|
*/
|
1999-04-06 22:35:13 +00:00
|
|
|
|
1999-05-27 05:19:55 +00:00
|
|
|
[scriptable, uuid(60dcb100-e3f2-11d2-b7fc-00805f05ffa5)]
|
1999-04-06 22:35:13 +00:00
|
|
|
interface nsIMsgIncomingServer : nsISupports {
|
|
|
|
|
1999-10-28 20:22:06 +00:00
|
|
|
/**
|
|
|
|
* internal pref key - guaranteed to be unique across all servers
|
|
|
|
*/
|
1999-04-10 21:04:50 +00:00
|
|
|
attribute string key;
|
1999-07-01 06:00:55 +00:00
|
|
|
|
1999-10-28 20:22:06 +00:00
|
|
|
/**
|
|
|
|
* pretty name - should be "userid on hostname"
|
|
|
|
* if the pref is not set
|
|
|
|
*/
|
1999-08-10 04:39:22 +00:00
|
|
|
attribute wstring prettyName;
|
1999-07-01 06:00:55 +00:00
|
|
|
|
1999-10-28 20:22:06 +00:00
|
|
|
/**
|
|
|
|
* hostname of the server
|
|
|
|
*/
|
1999-04-06 22:35:13 +00:00
|
|
|
attribute string hostName;
|
1999-10-26 23:34:30 +00:00
|
|
|
|
|
|
|
/* port of the server */
|
|
|
|
attribute long port;
|
1999-07-01 06:00:55 +00:00
|
|
|
|
1999-10-28 20:22:06 +00:00
|
|
|
/**
|
|
|
|
* userid to log into the server
|
|
|
|
*/
|
1999-05-27 05:36:10 +00:00
|
|
|
attribute string username;
|
1999-07-01 06:00:55 +00:00
|
|
|
|
1999-10-28 20:22:06 +00:00
|
|
|
/**
|
|
|
|
* protocol type, i.e. "pop3", "imap", "nntp", "none", etc
|
|
|
|
* used to construct URLs
|
|
|
|
*/
|
1999-07-13 19:23:40 +00:00
|
|
|
attribute string type;
|
1999-07-01 06:00:55 +00:00
|
|
|
|
1999-10-28 20:22:06 +00:00
|
|
|
/**
|
|
|
|
* the schema for the local mail store, such
|
|
|
|
* as "mailbox", "imap", or "news"
|
|
|
|
* used to construct URIs
|
|
|
|
*/
|
|
|
|
readonly attribute string localStoreType;
|
|
|
|
|
1999-07-01 06:00:55 +00:00
|
|
|
/* should we remember the password? */
|
1999-04-16 00:36:52 +00:00
|
|
|
attribute boolean rememberPassword;
|
1999-07-01 06:00:55 +00:00
|
|
|
|
1999-10-28 20:22:06 +00:00
|
|
|
/* cleartext version of the password */
|
1999-09-22 02:21:18 +00:00
|
|
|
attribute string password;
|
1999-10-28 20:22:06 +00:00
|
|
|
|
|
|
|
/* prompt the user for a password */
|
1999-09-22 06:02:46 +00:00
|
|
|
string getPasswordWithUI(in wstring aPromptString);
|
1999-04-16 00:36:52 +00:00
|
|
|
|
1999-07-01 06:00:55 +00:00
|
|
|
/* should we download whole messages when biff goes off? */
|
1999-04-16 00:36:52 +00:00
|
|
|
attribute boolean downloadOnBiff;
|
1999-07-01 06:00:55 +00:00
|
|
|
|
|
|
|
/* should we biff the server? */
|
1999-04-06 22:35:13 +00:00
|
|
|
attribute boolean doBiff;
|
1999-07-01 06:00:55 +00:00
|
|
|
|
|
|
|
/* how often to biff */
|
1999-04-06 22:35:13 +00:00
|
|
|
attribute long biffMinutes;
|
1999-04-16 00:36:52 +00:00
|
|
|
|
1999-07-01 06:00:55 +00:00
|
|
|
/* the on-disk path to message storage for this server */
|
1999-09-09 04:11:38 +00:00
|
|
|
attribute nsIFileSpec localPath;
|
1999-10-28 20:22:06 +00:00
|
|
|
|
|
|
|
|
1999-07-01 06:00:55 +00:00
|
|
|
/* the RDF URI for the root mail folder */
|
1999-04-26 18:38:26 +00:00
|
|
|
readonly attribute string serverURI;
|
1999-05-26 23:51:53 +00:00
|
|
|
|
1999-07-01 06:00:55 +00:00
|
|
|
/* the root folder for this server */
|
1999-05-26 23:51:53 +00:00
|
|
|
attribute nsIFolder RootFolder;
|
1999-06-11 22:07:08 +00:00
|
|
|
|
1999-08-31 06:52:27 +00:00
|
|
|
/* are we already getting new Messages on the current server..
|
|
|
|
This is used to help us prevent multiple get new msg commands from
|
|
|
|
going off at the same time. */
|
|
|
|
attribute boolean serverBusy;
|
|
|
|
|
1999-09-14 09:03:40 +00:00
|
|
|
/* we use this to set the default local path. we use this when migrating prefs */
|
|
|
|
void SetDefaultLocalPath(in nsIFileSpec aDefaultLocalPath);
|
|
|
|
|
1999-07-01 06:00:55 +00:00
|
|
|
/* do a biff */
|
1999-06-11 22:07:08 +00:00
|
|
|
void PerformBiff();
|
1999-07-17 03:26:24 +00:00
|
|
|
|
1999-10-28 20:22:06 +00:00
|
|
|
/* Write out all known folder data to panacea.dat */
|
1999-07-17 03:26:24 +00:00
|
|
|
void WriteToFolderCache(in nsIMsgFolderCache folderCache);
|
|
|
|
|
1999-10-28 20:22:06 +00:00
|
|
|
/* close any server connections */
|
1999-09-30 01:44:30 +00:00
|
|
|
void CloseCachedConnections();
|
|
|
|
|
1999-09-09 04:11:38 +00:00
|
|
|
/* access to generic attributes */
|
|
|
|
boolean getBoolValue(in string attr);
|
|
|
|
void setBoolValue(in string attr, in boolean value);
|
1999-07-17 03:26:24 +00:00
|
|
|
|
1999-09-09 04:11:38 +00:00
|
|
|
string getCharValue(in string attr);
|
|
|
|
void setCharValue(in string attr, in string value);
|
|
|
|
|
|
|
|
long getIntValue(in string attr);
|
|
|
|
void setIntValue(in string attr, in long value);
|
|
|
|
|
|
|
|
nsIFileSpec getFileValue(in string attr);
|
|
|
|
void setFileValue(in string attr, in nsIFileSpec value);
|
|
|
|
|
|
|
|
wstring toString();
|
1999-04-06 22:35:13 +00:00
|
|
|
};
|
1999-09-09 04:11:38 +00:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
/* some useful macros to implement nsIMsgIncomingServer accessors */
|
|
|
|
#define NS_IMPL_SERVERPREF_STR(_class, _postfix, _prefname) \
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Get##_postfix(char **retval) \
|
|
|
|
{ \
|
|
|
|
return GetCharValue(_prefname, retval); \
|
|
|
|
} \
|
|
|
|
NS_IMETHODIMP \
|
1999-09-19 23:46:35 +00:00
|
|
|
_class::Set##_postfix(const char *chvalue) \
|
1999-09-09 04:11:38 +00:00
|
|
|
{ \
|
|
|
|
return SetCharValue(_prefname, chvalue); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define NS_IMPL_SERVERPREF_BOOL(_class, _postfix, _prefname)\
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Get##_postfix(PRBool *retval) \
|
|
|
|
{ \
|
|
|
|
return GetBoolValue(_prefname, retval); \
|
|
|
|
} \
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Set##_postfix(PRBool bvalue) \
|
|
|
|
{ \
|
|
|
|
return SetBoolValue(_prefname, bvalue); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define NS_IMPL_SERVERPREF_INT(_class, _postfix, _prefname)\
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Get##_postfix(PRInt32 *retval) \
|
|
|
|
{ \
|
|
|
|
return GetIntValue(_prefname, retval); \
|
|
|
|
} \
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Set##_postfix(PRInt32 ivalue) \
|
|
|
|
{ \
|
|
|
|
return SetIntValue(_prefname, ivalue); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define NS_IMPL_SERVERPREF_FILE(_class, _postfix, _prefname)\
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Get##_postfix(nsIFileSpec **retval) \
|
|
|
|
{ \
|
|
|
|
return GetFileValue(_prefname, retval); \
|
|
|
|
} \
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
_class::Set##_postfix(nsIFileSpec* ivalue) \
|
|
|
|
{ \
|
|
|
|
return SetFileValue(_prefname, ivalue); \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
%}
|