Back to index

lightning-sunbird  0.9+nobinonly
nsIImapService.idl
Go to the documentation of this file.
00001 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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) 2000
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 
00039 // The IMAP Service is an interfaced designed to make building and running imap urls
00040 // easier. Clients typically go to the imap service and ask it do things such as:
00041 // get new mail, etc....
00042 //
00043 // Oh and in case you couldn't tell by the name, the imap service is a service! and you
00044 // should go through the service manager to obtain an instance of it.
00046 
00047 #include "nsISupports.idl"
00048 #include "nsIImapUrl.idl"
00049 
00050 interface nsIImapProtocol;
00051 interface nsIImapMessageSink;
00052 interface nsIUrlListener;
00053 interface nsIURI;
00054 interface nsIEventQueue;
00055 interface nsIMsgFolder;
00056 interface nsIMsgWindow;
00057 interface nsIImapIncomingServer;
00058 interface nsICacheSession;
00059 
00060 
00061 [scriptable, uuid(4032dc12-8684-4458-9b41-647034d8c7d2)]
00062 interface nsIImapService : nsISupports
00063 {
00064        // As always, you can pass in null for the url listener and the url if you don't require either.....
00065        // aClientEventQueue is the event queue of the event sinks. We post events into this queue.
00066        // mscott -- eventually this function will take in the account (identity/incoming server) associated with 
00067        // the request
00068   void selectFolder(in nsIEventQueue aClientEventQueue, 
00069                     in nsIMsgFolder aImapMailFolder,
00070                     in nsIUrlListener aUrlListener,
00071                     in nsIMsgWindow   aMsgWindow,
00072                     out nsIURI aURL);
00073   
00074   void liteSelectFolder(in nsIEventQueue aClientEventQueue, 
00075                         in nsIMsgFolder aImapMailFolder,
00076                         in nsIUrlListener aUrlListener,
00077                         out nsIURI aURL);
00078   
00079   void fetchMessage(in nsIImapUrl aUrl,
00080                     in nsImapState aImapAction,
00081                     in nsIMsgFolder aImapMailFolder,
00082                     in nsIImapMessageSink aImapMessageSink,
00083                     in nsIMsgWindow aMsgWindow, 
00084                     in nsISupports aConsumer,
00085                     in string aMessageIdentifierList,
00086                     in boolean convertDataToText,
00087                     in string additionalHeader,
00088                     out nsIURI aOutURL);
00089 
00090   void noop(in nsIEventQueue aClientEventQueue, 
00091             in nsIMsgFolder aImapMailFolder,
00092             in nsIUrlListener aUrlListener,
00093             out nsIURI aURL);
00094 
00095   void getHeaders(in nsIEventQueue aClientEventQueue, 
00096                   in nsIMsgFolder aImapMailFolder,
00097                   in nsIUrlListener aUrlListener,
00098                   out nsIURI aURL,
00099                   in string aMessageIdentifierList,
00100                   in boolean aMessageIdsAreUID);
00101 
00102   nsIURI getBodyStart(in nsIEventQueue aClientEventQueue, 
00103                   in nsIMsgFolder aImapMailFolder,
00104                   in nsIUrlListener aUrlListener,
00105                   in string aMessageIdentifierList,
00106                   in long numBytes);
00107 
00108   void expunge(in nsIEventQueue aClientEventQueue, 
00109                in nsIMsgFolder aImapMailFolder,
00110                in nsIUrlListener aUrlListener,
00111                out nsIURI aURL);
00112   
00113   nsIURI updateFolderStatus(in nsIEventQueue aClientEventQueue, 
00114                in nsIMsgFolder aImapMailFolder,
00115                in nsIUrlListener aUrlListener);
00116 
00117   void biff(in nsIEventQueue aClientEventQueue, 
00118             in nsIMsgFolder aImapMailFolder,
00119             in nsIUrlListener aUrlListener,
00120             out nsIURI aURL,
00121             in unsigned long aUidHighWater);
00122 
00123   void deleteMessages(in nsIEventQueue aClientEventQueue, 
00124                       in nsIMsgFolder aImapMailFolder,
00125                       in nsIUrlListener aUrlListener,
00126                       out nsIURI aURL,
00127                       in string aMessageIdentifierList,
00128                       in boolean aMessageIdsAreUID);
00129 
00130   void deleteAllMessages(in nsIEventQueue aClientEventQueue, 
00131                          in nsIMsgFolder aImapMailFolder,
00132                          in nsIUrlListener aUrlListener,
00133                          out nsIURI aURL);
00134   
00135   void addMessageFlags(in nsIEventQueue aClientEventQueue, 
00136                          in nsIMsgFolder aImapMailFolder,
00137                          in nsIUrlListener aUrlListener,
00138                          out nsIURI aURL,
00139                          in string aMessageIdentifierList,
00140                          in imapMessageFlagsType aFlags,
00141                          in boolean aMessageIdsAreUID);
00142   
00143   void subtractMessageFlags(in nsIEventQueue aClientEventQueue, 
00144                             in nsIMsgFolder aImapMailFolder,
00145                             in nsIUrlListener aUrlListener,
00146                             out nsIURI aURL,
00147                             in string aMessageIdentifierList,
00148                             in imapMessageFlagsType aFlags,
00149                             in boolean aMessageIdsAreUID);
00150 
00151   void setMessageFlags(in nsIEventQueue aClientEventQueue, 
00152                        in nsIMsgFolder aImapMailFolder,
00153                        in nsIUrlListener aUrlListener,
00154                        out nsIURI aURL,
00155                        in string aMessageIdentifierList,
00156                        in imapMessageFlagsType aFlags,
00157                        in boolean aMessageIdsAreUID);
00158   
00159   void discoverAllFolders(in nsIEventQueue aClientEventQueue, 
00160                           in nsIMsgFolder aImapMailFolder,
00161                           in nsIUrlListener aUrlListener,
00162                           in nsIMsgWindow aMsgWindow,
00163                           out nsIURI aURL);
00164 
00165   void discoverAllAndSubscribedFolders(in nsIEventQueue aClientEventQueue, 
00166                                        in nsIMsgFolder aImapMailFolder,
00167                                        in nsIUrlListener aUrlListener,
00168                                        out nsIURI aURL);
00169   void discoverChildren(in nsIEventQueue aClientEventQueue, 
00170                         in nsIMsgFolder aImapMailFolder,
00171                         in nsIUrlListener aUrlListener,
00172                         in string folderPath,
00173                         out nsIURI aURL);
00174 
00175   void onlineMessageCopy(in nsIEventQueue aClientEventQueue, 
00176                          in nsIMsgFolder aSrcFolder,
00177                          in string aMessageIds,
00178                          in nsIMsgFolder aDstFolder,
00179                          in boolean aIdsAreUids,
00180                          in boolean aIsMove,
00181                          in nsIUrlListener aUrlListener,
00182                          out nsIURI aURL,
00183                          in nsISupports aCopyState,
00184                          in nsIMsgWindow aWindow);
00185 
00186 
00187   void appendMessageFromFile(in nsIEventQueue aClientEventQueue, 
00188                              in nsIFileSpec aFileSpec,
00189                              in nsIMsgFolder aDstFolder,
00190                              in string aMessageId,
00191                              in boolean idsAreUids,
00192                              in boolean aInSelectedState,
00193                              in nsIUrlListener aUrlListener,
00194                              out nsIURI aURL,
00195                              in nsISupports aCopyState,
00196                              in nsIMsgWindow aMsgWindow);
00197   
00198   void downloadMessagesForOffline(in string aMessageIds, in nsIMsgFolder aSrcFolder,
00199                       in nsIUrlListener aListener, in nsIMsgWindow   aMsgWindow);
00200 
00201   nsIURI moveFolder(in nsIEventQueue aClientEventQueue, 
00202                     in nsIMsgFolder aSrcFolder,
00203                     in nsIMsgFolder aDstFolder,
00204                     in nsIUrlListener aUrlListener,
00205                     in nsIMsgWindow msgWindow);
00206 
00207   nsIURI renameLeaf(in nsIEventQueue aClientEventQueue, 
00208                     in nsIMsgFolder aSrcFolder,
00209                     in wstring aLeafName,
00210                     in nsIUrlListener aUrlListener,
00211                     in nsIMsgWindow msgWindow);
00212 
00213   nsIURI deleteFolder(in nsIEventQueue aClientEventQueue, 
00214                       in nsIMsgFolder aFolder,
00215                       in nsIUrlListener aUrlListener);
00216 
00217   nsIURI createFolder(in nsIEventQueue aClientEventQueue, 
00218                       in nsIMsgFolder aParentFolder,
00219                       in wstring aLeafName,
00220                       in nsIUrlListener aUrlListener);
00221   
00222   nsIURI listFolder(in nsIEventQueue aClientEventQueue, 
00223                     in nsIMsgFolder aMailFolder,
00224                     in nsIUrlListener aUrlListener);
00225 
00226   nsIURI subscribeFolder(in nsIEventQueue aClientEventQueue,
00227                          in nsIMsgFolder aMailFolder,
00228                          in wstring mailboxName,
00229                          in nsIUrlListener aUrlListener);
00230 
00231   nsIURI unsubscribeFolder(in nsIEventQueue aClientEventQueue,
00232                            in nsIMsgFolder aMailFolder,
00233                            in wstring mailboxName,
00234                            in nsIUrlListener aUrlListener);
00235 
00236   // this method will first check if the folder exists but is
00237   // not subscribed to, in which case it will subscribe to the folder.
00238   // otherwise, it will try to create the folder. It will try to do this
00239   // with one url.
00240   nsIURI ensureFolderExists(in nsIEventQueue aClientEventQueue,
00241                             in nsIMsgFolder aParentFolder,
00242                             in wstring aLeafName,
00243                             in nsIUrlListener aUrlListener);
00244 
00245 
00246   nsIURI getFolderAdminUrl(in nsIEventQueue aClientEventQueue,
00247                       in nsIMsgFolder aMailFolder,
00248                       in nsIMsgWindow   aMsgWindow,
00249                       in nsIUrlListener aUrlListener);
00250 
00251   nsIURI issueCommandOnMsgs(in nsIEventQueue aClientEventQueue,
00252                       in nsIMsgFolder aMailFolder,
00253                       in nsIMsgWindow aMsgWindow,
00254                       in string aCommand,
00255                       in string aMessageIdentifierList);
00256 
00257   nsIURI fetchCustomMsgAttribute(in nsIEventQueue aClientEventQueue,
00258                       in nsIMsgFolder aMailFolder,
00259                       in nsIMsgWindow aMsgWindow,
00260                       in string aAttribute,
00261                       in string aMessageIdentifierList);
00262 
00263   nsIURI storeCustomKeywords(in nsIEventQueue aClientEventQueue,
00264                       in nsIMsgFolder aMailFolder,
00265                       in nsIMsgWindow aMsgWindow,
00266                       in string flagsToAdd,
00267                       in string flagsToSubtract,
00268                       in string aMessageIdentifierList);
00269 
00270   void getListOfFoldersOnServer(in nsIImapIncomingServer aServer, in nsIMsgWindow aMsgWindow);
00271   void getListOfFoldersWithPath(in nsIImapIncomingServer aServer, in nsIMsgWindow aMsgWindow, in string folderPath);
00272 
00273   nsISupports playbackAllOfflineOperations(in nsIMsgWindow aMsgWindow, in nsIUrlListener aListener);
00274   void downloadAllOffineImapFolders(in nsIMsgWindow aMsgWindow, in nsIUrlListener aListener);
00275 
00276   readonly attribute nsICacheSession cacheSession;
00277 };