nsIDynamicContainer 编辑
toolkit/components/places/public/nsIDynamicContainer.idl
Scriptable 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论