nsIDynamicContainer 编辑

toolkit/components/places/public/nsIDynamicContainer.idlScriptable This interface provides a base class for services that want to provide containers for temporary contents. 1.0 66 Introduced Gecko 1.9 Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3)

The service can fill result nodes directly into the container when it is opened. It can use the property bag on every result node to store data associated with each item, such as a full path on disk. It can also create additional containers for each container, registered to its service.

Method overview

void onContainerMoved(in long long aItemId, in long long aNewParent, in long aNewIndex);
void onContainerNodeClosed(in nsINavHistoryContainerResultNode aContainer);
void onContainerNodeOpening(in nsINavHistoryContainerResultNode aContainer, in nsINavHistoryQueryOptions aOptions);
void onContainerRemoving(in long long aItemId);

Methods

onContainerMoved()

This method is called when the given container has just been moved, in case the service needs to do any bookkeeping. It is called after the container has been moved.

void onContainerMoved(
  in long long aItemId,
  in long long aNewParent,
  in long aNewIndex
);
Parameters
aItemId
The item-id of the container item.
aNewParent
The item of the new parent folder for the container.
aNewIndex
The index at which the container will be inserted, or "-1" to append to the end of the list.

onContainerNodeClosed()

This method is called when the given container has just been collapsed so that the service can do any necessary cleanup. This is not guaranteed to get called. In particular, if the query just goes away, you will not get this call. This only happens when the container itself goes from the open state to the closed state. A service with large numbers of dynamically populated items might use this to do some cleanup so those items don't hang around.

void onContainerNodeClosed(
  in nsINavHistoryContainerResultNode aContainer
);
Parameters
aContainer
The container node of the container being closed. The service need not worry about removing any created nodes, they will be automatically removed when this call completes.

onContainerNodeOpening()

This method is called when the given container node is about to be populated so that the service can populate the container if necessary.

Note: All result nodes implement a property bag if you need to store state.
void onContainerNodeOpening(
  in nsINavHistoryContainerResultNode aContainer,
  in nsINavHistoryQueryOptions aOptions
);
Parameters
aContainer
The container node for the container being opened.
aOptions
The options used to generate this query. Containers should follow these when possible, for example, whether to expand queries, etc. Implementations should use this when possible if adding query and folder nodes to the container. Do not modify this value.

onContainerRemoving()

This method is called when the given container is about to be deleted from the bookmarks table, so that the service can do any necessary cleanup. It is called before the container is deleted, so that the service can still reference it.

void onContainerRemoving(
  in long long aItemId
);
Parameters
aItemId
The item-id of the container item.

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

词条统计

浏览:85 次

字数:5893

最后编辑:7 年前

编辑次数:0 次

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