toolkit/components/downloads/nsIDownloadProgressListener.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/downloads/nsIDownloadProgressListener.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +/* A minimally extended progress listener used by download manager
    1.10 + * to update its default UI.  This is implemented in nsDownloadProgressListener.js.
    1.11 + * See nsIWebProgressListener for documentation, and use its constants.  This isn't
    1.12 + * too pretty, but the alternative is having this extend nsIWebProgressListener and
    1.13 + * adding an |item| attribute, which would mean a separate nsIDownloadProgressListener
    1.14 + * for every nsIDownloadItem, which is a waste...
    1.15 + */
    1.16 +
    1.17 +#include "nsISupports.idl"
    1.18 +
    1.19 +interface nsIWebProgress;
    1.20 +interface nsIRequest;
    1.21 +interface nsIURI;
    1.22 +interface nsIDownload;
    1.23 +interface nsIDOMDocument;
    1.24 +
    1.25 +[scriptable, uuid(7acb07ea-cac2-4c15-a3ad-23aaa789ed51)]
    1.26 +interface nsIDownloadProgressListener : nsISupports {
    1.27 +
    1.28 + /**
    1.29 +  * document
    1.30 +  * The document of the download manager frontend.
    1.31 +  */
    1.32 +  
    1.33 +  attribute nsIDOMDocument document;
    1.34 +
    1.35 + /**
    1.36 +  * Dispatched whenever the state of the download changes.
    1.37 +  *
    1.38 +  * @param aState The previous download sate.
    1.39 +  * @param aDownload The download object.
    1.40 +  * @see nsIDownloadManager for download states.
    1.41 +  */
    1.42 +  void onDownloadStateChange(in short aState, in nsIDownload aDownload);
    1.43 +
    1.44 +  void onStateChange(in nsIWebProgress aWebProgress,
    1.45 +                     in nsIRequest aRequest,
    1.46 +                     in unsigned long aStateFlags,
    1.47 +                     in nsresult aStatus,
    1.48 +                     in nsIDownload aDownload);
    1.49 +
    1.50 +  void onProgressChange(in nsIWebProgress aWebProgress,
    1.51 +                        in nsIRequest aRequest,
    1.52 +                        in long long aCurSelfProgress,
    1.53 +                        in long long aMaxSelfProgress,
    1.54 +                        in long long aCurTotalProgress,
    1.55 +                        in long long aMaxTotalProgress,
    1.56 +                        in nsIDownload aDownload);
    1.57 +
    1.58 +  void onSecurityChange(in nsIWebProgress aWebProgress,
    1.59 +                        in nsIRequest aRequest,
    1.60 +                        in unsigned long aState,
    1.61 +                        in nsIDownload aDownload);
    1.62 +
    1.63 +};

mercurial