diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-11-03 00:17:46 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-11-03 00:17:46 -0400 |
commit | 302bf1b523012e11b60425d6eee1221ebc2724eb (patch) | |
tree | b191a895f8716efcbe42f454f37597a545a6f421 /mailnews/base/public/nsIMsgAccount.idl | |
parent | 21b3f6247403c06f85e1f45d219f87549862198f (diff) | |
download | UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.gz UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.lz UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.xz UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.zip |
Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1
Diffstat (limited to 'mailnews/base/public/nsIMsgAccount.idl')
-rw-r--r-- | mailnews/base/public/nsIMsgAccount.idl | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/mailnews/base/public/nsIMsgAccount.idl b/mailnews/base/public/nsIMsgAccount.idl new file mode 100644 index 000000000..b4965087e --- /dev/null +++ b/mailnews/base/public/nsIMsgAccount.idl @@ -0,0 +1,88 @@ +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "nsISupports.idl" +#include "nsIMsgIncomingServer.idl" +#include "nsIMsgIdentity.idl" + +interface nsIArray; + +/** + * An account consists of an incoming server and one or more + * outgoing identities. An account is identified by a key, + * which is the <account> string in the account preferences, + * such as in mail.account.<account>.identities. + */ + +[scriptable, uuid(84181351-4ec8-4ca8-8439-5c68cc591177)] +interface nsIMsgAccount : nsISupports { + + /// Internal key identifying itself + attribute ACString key; + + /// Incoming server stuff + attribute nsIMsgIncomingServer incomingServer; + + /// Outgoing identity list (array of nsIMsgIdentity's) + readonly attribute nsIArray identities; + + /// The default identity for this account. + attribute nsIMsgIdentity defaultIdentity; + + /// Add a new identity to this account + void addIdentity(in nsIMsgIdentity identity); + + /// Remove an identity from this account + void removeIdentity(in nsIMsgIdentity identity); + + /// Clear all user preferences associated with an account. + void clearAllValues(); + + /// Name in javascript + AString toString(); + + /** + * Create the server, with error returns. + * + * Normally each valid account also has a valid server. + * + * If an extension that creates a server type failed to load, then we + * may have an existing account without a valid server. We don't want + * to simply delete that account, as that would make the user re-enter + * all of the account information after what may be a temporary + * update glitch. But we also don't want to leave junk lying around + * forever. So what we do is note the time when we first noticed + * that the server was unavailable. After a period of time set + * in a preference, if the server is still unavailable then delete + * the associated account. + * + * Accounts with invalid server are not shown in any way by the account + * manager. But if the server becomes available (for example if an extension + * is loaded), then the account will reappear when accounts are loaded. + * + * Preference definitions: + * + * mail.server.serverN.secondsToLeaveUnavailable + * mail.server.serverN.timeFoundUnavailable + * + * secondsToLeaveUnavailable: is set by the extension to indicate the + * delay, in seconds, between first detection that a server is + * unavailable, and the time it can be deleted. This should be set + * by the extension when the server is created. If missing, treat as 0. + * A typical value would be 2592000 (30 days)(24 hr/day)(3600 seconds/hr) + * + * timeFoundUnavailable: is set by core code the first time that a + * server is detected as unavailable, using now() converted to seconds. + * If that time + secondsToLeaveUnavailable is exceeded, core code may + * delete the server and its associated account (though for now we default + * to the previous behavior, which is to just delete the account). + * + * @throws NS_ERROR_NOT_AVAILABLE if the server component type could not + * be created + * NS_ERROR_ALREADY_INITIALIZED if the server is already created + * (Other errors may also be possible) + */ + void createServer(); +}; |