Diff for /chimera/ProgressDlgController.mm between versions 1.5 and 1.6

version 1.5, 2002/02/04 00:14:25 version 1.6, 2002/02/04 00:55:49
Line 8 Line 8
 #import "ProgressDlgController.h"  #import "ProgressDlgController.h"
   #include "nsCOMPtr.h"
   #include "nsString.h"
 #include "nsIWebBrowserPersist.h"  #include "nsIWebBrowserPersist.h"
 #include "nsIInputStream.h"  #include "nsIInputStream.h"
 #include "nsIURL.h"  #include "nsIURL.h"
 #include "nsIDOMDocument.h"  #include "nsIDOMDocument.h"
   #include "nsIWebProgressListener.h"
   class nsDownloadListener : public nsIWebProgressListener
       nsDownloadListener(ProgressDlgController* aController,
                          nsIWebBrowserPersist* aPersist,
                          nsISupports* aSource,
                          NSString* aDestination,
                          const char* aContentType,
                          nsIInputStream* aPostData,
                          BOOL aBypassCache)
           mController = aController;
           mWebPersist = aPersist;
           // The source is either a simple URL or a complete document.
           mURL = do_QueryInterface(aSource);
           if (!mURL)
               mDocument = do_QueryInterface(aSource);
           mDestination = [aDestination cString];
           mContentType = aContentType;
           mPostData = aPostData;
           mBypassCache = aBypassCache;
       virtual ~nsDownloadListener() {};
       void BeginDownload();
   private: // Member variables
       ProgressDlgController* mController; // Controller for our UI.
       nsIWebBrowserPersist* mWebPersist; // Our web persist object.
       nsCOMPtr<nsIURL> mURL; // The URL of our source file. Null if we're saving a complete document.
       nsCString mDestination; // Our destination string.
       nsCString mContentType; // Our content type string.
       nsCOMPtr<nsIDOMDocument> mDocument; // A DOM document.  Null if we're only saving a simple URL.
       nsCOMPtr<nsIInputStream> mPostData;  // For complete documents, this is our post data from session history.
       PRBool mBypassCache; // Whether we should bypass the cache or not.
   NS_IMPL_ISUPPORTS1(nsDownloadListener, nsIWebProgressListener)
   /* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
   nsDownloadListener::OnProgressChange(nsIWebProgress *aWebProgress, 
                                            nsIRequest *aRequest, 
                                            PRInt32 aCurSelfProgress, 
                                            PRInt32 aMaxSelfProgress, 
                                            PRInt32 aCurTotalProgress, 
                                            PRInt32 aMaxTotalProgress)
     return NS_OK;
   /* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */
   nsDownloadListener::OnLocationChange(nsIWebProgress *aWebProgress, 
                                            nsIRequest *aRequest, 
                                            nsIURI *location)
     return NS_OK;
   /* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
   nsDownloadListener::OnStatusChange(nsIWebProgress *aWebProgress, 
                                          nsIRequest *aRequest, 
                                          nsresult aStatus, 
                                          const PRUnichar *aMessage)
     return NS_OK;
   /* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
   nsDownloadListener::OnSecurityChange(nsIWebProgress *aWebProgress, 
                                                         nsIRequest *aRequest, 
                                     PRInt32 state)
     return NS_OK;
   // Implementation of nsIWebProgressListener
   /* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
   nsDownloadListener::OnStateChange(nsIWebProgress *aWebProgress, 
                                         nsIRequest *aRequest, 
                                         PRInt32 aStateFlags, 
                                         PRUint32 aStatus)
       return NS_OK;
 static NSString *SaveFileToolbarIdentifier                      = @"Save File Dialog Toolbar";  static NSString *SaveFileToolbarIdentifier                      = @"Save File Dialog Toolbar";
 static NSString *CancelToolbarItemIdentifier            = @"Cancel Toolbar Item";  static NSString *CancelToolbarItemIdentifier            = @"Cancel Toolbar Item";
Line 42  static NSString *LeaveOpenToolbarItemIde Line 147  static NSString *LeaveOpenToolbarItemIde
             postData:(nsIInputStream*)aInputStream              postData:(nsIInputStream*)aInputStream
          bypassCache:(BOOL)aBypassCache           bypassCache:(BOOL)aBypassCache
 {  {
    nsDownloadListener* downloadListener = new nsDownloadListener(self, aPersist, aSource,
                                                                   aDestination, aContentType,
                                                                   aInputStream, aBypassCache);
     if (!downloadListener)
 }  }
 - (void)windowDidLoad  - (void)windowDidLoad

Removed from v.1.5  
changed lines
  Added in v.1.6

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>