Back to index

lightning-sunbird  0.9+nobinonly
nsIMsgMailNewsUrl.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 #include "nsIURL.idl"
00040 
00041 interface nsIFileSpec;
00042 interface nsIUrlListener;
00043 interface nsIMsgStatusFeedback;
00044 interface nsIMsgIncomingServer;
00045 interface nsIMsgWindow;
00046 interface nsILoadGroup;
00047 interface nsIMsgSearchSession;
00048 interface nsICacheEntryDescriptor;
00049 interface nsICacheSession;
00050 interface nsIMimeHeaders;
00051 interface nsIStreamListener;
00052 interface nsIMsgFolder;
00053 interface nsIMsgHeaderSink;
00054 interface nsIMsgDBHdr;
00055 
00056 [scriptable, uuid(6CFFCEB0-CB8C-11d2-8065-006008128C4E)]
00057 interface nsIMsgMailNewsUrl : nsIURL {
00059        // Eventually we'd like to push this type of functionality up into nsIURI.
00060        // The idea is to allow the "application" (the part of the code which wants to 
00061        // run a url in order to perform some action) to register itself as a listener
00062        // on url. As a url listener, the app will be informed when the url begins to run
00063        // and when the url is finished. 
00065        void RegisterListener (in nsIUrlListener aUrlListener);
00066        void UnRegisterListener (in nsIUrlListener aUrlListener);
00067 
00068         readonly attribute nsIURI baseURI;
00069        // Eventually this will be removed and replaced with calls to nsIMsgStatusFeedback
00070        attribute string errorMessage;
00071 
00072        // if you really want to know what the current state of the url is (running or not
00073        // running) you should look into becoming a urlListener...
00074        void SetUrlState(in boolean runningUrl, in nsresult aStatusCode);
00075        void GetUrlState(out boolean runningUrl);
00076 
00077        readonly attribute nsIMsgIncomingServer server;
00078         attribute nsIMsgFolder folder;
00079 
00080        // the ownership model for msg feedback
00081        attribute nsIMsgStatusFeedback statusFeedback;
00082 
00083        attribute nsIMsgWindow msgWindow;
00084 
00085     // current mime headers if reading message
00086     attribute nsIMimeHeaders mimeHeaders;
00087 
00088        // the load group is computed from the msgWindow
00089        readonly attribute nsILoadGroup loadGroup;
00090 
00091        // search session, if we're running a search.
00092        attribute nsIMsgSearchSession searchSession;
00093        attribute boolean updatingFolder;
00094        attribute boolean addToMemoryCache; 
00095        attribute boolean msgIsInLocalCache;
00096        attribute boolean suppressErrorMsgs; // used to avoid displaying biff error messages
00097 
00098        attribute nsICacheEntryDescriptor memCacheEntry;
00099         // if we want mime to cache images fetched by this message, set this cache session.
00100         attribute nsICacheSession imageCacheSession; 
00101         // hold onto this cache entry until url goes away. This is used by mime to keep
00102         // images cached until the url is deleted so we don't get entries evicted
00103         // before we've used them. We need to be sure this doesn't introduce
00104         // circular references or the url will never get freed.
00105         void cacheCacheEntry(in nsICacheEntryDescriptor cacheEntry);
00106         void removeCacheEntry(in nsICacheEntryDescriptor cacheEntry);
00107        const unsigned long eCopy     = 0;
00108        const unsigned long eMove     = 1;
00109        const unsigned long eDisplay  = 2;
00110        boolean IsUrlType(in unsigned long type);
00111     nsIStreamListener getSaveAsListener(in boolean addDummyEnvelope, in nsIFileSpec aFileSpec);
00112 
00113     // typically the header sink is tied to the nsIMsgWindow, but in certain circumstances, a consumer
00114     // may chose to provide its own header sink for this url
00115     attribute nsIMsgHeaderSink msgHeaderSink;
00116 };
00117 
00119 // This is a very small interface which I'm grouping with the mailnewsUrl interface.
00120 // Several url types (mailbox, imap, nntp) have similar properties because they can
00121 // represent mail messages. For instance, these urls can be have URI 
00122 // equivalents which represent a message. 
00123 // We want to provide the app the ability to get the URI for the 
00124 // url. This URI to URL mapping doesn't exist for all mailnews urls...hence I'm
00125 // grouping it into a separate interface...
00127 
00128 [scriptable, uuid(6BEED963-0424-44C5-A605-C01F6DCBAAC2)]
00129 interface nsIMsgMessageUrl : nsISupports {
00130   // get and set the RDF URI associated with the url. Note, not all urls have
00131   // had uri's set on them so be prepared to handle cases where this string is empty.
00132   attribute string uri;
00133   // used by imap, pop and nntp in order to implement save message to disk
00134   attribute nsIFileSpec messageFile;
00135   attribute boolean AddDummyEnvelope;     
00136   attribute boolean canonicalLineEnding;
00137   attribute string originalSpec;
00138   // a message db header for that message.
00139   readonly attribute nsIMsgDBHdr messageHeader;
00140 
00141 };
00142 
00144 // This is a very small interface which I'm grouping with the mailnewsUrl interface.
00145 // I want to isolate out all the I18N specific information that may be associated with
00146 // any given mailnews url. This gives I18N their own "sandbox" of routines they can add
00147 // and tweak as they see fit. For now it contains mostly charset information.
00149 
00150 [scriptable, uuid(D71E0785-2862-11d4-98C1-001083010E9B)]
00151 interface nsIMsgI18NUrl : nsISupports {
00152        // the charset associated with a folder for this url.....
00153        readonly attribute string folderCharset;
00154        readonly attribute boolean folderCharsetOverride;
00155        // the charsetOverRide is a charset the user may have specified via the menu for
00156        // a particular message
00157        attribute string charsetOverRide;
00158 };