Back to index

lightning-sunbird  0.9+nobinonly
nsIIMAPHostSessionList.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1999
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #ifndef _nsIImapHostSessionList_H_
00039 #define _nsIImapHostSessionList_H_
00040 
00041 #include "nsISupports.h"
00042 #include "nsImapCore.h"
00043 
00044 class nsIMAPBodyShellCache;
00045 class nsIMAPBodyShell;
00046 class nsIImapIncomingServer;
00047 
00048 // 2a8e21fe-e3c4-11d2-a504-0060b0fc04b7
00049 
00050 #define NS_IIMAPHOSTSESSIONLIST_IID                                                 \
00051 { 0x2a8e21fe, 0xe3c4, 0x11d2, {0xa5, 0x04, 0x00, 0x60, 0xb0, 0xfc, 0x04, 0xb7 } }
00052 
00053 // this is an interface to a linked list of host info's    
00054 class nsIImapHostSessionList : public nsISupports
00055 {
00056 public:
00057    NS_DEFINE_STATIC_IID_ACCESSOR(NS_IIMAPHOSTSESSIONLIST_IID)
00058 
00059        // Host List
00060         NS_IMETHOD   AddHostToList(const char *serverKey, nsIImapIncomingServer *server) = 0;
00061         NS_IMETHOD ResetAll() = 0;
00062 
00063        // Capabilities
00064         NS_IMETHOD   GetCapabilityForHost(const char *serverKey, PRUint32 &result) = 0;
00065         NS_IMETHOD   SetCapabilityForHost(const char *serverKey, PRUint32 capability) = 0;
00066         NS_IMETHOD   GetHostHasAdminURL(const char *serverKey, PRBool &result) = 0;
00067         NS_IMETHOD   SetHostHasAdminURL(const char *serverKey, PRBool hasAdminUrl) = 0;
00068        // Subscription
00069         NS_IMETHOD   GetHostIsUsingSubscription(const char *serverKey, PRBool &result) = 0;
00070         NS_IMETHOD   SetHostIsUsingSubscription(const char *serverKey, PRBool usingSubscription) = 0;
00071 
00072        // Passwords
00073         NS_IMETHOD   GetPasswordForHost(const char *serverKey, nsString &result) = 0;
00074         NS_IMETHOD   SetPasswordForHost(const char *serverKey, const char *password) = 0;
00075         NS_IMETHOD GetPasswordVerifiedOnline(const char *serverKey, PRBool &result) = 0;
00076         NS_IMETHOD   SetPasswordVerifiedOnline(const char *serverKey) = 0;
00077 
00078     // OnlineDir
00079     NS_IMETHOD GetOnlineDirForHost(const char *serverKey,
00080                                    nsString &result) = 0;
00081     NS_IMETHOD SetOnlineDirForHost(const char *serverKey,
00082                                    const char *onlineDir) = 0;
00083 
00084     // Delete is move to trash folder
00085     NS_IMETHOD GetDeleteIsMoveToTrashForHost(const char *serverKey, PRBool &result) = 0;
00086     NS_IMETHOD SetDeleteIsMoveToTrashForHost(const char *serverKey, PRBool isMoveToTrash)
00087         = 0;
00088        NS_IMETHOD GetShowDeletedMessagesForHost(const char *serverKey, PRBool &result) = 0;
00089 
00090     NS_IMETHOD SetShowDeletedMessagesForHost(const char *serverKey, PRBool showDeletedMessages)
00091         = 0;
00092 
00093     // Get namespaces
00094     NS_IMETHOD GetGotNamespacesForHost(const char *serverKey, PRBool &result) = 0;
00095     NS_IMETHOD SetGotNamespacesForHost(const char *serverKey, PRBool gotNamespaces) = 0;
00096 
00097        // Folders
00098         NS_IMETHOD   SetHaveWeEverDiscoveredFoldersForHost(const char *serverKey, PRBool discovered) = 0;
00099         NS_IMETHOD   GetHaveWeEverDiscoveredFoldersForHost(const char *serverKey, PRBool &result) = 0;
00100 
00101        // Trash Folder
00102         NS_IMETHOD   SetOnlineTrashFolderExistsForHost(const char *serverKey, PRBool exists) = 0;
00103         NS_IMETHOD   GetOnlineTrashFolderExistsForHost(const char *serverKey, PRBool &result) = 0;
00104        
00105        // INBOX
00106         NS_IMETHOD          GetOnlineInboxPathForHost(const char *serverKey, nsString &result) = 0;
00107         NS_IMETHOD          GetShouldAlwaysListInboxForHost(const char *serverKey, PRBool &result) = 0;
00108         NS_IMETHOD          SetShouldAlwaysListInboxForHost(const char *serverKey, PRBool shouldList) = 0;
00109 
00110        // Namespaces
00111         NS_IMETHOD          GetNamespaceForMailboxForHost(const char *serverKey, const char *mailbox_name, nsIMAPNamespace * & result) = 0;
00112         NS_IMETHOD          SetNamespaceFromPrefForHost(const char *serverKey, const char *namespacePref, EIMAPNamespaceType type) = 0;
00113         NS_IMETHOD          AddNewNamespaceForHost(const char *serverKey, nsIMAPNamespace *ns) = 0;
00114         NS_IMETHOD          ClearServerAdvertisedNamespacesForHost(const char *serverKey) = 0;
00115         NS_IMETHOD          ClearPrefsNamespacesForHost(const char *serverKey) = 0;
00116         NS_IMETHOD          GetDefaultNamespaceOfTypeForHost(const char *serverKey, EIMAPNamespaceType type, nsIMAPNamespace * & result) = 0;
00117         NS_IMETHOD          SetNamespacesOverridableForHost(const char *serverKey, PRBool overridable) = 0;
00118         NS_IMETHOD          GetNamespacesOverridableForHost(const char *serverKey,PRBool &result) = 0;
00119         NS_IMETHOD          GetNumberOfNamespacesForHost(const char *serverKey, PRUint32 &result) = 0;
00120         NS_IMETHOD          GetNamespaceNumberForHost(const char *serverKey, PRInt32 n, nsIMAPNamespace * &result) = 0;
00121         // ### dmb hoo boy, how are we going to do this?
00122         NS_IMETHOD          CommitNamespacesForHost(nsIImapIncomingServer *server) = 0;
00123         NS_IMETHOD          FlushUncommittedNamespacesForHost(const char *serverKey, PRBool &result) = 0;
00124 
00125 
00126        // Hierarchy Delimiters
00127         NS_IMETHOD          SetNamespaceHierarchyDelimiterFromMailboxForHost(const char *serverKey, const char *boxName, char delimiter) = 0;
00128 
00129        // Message Body Shells
00130         NS_IMETHOD          AddShellToCacheForHost(const char *serverKey, nsIMAPBodyShell *shell) = 0;
00131         NS_IMETHOD          FindShellInCacheForHost(const char *serverKey, const char *mailboxName, const char *UID, IMAP_ContentModifiedType modType, nsIMAPBodyShell  **result) = 0;
00132 
00133 };
00134 
00135 #endif