Places:Results: Difference between revisions

1,824 bytes removed ,  29 January 2009
Replacing page with 'See https://developer.mozilla.org/en/Querying_Places#Using_the_results'
No edit summary
 
(Replacing page with 'See https://developer.mozilla.org/en/Querying_Places#Using_the_results')
 
Line 1: Line 1:
== Introduction ==
See https://developer.mozilla.org/en/Querying_Places#Using_the_results
 
When the history system executes a set of queries, it produces a HistoryResult. The HistoryResult holds the results themselves, provides an implementation of nsITreeView for display in the UI and a set of helper methods for using it, provides information about the set of queries and options that generated it, and provides a means of enumerating the content of the results.  
 
== Result is a ResultNode ==
 
The nsINavHistoryResult interface inherits from nsINavHistoryResultNode, which is the root node in a tree of nodes representing the display of the results. The ResultNode provides methods for enumerating children and information about the node, such as its title, url, type, etc. ResultNode is a view-independent means of enumerating results.
 
== Result is a View ==
 
The HistoryResult implements nsITreeView and can be attached directly to a XUL <tree> widget once it has been generated. nsINavHistoryResult provides methods for converting a tree index to a nsINavHistoryResultNode, methods for expanding or collapsing folders and for adding a nsINavHistoryResultViewObserver
 
== nsINavHistoryResultViewObserver ==
 
nsITreeView is mostly concerned with providing the view with information about the model of data being displayed, but it also includes some methods that serve as controller-like notifications that things should be or are being done, such as drag and drop operations and events relating to expanding and collapsing items. These notifications are best handled in the controller, but since the HistoryResult is implemented in C++ it needs a COM way of notifying the front end. It does this by having the front end implement nsINavHistoryResultViewObserver and attach this to the result using add/removeObserver methods. This interface is analogous to nsIXULTreeBuilderObserver, and should actually merge with that interface and live with the tree code.
590

edits