gecko-dev/mailnews/base/public/nsIMsgAccountManager.idl

202 строки
6.9 KiB
Plaintext
Исходник Обычный вид История

/* -*- 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
*
* 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 the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Seth Spitzer <sspitzer@netscape.com>
*
* 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 ***** */
#include "nsISupports.idl"
#include "nsIMsgAccount.idl"
#include "nsIMsgIdentity.idl"
#include "nsIMsgIncomingServer.idl"
#include "nsISupportsArray.idl"
#include "nsIIncomingServerListener.idl"
#include "nsIMsgFolder.idl"
1999-07-17 07:26:24 +04:00
interface nsIMsgFolderCache;
interface nsIFolderListener;
1999-07-17 07:26:24 +04:00
[scriptable, uuid(6ed2cc00-e623-11d2-b7fc-00805f05ffa5)]
interface nsIMsgAccountManager : nsISupports {
1999-08-26 10:20:06 +04:00
nsIMsgAccount createAccount();
nsIMsgAccount getAccount(in string key);
void removeAccount(in nsIMsgAccount account);
void removeIdentity(in nsIMsgIdentity identity);
void duplicateAccount(in nsIMsgAccount account);
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"
* the given type will be used to construct a ContractID
1999-08-26 10:20:06 +04: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-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);
/* 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-09-17 04:14:43 +04:00
/**
* ordered list of all accounts, by the order they are in the prefs
* array of nsIMsgAccount
*/
readonly attribute nsISupportsArray accounts;
/* list of all identities in all accounts
* array of nsIMsgIdentity
*/
readonly attribute nsISupportsArray allIdentities;
/* list of all servers in all accounts
* array of nsIMsgIncomingServer
*/
readonly attribute nsISupportsArray allServers;
/* summary of summary files folder cache */
readonly attribute nsIMsgFolderCache folderCache;
/* are we shutting down */
readonly attribute boolean shutdownInProgress;
/*
* search for the server with the given username, hostname, and type
* the type is the same as is specified in the preferences,
* i.e. "imap", "pop3", "none", or "nntp"
*/
nsIMsgIncomingServer
FindServer(in string userName, in string hostname, in string type);
/*
* 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);
nsIMsgAccount
FindAccountForServer(in nsIMsgIncomingServer server);
/* given a server, return all identities in accounts that have this server
* returns an array of nsIMsgIdentity
*/
nsISupportsArray GetIdentitiesForServer(in nsIMsgIncomingServer server);
/* given an identity, return all servers in accounts that have
* this identity
* returns an array of nsIMsgIncomingServer
*/
nsISupportsArray GetServersForIdentity(in nsIMsgIdentity identity);
/* there is a special server "Local Folders" that is guaranteed to exist.
* this will allow you to get */
attribute nsIMsgIncomingServer localFoldersServer;
/* 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.
*/
void LoadAccounts();
void SetSpecialFoldersForIdentities();
/* unload accounts frees all the account manager data structures */
1999-06-29 06:47:49 +04:00
void UnloadAccounts();
1999-07-17 07:26:24 +04:00
void WriteToFolderCache(in nsIMsgFolderCache folderCache);
1999-09-30 05:44:30 +04:00
void CloseCachedConnections();
void CleanupOnExit();
void SetFolderDoingEmptyTrash(in nsIMsgFolder folder);
boolean GetEmptyTrashInProgress();
void SetFolderDoingCleanupInbox(in nsIMsgFolder folder);
boolean GetCleanupInboxInProgress();
void addRootFolderListener(in nsIFolderListener listener);
void removeRootFolderListener(in nsIFolderListener listener);
// these are going away in favor of add/removeRootFolderListener
void addIncomingServerListener(in nsIIncomingServerListener serverListener);
void removeIncomingServerListener(in nsIIncomingServerListener serverListener);
// these are going away in favor of nsIFolder::NotifyEvent(in nsIAtom event);
void notifyServerLoaded(in nsIMsgIncomingServer server);
void notifyServerUnloaded(in nsIMsgIncomingServer server);
void notifyServerChanged(in nsIMsgIncomingServer server);
// force account info out to prefs file
void saveAccountInfo();
};
%{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);
};