1999-08-26 06:20:06 +00:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
1999-04-06 22:35:13 +00:00
|
|
|
*
|
1999-11-06 03:43:54 +00: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-06 22:35:13 +00:00
|
|
|
*
|
1999-11-06 03:43:54 +00: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-06 22:35:13 +00:00
|
|
|
*
|
1999-11-06 03:43:54 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-04-06 22:35:13 +00:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 03:43:54 +00:00
|
|
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-04-06 22:35:13 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
#include "nsIMsgAccount.idl"
|
|
|
|
#include "nsIMsgIdentity.idl"
|
|
|
|
#include "nsIMsgIncomingServer.idl"
|
1999-06-29 19:45:19 +00:00
|
|
|
#include "nsISupportsArray.idl"
|
1999-11-11 00:25:19 +00:00
|
|
|
#include "nsIIncomingServerListener.idl"
|
1999-05-27 05:19:55 +00:00
|
|
|
|
1999-07-17 03:26:24 +00:00
|
|
|
interface nsIMsgFolderCache;
|
2000-03-28 07:16:04 +00:00
|
|
|
interface nsIFolderListener;
|
1999-07-17 03:26:24 +00:00
|
|
|
|
1999-05-27 05:19:55 +00:00
|
|
|
[scriptable, uuid(6ed2cc00-e623-11d2-b7fc-00805f05ffa5)]
|
1999-04-06 22:35:13 +00:00
|
|
|
interface nsIMsgAccountManager : nsISupports {
|
|
|
|
|
1999-08-26 06:20:06 +00:00
|
|
|
nsIMsgAccount createAccount();
|
|
|
|
nsIMsgAccount getAccount(in string key);
|
|
|
|
|
2000-01-08 04:01:06 +00:00
|
|
|
void removeAccount(in nsIMsgAccount account);
|
2000-01-15 09:14:27 +00:00
|
|
|
void removeIdentity(in nsIMsgIdentity identity);
|
2000-01-08 04:01:06 +00:00
|
|
|
void duplicateAccount(in nsIMsgAccount account);
|
1999-04-06 22:35:13 +00:00
|
|
|
|
1999-08-26 06:20:06 +00: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"
|
|
|
|
* the given type will be used to construct a ProgID
|
|
|
|
*/
|
2000-01-08 09:03:55 +00:00
|
|
|
nsIMsgIncomingServer createIncomingServer(in string username,
|
|
|
|
in string hostname,
|
|
|
|
in string type);
|
1999-08-26 06:20:06 +00: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-06 22:35:13 +00:00
|
|
|
|
1999-08-26 06:20:06 +00: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-06 22:35:13 +00: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 06:00:55 +00:00
|
|
|
|
1999-09-17 00:14:43 +00:00
|
|
|
/**
|
|
|
|
* ordered list of all accounts, by the order they are in the prefs
|
1999-07-01 06:15:06 +00:00
|
|
|
* array of nsIMsgAccount
|
|
|
|
*/
|
1999-06-07 23:14:20 +00:00
|
|
|
readonly attribute nsISupportsArray accounts;
|
1999-04-06 22:35:13 +00:00
|
|
|
|
1999-07-01 06:15:06 +00:00
|
|
|
/* list of all identities in all accounts
|
|
|
|
* array of nsIMsgIdentity
|
|
|
|
*/
|
1999-04-26 18:40:48 +00:00
|
|
|
readonly attribute nsISupportsArray allIdentities;
|
1999-07-01 06:00:55 +00:00
|
|
|
|
1999-07-01 06:15:06 +00:00
|
|
|
/* list of all servers in all accounts
|
|
|
|
* array of nsIMsgIncomingServer
|
|
|
|
*/
|
1999-04-26 18:40:48 +00:00
|
|
|
readonly attribute nsISupportsArray allServers;
|
1999-04-06 22:35:13 +00:00
|
|
|
|
1999-11-10 00:41:52 +00:00
|
|
|
/* summary of summary files folder cache */
|
|
|
|
readonly attribute nsIMsgFolderCache folderCache;
|
1999-07-01 06:00:55 +00: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 08:13:27 +00:00
|
|
|
* i.e. "imap", "pop3", "none", or "nntp"
|
1999-07-01 06:00:55 +00:00
|
|
|
*/
|
1999-06-22 03:03:48 +00:00
|
|
|
nsIMsgIncomingServer
|
|
|
|
FindServer(in string userName, in string hostname, in string type);
|
1999-07-01 06:00:55 +00:00
|
|
|
|
1999-09-17 00:14:43 +00:00
|
|
|
/**
|
|
|
|
* find the index of this server in the (ordered) list of accounts
|
|
|
|
*/
|
|
|
|
long FindServerIndex(in nsIMsgIncomingServer server);
|
|
|
|
|
1999-08-30 22:00:22 +00:00
|
|
|
nsIMsgAccount
|
|
|
|
FindAccountForServer(in nsIMsgIncomingServer server);
|
|
|
|
|
1999-07-01 06:15:06 +00:00
|
|
|
/* given a server, return all identities in accounts that have this server
|
|
|
|
* returns an array of nsIMsgIdentity
|
|
|
|
*/
|
1999-06-03 02:07:58 +00:00
|
|
|
nsISupportsArray GetIdentitiesForServer(in nsIMsgIncomingServer server);
|
1999-07-01 06:00:55 +00:00
|
|
|
|
|
|
|
/* given an identity, return all servers in accounts that have
|
1999-07-01 06:15:06 +00:00
|
|
|
* this identity
|
|
|
|
* returns an array of nsIMsgIncomingServer
|
|
|
|
*/
|
1999-06-03 02:07:58 +00:00
|
|
|
nsISupportsArray GetServersForIdentity(in nsIMsgIdentity identity);
|
1999-07-01 06:00:55 +00:00
|
|
|
|
2000-04-02 16:52:29 +00:00
|
|
|
/* there is a special server "Local Folders" that is guaranteed to exist.
|
|
|
|
* this will allow you to get */
|
2000-04-02 19:11:16 +00:00
|
|
|
attribute nsIMsgIncomingServer localFoldersServer;
|
2000-04-02 16:52:29 +00:00
|
|
|
|
1999-07-01 06:00:55 +00: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-06 22:35:13 +00:00
|
|
|
void LoadAccounts();
|
1999-07-01 06:00:55 +00:00
|
|
|
|
|
|
|
/* unload accounts frees all the account manager data structures */
|
1999-06-29 02:47:49 +00:00
|
|
|
void UnloadAccounts();
|
1999-07-13 19:23:40 +00:00
|
|
|
|
1999-07-17 03:26:24 +00:00
|
|
|
void WriteToFolderCache(in nsIMsgFolderCache folderCache);
|
|
|
|
|
1999-09-30 01:44:30 +00:00
|
|
|
void CloseCachedConnections();
|
1999-11-06 01:22:28 +00:00
|
|
|
|
2000-03-28 07:16:04 +00:00
|
|
|
void addRootFolderListener(in nsIFolderListener listener);
|
|
|
|
void removeRootFolderListener(in nsIFolderListener listener);
|
|
|
|
|
|
|
|
// these are going away in favor of add/removeRootFolderListener
|
1999-11-11 00:25:19 +00:00
|
|
|
void AddIncomingServerListener(in nsIIncomingServerListener serverListener);
|
|
|
|
void RemoveIncomingServerListener(in nsIIncomingServerListener serverListener);
|
2000-03-28 07:16:04 +00:00
|
|
|
|
|
|
|
// these are going away in favor of nsIFolder::NotifyEvent(in nsIAtom event);
|
1999-11-11 00:25:19 +00:00
|
|
|
void NotifyServerLoaded(in nsIMsgIncomingServer server);
|
|
|
|
void NotifyServerUnloaded(in nsIMsgIncomingServer server);
|
1999-04-06 22:35:13 +00:00
|
|
|
};
|
|
|
|
|