Back to index

lightning-sunbird  0.9+nobinonly
nsMsgMailNewsUrl.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) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Scott MacGregor <mscott@netscape.com>
00024  *
00025  * Alternatively, the contents of this file may be used under the terms of
00026  * either of the GNU General Public License Version 2 or later (the "GPL"),
00027  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00028  * in which case the provisions of the GPL or the LGPL are applicable instead
00029  * of those above. If you wish to allow use of your version of this file only
00030  * under the terms of either the GPL or the LGPL, and not to allow others to
00031  * use your version of this file under the terms of the MPL, indicate your
00032  * decision by deleting the provisions above and replace them with the notice
00033  * and other provisions required by the GPL or the LGPL. If you do not delete
00034  * the provisions above, a recipient may use your version of this file under
00035  * the terms of any one of the MPL, the GPL or the LGPL.
00036  *
00037  * ***** END LICENSE BLOCK ***** */
00038 
00039 #ifndef nsMsgMailNewsUrl_h___
00040 #define nsMsgMailNewsUrl_h___
00041 
00042 #include "nscore.h"
00043 #include "nsISupports.h"
00044 #include "nsIUrlListener.h"
00045 #include "nsIUrlListenerManager.h"
00046 #include "nsIMsgWindow.h"
00047 #include "nsIMsgStatusFeedback.h"
00048 #include "nsCOMPtr.h"
00049 #include "nsIMimeHeaders.h"
00050 #include "nsIMsgMailNewsUrl.h"
00051 #include "nsIURL.h"
00052 #include "nsILoadGroup.h"
00053 #include "nsIMsgSearchSession.h"
00054 #include "nsICacheEntryDescriptor.h"
00055 #include "nsICacheSession.h"
00056 #include "nsISupportsArray.h"
00057 #include "nsIMimeMiscStatus.h"
00058 
00060 // Okay, I found that all of the mail and news url interfaces needed to support
00061 // several common interfaces (in addition to those provided through nsIURI). 
00062 // So I decided to group them all in this implementation so we don't have to
00063 // duplicate the code.
00064 //
00066 
00067 #undef  IMETHOD_VISIBILITY
00068 #define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT
00069 
00070 class NS_MSG_BASE nsMsgMailNewsUrl : public nsIMsgMailNewsUrl
00071 {
00072 public:
00073     nsMsgMailNewsUrl();
00074 
00075     NS_DECL_ISUPPORTS
00076     NS_DECL_NSIMSGMAILNEWSURL
00077     NS_DECL_NSIURI
00078     NS_DECL_NSIURL
00079 
00080 protected:
00081   virtual ~nsMsgMailNewsUrl();
00082 
00083   // a helper function I needed from derived urls...
00084   virtual const char * GetUserName() = 0;
00085 
00086   nsCOMPtr<nsIURL> m_baseURL;
00087   nsCOMPtr<nsIMsgStatusFeedback> m_statusFeedback;
00088   nsCOMPtr<nsIMsgWindow> m_msgWindow;
00089   nsCOMPtr<nsILoadGroup> m_loadGroup;
00090   nsCOMPtr<nsIMimeHeaders> mMimeHeaders;
00091   nsCOMPtr<nsIMsgSearchSession> m_searchSession;
00092   nsCOMPtr<nsICacheEntryDescriptor> m_memCacheEntry;
00093   nsCOMPtr<nsICacheSession> m_imageCacheSession;
00094   nsCOMPtr<nsISupportsArray> m_cachedMemCacheEntries;
00095   nsCOMPtr<nsIMsgHeaderSink> mMsgHeaderSink;
00096   char *m_errorMessage;
00097   PRBool m_runningUrl;
00098   PRBool m_updatingFolder;
00099   PRBool m_addContentToCache;
00100   PRBool m_msgIsInLocalCache;
00101   PRBool m_suppressErrorMsgs;
00102 
00103   // the following field is really a bit of a hack to make 
00104   // open attachments work. The external applications code sometimes trys to figure out the right
00105   // handler to use by looking at the file extension of the url we are trying to load. Unfortunately,
00106   // the attachment file name really isn't part of the url string....so we'll store it here...and if 
00107   // the url we are running is an attachment url, we'll set it here. Then when the helper apps code
00108   // asks us for it, we'll return the right value.
00109   nsCString mAttachmentFileName;
00110 
00111   // manager of all of current url listeners....
00112   nsCOMPtr<nsIUrlListenerManager> m_urlListeners;
00113 };
00114 
00115 #undef  IMETHOD_VISIBILITY
00116 #define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN
00117 
00118 #endif /* nsMsgMailNewsUrl_h___ */