DownloadSummary 编辑
Provides an aggregated view on the contents of a DownloadList
.
A reference to a DownloadSummary
object can be obtained using the Downloads.getSummary()
function.
Method overview
Promise bindToList(DownloadList aList); |
Promise addView(Object aView); |
Promise removeView(Object aView); |
Properties
Attribute | Type | Description |
allHaveStopped Read only | boolean | Indicates whether all the downloads are currently stopped. |
progressTotalBytes Read only | number | Indicates the total number of bytes to be transferred before completing all the downloads that are currently in progress. For downloads that do not have a known final size, the number of bytes currently transferred is reported as part of this property. This is zero if no downloads are currently in progress. |
progressCurrentBytes Read only | number | Number of bytes currently transferred as part of all the downloads that are currently in progress. This is zero if no downloads are currently in progress. |
Methods
bindToList()
This method may be called once to bind this object to a DownloadList
.
Views on the summarized data can be registered before this object is bound to an actual list. This allows the summary to be used without requiring the initialization of the DownloadList
first.
Downloads.getSummary()
function.Promise bindToList( DownloadList aList );
Parameters
aList
- Underlying
DownloadList
whose contents should be summarized.
Promise resolves to
undefined
when the view on the underlying list has been registered.
addView()
Adds a view that will be notified of changes to the summary. The newly added view will receive an initial onSummaryChanged
notification.
Promise addView( Object aView );
Parameters
aView
- The view object to add. The following methods may be defined:
onSummaryChanged
: Optional Called after any property of the summary has changed.
Promise resolves to
undefined
when the view has been registered and the onSummaryChanged
notification has been sent.
removeView()
Removes a view that was previously added using addView().
Promise removeView( Object aView );
Parameters
aView
- The view object to remove.
Promise resolves to
undefined
when the view has been removed. At this point, the removed view will not receive any more notifications.
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论