toolkit/components/downloads/nsIDownloadProgressListener.idl

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 /* A minimally extended progress listener used by download manager
     7  * to update its default UI.  This is implemented in nsDownloadProgressListener.js.
     8  * See nsIWebProgressListener for documentation, and use its constants.  This isn't
     9  * too pretty, but the alternative is having this extend nsIWebProgressListener and
    10  * adding an |item| attribute, which would mean a separate nsIDownloadProgressListener
    11  * for every nsIDownloadItem, which is a waste...
    12  */
    14 #include "nsISupports.idl"
    16 interface nsIWebProgress;
    17 interface nsIRequest;
    18 interface nsIURI;
    19 interface nsIDownload;
    20 interface nsIDOMDocument;
    22 [scriptable, uuid(7acb07ea-cac2-4c15-a3ad-23aaa789ed51)]
    23 interface nsIDownloadProgressListener : nsISupports {
    25  /**
    26   * document
    27   * The document of the download manager frontend.
    28   */
    30   attribute nsIDOMDocument document;
    32  /**
    33   * Dispatched whenever the state of the download changes.
    34   *
    35   * @param aState The previous download sate.
    36   * @param aDownload The download object.
    37   * @see nsIDownloadManager for download states.
    38   */
    39   void onDownloadStateChange(in short aState, in nsIDownload aDownload);
    41   void onStateChange(in nsIWebProgress aWebProgress,
    42                      in nsIRequest aRequest,
    43                      in unsigned long aStateFlags,
    44                      in nsresult aStatus,
    45                      in nsIDownload aDownload);
    47   void onProgressChange(in nsIWebProgress aWebProgress,
    48                         in nsIRequest aRequest,
    49                         in long long aCurSelfProgress,
    50                         in long long aMaxSelfProgress,
    51                         in long long aCurTotalProgress,
    52                         in long long aMaxTotalProgress,
    53                         in nsIDownload aDownload);
    55   void onSecurityChange(in nsIWebProgress aWebProgress,
    56                         in nsIRequest aRequest,
    57                         in unsigned long aState,
    58                         in nsIDownload aDownload);
    60 };

mercurial