The PlacesView interface

The nsIPlacesView interface provides a view-agnostic way to access information about a Places view.

For example, the representation of selection differs between trees, menus, and other such lists. Controllers should not be concerned with these details; controller code should not be required to decode the meaning of a selection depending on what kind of view produced the selection. Rather, each view is responsible for translating its own selection format into one the controller can understand. Views do this, and other things, by implementing the nsIPlacesView interface.

Note: nsIPlacesView does not exist in IDL at the moment. It's currently implemented directly on each of the built-in Places views.

Method overview

nsINavHistoryResultNode[] getDragableSelection();
nsINavHistoryResultNode[][] getRemovableSelectionRanges();
nsINavHistoryResult getResult();
nsINavHistoryContainerResultNode getResultNode();
nsINavHistoryResultNode[] getSelectionNodes();
void selectAll();

Attributes

Attribute Type Description
hasSelection boolean Whether or not there are selected items. Read only.
insertionPoint InsertionPoint The InsertionPoint at which new items will be inserted upon drop, paste, or creation. Read only.
place string TheURI (as a string) of the root Place that the view displays. This may be modified dynamically to update the view. See Displaying Places information using views for examples.
selectedNode nsINavHistoryResultNode The selected node in the view. If there are multiple selected nodes, this is null. Read only.

Methods

getDragableSelection()

Returns an array of selected nsINavHistoryResultNode objects that can be dragged from the view.

nsINavHistoryResultNode[] getDragableSelection();
Parameters

None.

Return value

An array of nsINavHistoryResultNode objects.

getRemovableSelectionRanges()

Returns an array whose elements are themselves arrays of nsINavHistoryResultNode objects that can be removed from the view. Each inner array represents a contiguous range of nodes that can be removed.

nsINavHistoryResultNode[][] getRemovableSelectionRanges();
Parameters

None.

Return value

An array of arrays of nsINavHistoryResultNode objects.

getResult()

Returns the nsINavHistoryResult object that the view displays.

nsINavHistoryResult getResult();
Parameters

None.

Return value

The nsINavHistoryResult object that the view displays.

getResultNode()

Returns the root node, an nsINavHistoryContainerResultNode object, of the view's result.

nsINavHistoryContainerResultNode getResultNode();
Paramters

None.

Return value

The root nsINavHistoryContainerResultNode of the view's result.

getSelectionNodes()

Returns an array of all currently selected nsINavHistoryResultNode objects of the view. The nodes are not necessarily returned in the same order in which they occur in the model, or in the same container, or from the same provider.

nsINavHistoryResultNode[] getSelectionNodes();
Parameters

None.

Return value

An array of nsINavHistoryResultNode objects that are selected.

selectAll()

Selects all the nodes displayed in the view.

void selectAll();
Parameters

None.

See also

Document Tags and Contributors

Contributors to this page: adw
Last updated by: adw,