michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* A minimally extended progress listener used by download manager michael@0: * to update its default UI. This is implemented in nsDownloadProgressListener.js. michael@0: * See nsIWebProgressListener for documentation, and use its constants. This isn't michael@0: * too pretty, but the alternative is having this extend nsIWebProgressListener and michael@0: * adding an |item| attribute, which would mean a separate nsIDownloadProgressListener michael@0: * for every nsIDownloadItem, which is a waste... michael@0: */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIWebProgress; michael@0: interface nsIRequest; michael@0: interface nsIURI; michael@0: interface nsIDownload; michael@0: interface nsIDOMDocument; michael@0: michael@0: [scriptable, uuid(7acb07ea-cac2-4c15-a3ad-23aaa789ed51)] michael@0: interface nsIDownloadProgressListener : nsISupports { michael@0: michael@0: /** michael@0: * document michael@0: * The document of the download manager frontend. michael@0: */ michael@0: michael@0: attribute nsIDOMDocument document; michael@0: michael@0: /** michael@0: * Dispatched whenever the state of the download changes. michael@0: * michael@0: * @param aState The previous download sate. michael@0: * @param aDownload The download object. michael@0: * @see nsIDownloadManager for download states. michael@0: */ michael@0: void onDownloadStateChange(in short aState, in nsIDownload aDownload); michael@0: michael@0: void onStateChange(in nsIWebProgress aWebProgress, michael@0: in nsIRequest aRequest, michael@0: in unsigned long aStateFlags, michael@0: in nsresult aStatus, michael@0: in nsIDownload aDownload); michael@0: michael@0: void onProgressChange(in nsIWebProgress aWebProgress, michael@0: in nsIRequest aRequest, michael@0: in long long aCurSelfProgress, michael@0: in long long aMaxSelfProgress, michael@0: in long long aCurTotalProgress, michael@0: in long long aMaxTotalProgress, michael@0: in nsIDownload aDownload); michael@0: michael@0: void onSecurityChange(in nsIWebProgress aWebProgress, michael@0: in nsIRequest aRequest, michael@0: in unsigned long aState, michael@0: in nsIDownload aDownload); michael@0: michael@0: };