gecko-dev/mailnews/base/public/nsIMsgIncomingServer.idl
sspitzer%netscape.com e8a4061a40 warnings fixes, and fix for #21901, all password dialogs to have titles
if the user passes one in, or use "Password" if they pass null.
1999-12-21 23:03:29 +00:00

191 lines
5.2 KiB
Plaintext

/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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/
*
* 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.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "nsISupports.idl"
#include "nsIFileSpec.idl"
interface nsIFolder;
interface nsIMsgFolderCache;
/*
* 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.
*/
[scriptable, uuid(60dcb100-e3f2-11d2-b7fc-00805f05ffa5)]
interface nsIMsgIncomingServer : nsISupports {
/**
* internal pref key - guaranteed to be unique across all servers
*/
attribute string key;
/**
* pretty name - should be "userid on hostname"
* if the pref is not set
*/
attribute wstring prettyName;
/**
* hostname of the server
*/
attribute string hostName;
/* port of the server */
attribute long port;
/**
* userid to log into the server
*/
attribute string username;
/**
* protocol type, i.e. "pop3", "imap", "nntp", "none", etc
* used to construct URLs
*/
attribute string type;
/**
* the schema for the local mail store, such
* as "mailbox", "imap", or "news"
* used to construct URIs
*/
readonly attribute string localStoreType;
/* should we remember the password? */
attribute boolean rememberPassword;
/* cleartext version of the password */
attribute string password;
/* prompt the user for a password */
string getPasswordWithUI(in wstring aPromptString, in wstring aPromptTitle);
/* should we download whole messages when biff goes off? */
attribute boolean downloadOnBiff;
/* should we biff the server? */
attribute boolean doBiff;
/* how often to biff */
attribute long biffMinutes;
/* the on-disk path to message storage for this server */
attribute nsIFileSpec localPath;
/* the RDF URI for the root mail folder */
readonly attribute string serverURI;
/* the root folder for this server */
attribute nsIFolder RootFolder;
/* 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;
/* we use this to set the default local path. we use this when migrating prefs */
void SetDefaultLocalPath(in nsIFileSpec aDefaultLocalPath);
/* do a biff */
void PerformBiff();
/* Write out all known folder data to panacea.dat */
void WriteToFolderCache(in nsIMsgFolderCache folderCache);
/* close any server connections */
void CloseCachedConnections();
/* access to generic attributes */
boolean getBoolValue(in string attr);
void setBoolValue(in string attr, in boolean value);
string getCharValue(in string attr);
void setCharValue(in string attr, in string value);
wstring getUnicharValue(in string attr);
void setUnicharValue(in string attr, in wstring 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();
};
%{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 \
_class::Set##_postfix(const char *chvalue) \
{ \
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); \
}
%}