mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-13 23:17:57 +00:00
4f7990cd94
As this changed the generated interface signatures, I had to change all of the uses to avoid bustage. Any corners of the browser that aren't built by default, or that I haven't discovered how to build, may be at risk of bustage if they use string or wstring attributes. (This could mean blackwood; sorry, guys!) Many thanks to Alec Flett (alecf@netscape.com) for preparing diffs for the mailnews portion of the signature changes; thanks also to Ariel Backenroth (arielb@rice.edu) and Mike Shaver (shaver@mozilla.org) for help with updating the tree with NS_DECL_NSIFOO macros; everwhere where one of these macros was used was one less place I had to manually add 'const'. Also removed extraneous space from generated method signatures, leftover from Brendan's capitalization spam, and made 'const decl must be of type short or long' an error rather than just a warning.
159 lines
4.8 KiB
Plaintext
159 lines
4.8 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.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"
|
|
#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 */
|
|
attribute string key;
|
|
|
|
/* pretty name - should be "userid on hostname" if this pref is not set */
|
|
attribute wstring prettyName;
|
|
|
|
/* hostname of the server */
|
|
attribute string hostName;
|
|
|
|
/* userid to log into the server */
|
|
attribute string username;
|
|
|
|
/* server type, i.e. "pop3", "imap", "nntp", "none", etc */
|
|
attribute string type;
|
|
|
|
/* should we remember the password? */
|
|
attribute boolean rememberPassword;
|
|
|
|
/* the password to login with (in cleartext for now)
|
|
aWithUI is a flag where the caller can decide if they
|
|
want us to bring up UI to ask for the password. If you pass
|
|
in false, we will return an empty password if we don't know
|
|
it already and we will NOT ask the user */
|
|
string getPassword(in boolean aWithUI);
|
|
void setPassword([const] in string aPassword);
|
|
|
|
/* 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();
|
|
|
|
void WriteToFolderCache(in nsIMsgFolderCache folderCache);
|
|
|
|
/* 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);
|
|
|
|
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); \
|
|
}
|
|
|
|
|
|
%}
|