DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (5f5af71fa66b)

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla 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/MPL/
 *
 * 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):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either of 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 MPL, 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 MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#include "nsISupports.idl"

interface nsIURI;
interface nsIUrlListener;
interface nsIStreamListener;
interface nsIMsgWindow;
interface nsIFile;
interface nsIMsgFolder;
interface nsIMsgSearchSession;
interface nsIMsgDBHdr;
interface nsIStreamConverter;
interface nsICacheEntryDescriptor;

%{C++
#include "MailNewsTypes.h"
#include "nsTArray.h"
%}

[ref] native nsMsgKeyArrayRef(nsTArray<nsMsgKey>);


[scriptable, uuid(5f173e8d-0046-4eec-b178-b850a7211654)]
interface nsIMsgMessageService : nsISupports {
     
  /**
   * If you want a handle on the running task, pass in a valid nsIURI 
   * ptr. You can later interrupt this action by asking the netlib 
   * service manager to interrupt the url you are given back. 
   * Remember to release aURL when you are done with it. Pass nsnull
   * in for aURL if you don't care about the returned URL.
   */


  /**
   * Pass in the URI for the message you want to have copied.
   *
   * @param aSrcURI
   * @param aCopyListener already knows about the destination folder. 
   * @param aMoveMessage TRUE if you want the message to be moved.
   *                     FALSE leaves it as just a copy.
   * @param aUrlListener 
   * @param aMsgWindow
   * @param aURL
   */
  void CopyMessage(in string aSrcURI, in nsIStreamListener aCopyListener, in boolean aMoveMessage,
               in nsIUrlListener aUrlListener, in nsIMsgWindow aMsgWindow, out nsIURI aURL);

  /**
   * Copy multiple messages at a time 
   *
   * @param keys
   * @param srcFolder
   * @param aCopyListener
   * @param aMoveMessage
   * @param aUrlListener
   * @param aMsgWindow
   * @param aURL
   */
  [noscript] void CopyMessages(in nsMsgKeyArrayRef keys, in nsIMsgFolder srcFolder, in nsIStreamListener aCopyListener, in boolean aMoveMessage,
               in nsIUrlListener aUrlListener, in nsIMsgWindow aMsgWindow, out nsIURI aURL);

    
  /**
   * When you want a message displayed....
   *
   * @param aMessageURI Is a uri representing the message to display.
   * @param aDisplayConsumer Is (for now) an nsIDocShell which we'll use to load 
   *                         the message into.
   *                         XXXbz Should it be an nsIWebNavigation or something?
   * @param aMsgWindow
   * @param aUrlListener
   * @param aCharsetOverride (optional) character set over ride to force the message to use.
   * @param aURL
   */
  void DisplayMessage(in string aMessageURI, 
            in nsISupports aDisplayConsumer, 
            in nsIMsgWindow aMsgWindow,
            in nsIUrlListener aUrlListener, 
            in string aCharsetOverride, 
            out nsIURI aURL);

  /**
   * When you want an attachment downloaded
   *
   * @param aContentType We need to know the content type of the attachment
   * @param aFileName The name of the attachment.
   * @param aUrl String representation of the original url associated with the msg.
   * @param aMessageUri RDF resource that describes the message
   * @param aDisplayConsumer
   * @param aMsgWindow Message window
   * @param aUrlListener
   */
  void openAttachment(in string aContentType, 
            in string aFileName, 
            in string aUrl,
            in string aMessageUri, 
            in nsISupports aDisplayConsumer, 
            in nsIMsgWindow aMsgWindow,
            in nsIUrlListener aUrlListener);

  /**
   * When you want to spool a message out to a file on disk. 
   * This is an asynch operation of course. You must pass in a
   * url listener in order to figure out when the operation is done.
   *
   * @param aMessageURI The uri representing the message to spool out to disk.
   * @param aFile The file you want the message saved to
   * @param aGenerateDummyEnvelope Usually FALSE. Set to TRUE if you want the msg
   *        appended at the end of the file.
   * @param aUrlListener
   * @param aURL
   * @param canonicalLineEnding
   * @param aMsgWindow
   */
  void SaveMessageToDisk(in string aMessageURI, in nsIFile aFile,
                         in boolean aGenerateDummyEnvelope, 
                         in nsIUrlListener aUrlListener, out nsIURI aURL,
                         in boolean canonicalLineEnding, in nsIMsgWindow aMsgWindow);

  /**
   * When you have a uri and you would like to convert that
   * to a url which can be run through necko, you can use this method.
   * the Uri MUST refer to a message and not a folder! 
   *
   * @param aMessageURI A message uri to convert.
   * @param aURL URL which can be run through necko.
   * @param aMsgWindow    
   */
  void GetUrlForUri(in string aMessageURI, out nsIURI aURL, in nsIMsgWindow aMsgWindow);

  /**
   * When you want a message displayed in a format that is suitable for printing....
   *
   * @param aMessageURI A uri representing the message to display.
   * @param aDisplayConsumer is (for now) a nsIDocShell which we'll use to load 
   *        the message into. 
   *        XXXbz should it be an nsIWebNavigation?
   * @param aMsgWindow
   * @param aUrlListener
   * @param aURL 
   */
  void DisplayMessageForPrinting(in string aMessageURI, in nsISupports aDisplayConsumer, 
            in nsIMsgWindow aMsgWindow,
            in nsIUrlListener aUrlListener, 
            out nsIURI aURL);

  /**
   *
   *
   * @param aSearchSession
   * @param aMsgWindow
   * @param aMsgFolder
   * @param aSearchUri
   */
  void Search(in nsIMsgSearchSession aSearchSession, in nsIMsgWindow aMsgWindow, in nsIMsgFolder aMsgFolder, in string aSearchUri);

  /** 
   * This methot streams a message to the passed in consumer. If aConvertData is true, it
   * will create a stream converter from message rfc822 to star/star. It will also tack
   * aAdditionalHeader onto the url (e.g., "header=filter").
   *
   * @param aMessageURI  uri of message to stream
   * @param aConsumer    generally, a stream listener listening to the message
   * @param aMsgWindow   msgWindow for give progress and status feedback
   * @param aUrlListener gets notified when url starts and stops
   * @param aConvertData should we create a stream converter?
   * @param aAdditionalHeader added to URI, e.g., "header=filter"
   * @param aLocalOnly whether data should be retrieved only from local caches
   *        If streaming over the network is required and this is true, then
   *        an exception is thrown. This defaults to false.
   *
   * @note If we're offline, then even if aLocalOnly is false, we won't stream over the
   *       network
   *
   * @return the URL that gets run
   */
  nsIURI streamMessage(in string aMessageURI, in nsISupports aConsumer, 
                    in nsIMsgWindow aMsgWindow,
                    in nsIUrlListener aUrlListener, 
                    in boolean aConvertData,
                    in ACString aAdditionalHeader,
                    [optional] in boolean aLocalOnly);

  
  /**
   * Determines whether a message is in the memory cache. Local folders
   * don't implement this.
   *
   * @param aUrl The URL of the message, possibly with an appropriate command in it
   * @param aFolder The folder this message is in
   * @param aCacheEntry If a cache entry is found, then a pointer to it
   * 
   * @return TRUE if the message is in mem cache; FALSE if it is not.
   */
  boolean isMsgInMemCache(in nsIURI aUrl,
                          in nsIMsgFolder aFolder,
                          out nsICacheEntryDescriptor aCacheEntry);

  /**
   * now the the message datasource is going away
   * we need away to go from message uri to go nsIMsgDBHdr
   *
   * @param uri A message uri to get nsIMsgDBHdr for.
   *
   * @return nsIMsgDBHdr for specified uri or null if failed. 
   */
  nsIMsgDBHdr messageURIToMsgHdr(in string uri);
};

/** 
 * Some mail protocols (like imap) allow you to fetch individual mime parts. We use this interface
 * to represent message services whose protocols support this. To use this interface, you should get
 * the message service then QI for this interface. If it's present, then can fetch a mime part.
 */
[scriptable, uuid(3728C255-480C-11d4-98D0-001083010E9B)]
interface nsIMsgMessageFetchPartService : nsISupports 
{
  /**
   * Used to fetch an individual mime part
   *
   * @param aURI url representing the message
   * @param aMessageURI RDF URI including the part to fetch
   * @param aDisplayConsumer
   * @param aMsgWindow
   * @param aUrlListener
   *
   * @return
   */
  nsIURI fetchMimePart(in nsIURI aURI, in string aMessageUri, in nsISupports aDisplayConsumer, 
            in nsIMsgWindow aMsgWindow,
            in nsIUrlListener aUrlListener);  
};