Back to index

lightning-sunbird  0.9+nobinonly
nsIMsgMessageService.idl
Go to the documentation of this file.
00001 /* -*- Mode: IDL; 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) 1998
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 #include "nsISupports.idl"
00039 
00040 interface nsIURI;
00041 interface nsIUrlListener;
00042 interface nsIStreamListener;
00043 interface nsIMsgWindow;
00044 interface nsIFileSpec;
00045 interface nsIMsgFolder;
00046 interface nsIMsgSearchSession;
00047 interface nsIMsgDBHdr;
00048 interface nsIStreamConverter;
00049 
00050 %{C++
00051 #include "nsMsgKeyArray.h"
00052 %}
00053 
00054 [ptr] native nsMsgKeyArrayPtr(nsMsgKeyArray);
00055 
00056 
00057 [scriptable, uuid(F11009C1-F697-11d2-807F-006008128C4E)]
00058 interface nsIMsgMessageService : nsISupports {
00059      
00061      // If you want a handle on the running task, pass in a valid nsIURI 
00062      // ptr. You can later interrupt this action by asking the netlib 
00063      // service manager to interrupt the url you are given back. 
00064      // Remember to release aURL when you are done with it. Pass nsnull
00065      // in for aURL if you don't  care about the returned URL.
00067 
00068 
00070      // CopyMessage: Pass in the URI for the message you want to have 
00071      // copied.
00072      // aCopyListener already knows about the destination folder. 
00073      // Set aMoveMessage to PR_TRUE if you want the message to be moved.
00074      // PR_FALSE leaves it as just a copy.
00076   
00077        void CopyMessage(in string aSrcURI, in nsIStreamListener aCopyListener, in boolean aMoveMessage,
00078                                              in nsIUrlListener aUrlListener, in nsIMsgWindow aMsgWindow, out nsIURI aURL);
00079 
00080     /* copy multiple messages at a time */
00081        [noscript] void CopyMessages(in nsMsgKeyArrayPtr keys, in nsIMsgFolder srcFolder, in nsIStreamListener aCopyListener, in boolean aMoveMessage,
00082                                              in nsIUrlListener aUrlListener, in nsIMsgWindow aMsgWindow, out nsIURI aURL);
00083 
00085     //  DisplayMessage: When you want a message displayed....
00086     //  aMessageURI    is a uri representing the message to display.
00087     //  aDisplayConsumer is (for now) an nsIDocShell which we'll use to load 
00088     //  the message into.
00089     //  XXXbz Should it be an nsIWebNavigation or something?
00090          //   aCharsetOverride  (optional) character set over ride to force the message to
00091          //  use.
00092          //
00094 
00095        void DisplayMessage(in string aMessageURI, 
00096                                           in nsISupports aDisplayConsumer, 
00097                                           in nsIMsgWindow aMsgWindow,
00098                                           in nsIUrlListener aUrlListener, 
00099                                           in string aCharsetOverride, 
00100                                           out nsIURI aURL);
00101 
00103      //  OpenAttachment: When you want an attachment downloaded
00104      //  aContentType --> we need to know the content type of the attachment
00105         //     aFileName --> the name of the attachment.
00106         //     aUrl --> string representation of the original url associated with the msg.
00107         //  aMessageUri --> RDF resource that describes the message
00108         //     aMsgWindow --> message window
00110 
00111        void openAttachment(in string aContentType, 
00112                                           in string aFileName, 
00113                                           in string aUrl,
00114                                           in string aMessageUri, 
00115                                           in nsISupports aDisplayConsumer, 
00116                                           in nsIMsgWindow aMsgWindow,
00117                                           in nsIUrlListener aUrlListener);
00118 
00120      // SaveMessageToDisk: When you want to spool a message out to a file
00121         // on disk. This is an asynch operation of course. You must pass in a
00122         // url listener in order to figure out when the operation is done.
00123         // aMessageURI--> uri representing the message to spool out to disk.
00124         // aFile - the file you want the message saved to
00125         // aGenerateDummyEnvelope --> usually FALSE. Set to TRUE if you want the msg
00126         //                                  appended at the end of the file. 
00128 
00129   void SaveMessageToDisk(in string aMessageURI, in nsIFileSpec aFile,
00130                          in boolean aGenerateDummyEnvelope, 
00131                          in nsIUrlListener aUrlListener, out nsIURI aURL,
00132                          in boolean canonicalLineEnding, in nsIMsgWindow aMsgWindow);
00133 
00135        // GetUrlForUri: when you have a uri and you would like to convert that
00136        // to a url which can be run through necko, you can use this method.
00137        // the Uri MUST refer to a message and not a folder! 
00139     
00140        void GetUrlForUri(in string aMessageURI, out nsIURI aURL, in nsIMsgWindow aMsgWindow);
00141 
00143      //  DisplayMessageForPrinting: When you want a message displayed in a
00144      //  format that is suitable for printing....
00145      //  aMessageURI is a uri representing the message to display.
00146      //  aDisplayConsumer is (for now) a nsIDocShell which we'll use to load 
00147      //  the message into.
00148      //  XXXbz should it be an nsIWebNavigation?
00150 
00151        void DisplayMessageForPrinting(in string aMessageURI, in nsISupports aDisplayConsumer, 
00152                                           in nsIMsgWindow aMsgWindow,
00153                                           in nsIUrlListener aUrlListener, 
00154                                           out nsIURI aURL);
00155 
00156        void Search(in nsIMsgSearchSession aSearchSession, in nsIMsgWindow aMsgWindow, in nsIMsgFolder aMsgFolder, in string aSearchUri);
00157 
00158   // this method streams a message to the passed in consumer. If aConvertData is true, it
00159   // will create a stream converter from message rfc822 to star/star. It will also tack
00160   // aAdditionalHeader onto the url (e.g., "header=filter").
00161   // @param aMessageURI  uri of message to stream
00162   // @param aConsumer    generally, a stream listener listening to the message
00163   // @param aMsgWindow   msgWindow for give progress and status feedback
00164   // @param aUrlListener gets notified when url starts and stops
00165   // @param aConvertData should we create a stream converter?
00166   // @param aAdditionalHeader added to URI, e.g., "header=filter"
00167   // @return the URL that gets run
00168   nsIURI streamMessage(in string aMessageURI, in nsISupports aConsumer, 
00169                     in nsIMsgWindow aMsgWindow,
00170                     in nsIUrlListener aUrlListener, 
00171                     in boolean aConvertData,
00172                     in string aAdditionalHeader);
00177     nsIMsgDBHdr messageURIToMsgHdr(in string uri);
00178 };
00179 
00180 // Some mail protocols (like imap) allow you to fetch individual mime parts. We use this interface
00181 // to represent message services whose protocols support this. To use this interface, you should get
00182 // the message service then QI for this interface. If it's present, then can fetch a mime part.
00183 [scriptable, uuid(3728C255-480C-11d4-98D0-001083010E9B)]
00184 interface nsIMsgMessageFetchPartService : nsISupports 
00185 {
00186        // FetchMimePart --> used to fetch an individual mime part
00187        // aURI --> url representing the message
00188        // aMessageURI --> RDF URI including the part to fetch
00189        nsIURI fetchMimePart(in nsIURI aURI, in string aMessageUri, in nsISupports aDisplayConsumer, 
00190                                           in nsIMsgWindow aMsgWindow,
00191                                           in nsIUrlListener aUrlListener);   
00192 };