nsINavHistoryResult

  • Revision slug: nsINavHistoryResult
  • Revision title: nsINavHistoryResult
  • Revision id: 79616
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment new

Revision Content

nsINavHistoryResult describes the result of a history or bookmark query.

Places results use a Model-View-Controller (MVC) design pattern. Result objects represent the model in which the data is stored. External components provide the view and controller pieces of the puzzle; they define how the data looks and how the data is interacted with. More specifically, the nsINavHistoryResultViewer interface provides the View component of the pattern, and nsINavHistoryResultViewObserver is the Controller.

The result indicates to the view when something changes by using the nsINavHistoryResultViewer interface. Viewers register themselves through the nsINavHistoryResult.registerViewer() method. The viewer then tells the actual view object what to do.

You can use nsINavHistoryResultTreeViewer as the viewer; this provides a prepackaged interaction with a nsiTreeBoxObject. If you need a different view, you'll need to create your own viewer interface.

The viewer provides notifications to the controller when view events occur; this is done using the nsINavHistoryResultViewObserver interface.


{{template.InterfaceStatus("nsINavHistoryResultTreeViewer", "toolkit/components/places/public/nsINavHistoryResult.idl", "unfrozen", "Mozilla 1.9", "yes")}}

Inherits from: {{template.Interface("nsISupports")}}

Attributes

Attribute Type Description
sortingMode unsigned short Specifies the sorting mode for the result. This value must be one of nsINavHistoryQueryOptions.SORT_BY_*. Changing this value updates the corresponding options for the result so that reusing the current options and queries will always return results based on the current view.
sortingAnnotation AUTF8String The annotation to use in SORT_BY_ANNOTATION_* sorting modes; you must set this value before setting the sortingMode attribute.
viewer nsINavHistoryResultViewer The viewer for this result. The viewer is responsible for actually updating the view object itself, as well as for handling events on the view.
root nsINavHistoryContainerResultNode The root of the results. This container gives you access to all the results in the tree.

<div class="note"|Note: Keep in mind that you need to open containers for their results to be valid.</div>

See also

{{template.Interface("nsINavHistoryResultViewer")}}, {{template.Interface("nsINavHistoryContainerResultNode")}}

Revision Source

<p>
<code>nsINavHistoryResult</code> describes the result of a history or bookmark query.
</p><p>Places results use a Model-View-Controller (MVC) design pattern.  Result objects represent the model in which the data is stored.  External components provide the view and controller pieces of the puzzle; they define how the data looks and how the data is interacted with.  More specifically, the <code><a href="en/NsINavHistoryResultViewer">nsINavHistoryResultViewer</a></code> interface provides the View component of the pattern, and <code><a href="en/NsINavHistoryResultViewObserver">nsINavHistoryResultViewObserver</a></code> is the Controller.
</p><p>The result indicates to the view when something changes by using the <code><a href="en/NsINavHistoryResultViewer">nsINavHistoryResultViewer</a></code> interface.  Viewers register themselves through the <code><a href="en/NsINavHistoryResult#registerViewer.28.29">nsINavHistoryResult.registerViewer()</a></code> method.  The viewer then tells the actual view object what to do.
</p><p>You can use <code><a href="en/NsINavHistoryResultTreeViewer">nsINavHistoryResultTreeViewer</a></code> as the viewer; this provides a prepackaged interaction with a <code>nsiTreeBoxObject</code>.  If you need a different view, you'll need to create your own viewer interface.
</p><p>The viewer provides notifications to the controller when view events occur; this is done using the <code><a href="en/NsINavHistoryResultViewObserver">nsINavHistoryResultViewObserver</a></code> interface.
</p><p><br>
{{template.InterfaceStatus("nsINavHistoryResultTreeViewer", "toolkit/components/places/public/nsINavHistoryResult.idl", "unfrozen", "Mozilla 1.9", "yes")}}
</p><p>Inherits from: {{template.Interface("nsISupports")}}
</p>
<h2 name="Attributes">Attributes</h2>
<table class="standard-table">

<tbody><tr>
<td class="header">Attribute
</td><td class="header">Type
</td><td class="header">Description
</td></tr>

<tr>
<td><code>sortingMode</code>
</td><td><code>unsigned short</code>
</td><td> Specifies the sorting mode for the result.  This value must be one of <code>nsINavHistoryQueryOptions.SORT_BY_*</code>.  Changing this value updates the corresponding options for the result so that reusing the current options and queries will always return results based on the current view.
</td></tr>
<tr>
<td><code>sortingAnnotation</code>
</td><td><code>AUTF8String</code>
</td><td> The annotation to use in <code>SORT_BY_ANNOTATION_*</code> sorting modes; you must set this value before setting the <code>sortingMode</code> attribute.
</td></tr>
<tr>
<td><code>viewer</code>
</td><td><code><a href="en/NsINavHistoryResultViewer">nsINavHistoryResultViewer</a></code>
</td><td> The viewer for this result.  The viewer is responsible for actually updating the view object itself, as well as for handling events on the view.
</td></tr>
<tr>
<td><code>root</code>
</td><td><code><a href="en/NsINavHistoryContainerResultNode">nsINavHistoryContainerResultNode</a></code>
</td><td> The root of the results.  This container gives you access to all the results in the tree.
<p>&lt;div class="note"|<b>Note:</b> Keep in mind that you need to open containers for their results to be valid.&lt;/div&gt;
</p>
</td></tr>
</tbody></table>
<h2 name="See_also">See also</h2>
<p>{{template.Interface("nsINavHistoryResultViewer")}}, {{template.Interface("nsINavHistoryContainerResultNode")}}
</p>
Revert to this revision