Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

nsIDynamicContainer

This interface provides a base class for services that want to provide containers for temporary contents.
1.0
28
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

Document Tags and Contributors

 Contributors to this page: Sheppy, trevorh, Arehman4
 Last updated by: Sheppy,