2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
1999-04-07 02:35:13 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04: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-07 02:35:13 +04:00
|
|
|
*
|
2001-09-29 00:14:13 +04: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-07 02:35:13 +04:00
|
|
|
*
|
1999-11-06 06:43:54 +03:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 06:43:54 +03:00
|
|
|
*
|
2001-09-29 00:14:13 +04:00
|
|
|
* Contributor(s):
|
2001-10-31 06:45:24 +03:00
|
|
|
* Seth Spitzer <sspitzer@netscape.com>
|
2001-09-29 00:14:13 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the NPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the NPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-04-07 02:35:13 +04:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
#include "nsIMsgAccount.idl"
|
|
|
|
#include "nsIMsgIdentity.idl"
|
|
|
|
#include "nsIMsgIncomingServer.idl"
|
1999-06-29 23:45:19 +04:00
|
|
|
#include "nsISupportsArray.idl"
|
1999-11-11 03:25:19 +03:00
|
|
|
#include "nsIIncomingServerListener.idl"
|
2000-05-15 18:55:22 +04:00
|
|
|
#include "nsIMsgFolder.idl"
|
1999-05-27 09:19:55 +04:00
|
|
|
|
1999-07-17 07:26:24 +04:00
|
|
|
interface nsIMsgFolderCache;
|
2000-03-28 11:16:04 +04:00
|
|
|
interface nsIFolderListener;
|
1999-07-17 07:26:24 +04:00
|
|
|
|
1999-05-27 09:19:55 +04:00
|
|
|
[scriptable, uuid(6ed2cc00-e623-11d2-b7fc-00805f05ffa5)]
|
1999-04-07 02:35:13 +04:00
|
|
|
interface nsIMsgAccountManager : nsISupports {
|
|
|
|
|
1999-08-26 10:20:06 +04:00
|
|
|
nsIMsgAccount createAccount();
|
|
|
|
nsIMsgAccount getAccount(in string key);
|
|
|
|
|
2000-01-08 07:01:06 +03:00
|
|
|
void removeAccount(in nsIMsgAccount account);
|
2000-01-15 12:14:27 +03:00
|
|
|
void removeIdentity(in nsIMsgIdentity identity);
|
2000-01-08 07:01:06 +03:00
|
|
|
void duplicateAccount(in nsIMsgAccount account);
|
2000-04-21 04:03:02 +04:00
|
|
|
|
1999-08-26 10:20:06 +04:00
|
|
|
/*
|
|
|
|
* creates a new identity and assigns it a new, unique "key"
|
|
|
|
*/
|
|
|
|
nsIMsgIdentity createIdentity();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* creates a new server and assigns it a new, unique "key"
|
2000-09-14 03:57:52 +04:00
|
|
|
* the given type will be used to construct a ContractID
|
1999-08-26 10:20:06 +04:00
|
|
|
*/
|
2000-01-08 12:03:55 +03:00
|
|
|
nsIMsgIncomingServer createIncomingServer(in string username,
|
|
|
|
in string hostname,
|
|
|
|
in string type);
|
1999-08-26 10:20:06 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* get the identity with the given key
|
|
|
|
* if the identity does not exist, it will be created
|
|
|
|
*/
|
|
|
|
nsIMsgIdentity getIdentity(in string key);
|
1999-04-07 02:35:13 +04:00
|
|
|
|
1999-08-26 10:20:06 +04:00
|
|
|
/*
|
|
|
|
* Gets the existing incoming server with the given key
|
|
|
|
* if the server's type does not exist in the preference,
|
|
|
|
* an error is returned/thrown
|
|
|
|
*/
|
|
|
|
nsIMsgIncomingServer getIncomingServer(in string key);
|
1999-04-07 02:35:13 +04:00
|
|
|
|
|
|
|
/* account list stuff */
|
|
|
|
|
|
|
|
/* defaultAccount should always be set if there are any accounts
|
|
|
|
* in the account manager. You can only set the defaultAccount to an
|
|
|
|
* account already in the account manager */
|
|
|
|
attribute nsIMsgAccount defaultAccount;
|
1999-07-01 10:00:55 +04:00
|
|
|
|
1999-09-17 04:14:43 +04:00
|
|
|
/**
|
|
|
|
* ordered list of all accounts, by the order they are in the prefs
|
1999-07-01 10:15:06 +04:00
|
|
|
* array of nsIMsgAccount
|
|
|
|
*/
|
1999-06-08 03:14:20 +04:00
|
|
|
readonly attribute nsISupportsArray accounts;
|
1999-04-07 02:35:13 +04:00
|
|
|
|
1999-07-01 10:15:06 +04:00
|
|
|
/* list of all identities in all accounts
|
|
|
|
* array of nsIMsgIdentity
|
|
|
|
*/
|
1999-04-26 22:40:48 +04:00
|
|
|
readonly attribute nsISupportsArray allIdentities;
|
1999-07-01 10:00:55 +04:00
|
|
|
|
1999-07-01 10:15:06 +04:00
|
|
|
/* list of all servers in all accounts
|
|
|
|
* array of nsIMsgIncomingServer
|
|
|
|
*/
|
1999-04-26 22:40:48 +04:00
|
|
|
readonly attribute nsISupportsArray allServers;
|
1999-04-07 02:35:13 +04:00
|
|
|
|
1999-11-10 03:41:52 +03:00
|
|
|
/* summary of summary files folder cache */
|
|
|
|
readonly attribute nsIMsgFolderCache folderCache;
|
2000-07-06 03:19:24 +04:00
|
|
|
|
|
|
|
/* are we shutting down */
|
|
|
|
readonly attribute boolean shutdownInProgress;
|
|
|
|
|
1999-07-01 10:00:55 +04:00
|
|
|
/*
|
|
|
|
* search for the server with the given username, hostname, and type
|
|
|
|
* the type is the same as is specified in the preferences,
|
1999-09-20 12:13:27 +04:00
|
|
|
* i.e. "imap", "pop3", "none", or "nntp"
|
1999-07-01 10:00:55 +04:00
|
|
|
*/
|
1999-06-22 07:03:48 +04:00
|
|
|
nsIMsgIncomingServer
|
|
|
|
FindServer(in string userName, in string hostname, in string type);
|
1999-07-01 10:00:55 +04:00
|
|
|
|
2001-10-09 23:20:31 +04:00
|
|
|
/*
|
|
|
|
* Same as FindServer() except it compares the input values against
|
|
|
|
* 'realhostname' and 'realuserName' pref settings.
|
|
|
|
*/
|
|
|
|
nsIMsgIncomingServer
|
|
|
|
findRealServer(in string userName, in string hostname, in string type);
|
|
|
|
|
1999-09-17 04:14:43 +04:00
|
|
|
/**
|
|
|
|
* find the index of this server in the (ordered) list of accounts
|
|
|
|
*/
|
|
|
|
long FindServerIndex(in nsIMsgIncomingServer server);
|
|
|
|
|
1999-08-31 02:00:22 +04:00
|
|
|
nsIMsgAccount
|
|
|
|
FindAccountForServer(in nsIMsgIncomingServer server);
|
|
|
|
|
1999-07-01 10:15:06 +04:00
|
|
|
/* given a server, return all identities in accounts that have this server
|
|
|
|
* returns an array of nsIMsgIdentity
|
|
|
|
*/
|
1999-06-03 06:07:58 +04:00
|
|
|
nsISupportsArray GetIdentitiesForServer(in nsIMsgIncomingServer server);
|
1999-07-01 10:00:55 +04:00
|
|
|
|
|
|
|
/* given an identity, return all servers in accounts that have
|
1999-07-01 10:15:06 +04:00
|
|
|
* this identity
|
|
|
|
* returns an array of nsIMsgIncomingServer
|
|
|
|
*/
|
1999-06-03 06:07:58 +04:00
|
|
|
nsISupportsArray GetServersForIdentity(in nsIMsgIdentity identity);
|
1999-07-01 10:00:55 +04:00
|
|
|
|
2000-04-02 20:52:29 +04:00
|
|
|
/* there is a special server "Local Folders" that is guaranteed to exist.
|
|
|
|
* this will allow you to get */
|
2000-04-02 23:11:16 +04:00
|
|
|
attribute nsIMsgIncomingServer localFoldersServer;
|
2000-04-02 20:52:29 +04:00
|
|
|
|
1999-07-01 10:00:55 +04:00
|
|
|
/* load accounts kicks off the creation of all accounts. You do not need
|
|
|
|
* to call this and all accounts should be loaded lazily if you use any
|
|
|
|
* of the above.
|
|
|
|
*/
|
1999-04-07 02:35:13 +04:00
|
|
|
void LoadAccounts();
|
1999-07-01 10:00:55 +04:00
|
|
|
|
2000-08-30 18:51:10 +04:00
|
|
|
void SetSpecialFoldersForIdentities();
|
1999-07-01 10:00:55 +04:00
|
|
|
/* unload accounts frees all the account manager data structures */
|
1999-06-29 06:47:49 +04:00
|
|
|
void UnloadAccounts();
|
1999-07-13 23:23:40 +04:00
|
|
|
|
1999-07-17 07:26:24 +04:00
|
|
|
void WriteToFolderCache(in nsIMsgFolderCache folderCache);
|
|
|
|
|
1999-09-30 05:44:30 +04:00
|
|
|
void CloseCachedConnections();
|
2001-05-17 03:55:00 +04:00
|
|
|
void CleanupOnExit();
|
2000-05-15 18:55:22 +04:00
|
|
|
void SetFolderDoingEmptyTrash(in nsIMsgFolder folder);
|
|
|
|
boolean GetEmptyTrashInProgress();
|
1999-11-06 04:22:28 +03:00
|
|
|
|
2000-12-17 04:19:41 +03:00
|
|
|
void SetFolderDoingCleanupInbox(in nsIMsgFolder folder);
|
|
|
|
boolean GetCleanupInboxInProgress();
|
|
|
|
|
2000-03-28 11:16:04 +04:00
|
|
|
void addRootFolderListener(in nsIFolderListener listener);
|
|
|
|
void removeRootFolderListener(in nsIFolderListener listener);
|
|
|
|
|
|
|
|
// these are going away in favor of add/removeRootFolderListener
|
2001-09-26 05:01:49 +04:00
|
|
|
void addIncomingServerListener(in nsIIncomingServerListener serverListener);
|
|
|
|
void removeIncomingServerListener(in nsIIncomingServerListener serverListener);
|
2000-03-28 11:16:04 +04:00
|
|
|
|
|
|
|
// these are going away in favor of nsIFolder::NotifyEvent(in nsIAtom event);
|
2001-09-26 05:01:49 +04:00
|
|
|
void notifyServerLoaded(in nsIMsgIncomingServer server);
|
|
|
|
void notifyServerUnloaded(in nsIMsgIncomingServer server);
|
|
|
|
void notifyServerChanged(in nsIMsgIncomingServer server);
|
2001-05-03 05:07:45 +04:00
|
|
|
|
|
|
|
// force account info out to prefs file
|
|
|
|
void saveAccountInfo();
|
1999-04-07 02:35:13 +04:00
|
|
|
};
|
|
|
|
|
2001-10-31 06:45:24 +03:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
#define MAILNEWS_ACCOUNTMANAGER_EXTENSIONS "mailnews-accountmanager-extensions"
|
|
|
|
%}
|
|
|
|
|
|
|
|
|
|
|
|
[scriptable, uuid(9ce9fc76-1dd1-11b2-8da2-bf6b98b4c537)]
|
|
|
|
interface nsIMsgAccountManagerExtension : nsISupports
|
|
|
|
{
|
|
|
|
readonly attribute string name;
|
|
|
|
boolean showPanel(in nsIMsgIncomingServer server);
|
|
|
|
};
|
|
|
|
|