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

AttributeTypeDescription
allHaveStopped Read onlybooleanIndicates whether all the downloads are currently stopped.
progressTotalBytes Read onlynumber

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 onlynumber

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.

Note: This method is already called internally by the 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:35 次

字数:5729

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文