Visit Mozilla.org

nsINavHistoryContainerResultNode

From MDC

This article covers features introduced in Firefox 3

The nsINavHistoryContainerResultNode interface is a foundation for the interfaces that provide a description of a query result on the Places service that describes a container (which is any kind of grouping, including bookmark folders).

Contents

nsINavHistoryContainerResultNode is defined in nsINavHistoryContainerResultNode. It is scriptable and unfrozen (hasn't changed since Mozilla 1.9).

Inherits from: nsINavHistoryResultNode

[edit] Method overview

nsINavHistoryResultNode getChild(in unsigned long aIndex);

[edit] Attributes

Attribute Type Description
containerOpen boolean Set this to true to allow descent into this container. When closed, attempting to call getChild() or childCount() results in an error. When you're done reading the container's children, set this to false.

For HOST and DAY groupings, doing this has no performance cost since the children have already been computed. For queries and bookmark folders, however, being open means they must keep themselves up-to-date by listening for updates and re-querying as needed.

hasChildren boolean Indicates whether or not the node can have children, and may be used whether the container is open or closed. When the container is closed, the result is an exact answer if the node can be populated easily (for example, for bookmark folders). If it can't be populated easily (for complex history queries, for example), the result is always true.

When the container is open, the result is always accurate.

This value is intended to be used to see if the "+" should be drawn next to a tree item, indicating that the item can be opened. Read-only.

childCount unsigned long The number of child nodes. Read-only.
childrenReadOnly boolean false if the node's list of children can be modified (by adding or removing children, or rearranging them), or true if the user interface should not allow the list of children to be altered. Read-only.

This is false for bookmark folder nodes unless the setFolderReadOnly() method has been called to specifically make the folder read-only. It's true for non-folder nodes.

If this container is a remote container, this flag may be redefined by the remote container provider.

remoteContainerType AUTF8String A string representing the remote container service API that is responsible for this container. If there is no such API, this value is an empty string. Read-only.

The container may be a RESULT_TYPE_REMOTE_CONTAINER node that has been dynamically generated by the remote container API, or a bookmark folder (RESULT_TYPE_FOLDER) for which some service (such as livemarks) has registered to provide certain operations.

[edit] Methods

[edit] getChild()

Returns the child node at the specified index.

 nsINavHistoryResultNode getChild(
   in unsigned long aIndex
 );
[edit] Parameters
aIndex
The index into the child list of the node to fetch.
[edit] Returns

The node located at the specified index.

[edit] Exceptions thrown
NS_ERROR_NOT_AVAILABLE
The containerOpen attribute is currently false, indicating that the node isn't open for access.

[edit] Remarks

There are a number of untested methods on this interface that are not documented at present, and are disabled in the idl file.

[edit] See also

nsINavHistoryResultNode, nsINavHistoryService