nsINavHistoryResultViewObserver

This interface is used by clients of the history results to define domain-specific handling of specific nsITreeView methods that the history result doesn't implement.
Inherits from: nsISupports Last changed in Gecko 1.9.0

Method overview

boolean canDrop(in long index, in long orientation);
void onDrop(in long row, in long orientation);
void onToggleOpenState(in long index);
void onCycleHeader(in nsITreeColumn column);
void onCycleCell(in long row, in nsITreeColumn column);
void onSelectionChanged();
void onPerformAction(in wstring action);
void onPerformActionOnRow(in wstring action, in long row);
void onPerformActionOnCell(in wstring action, in long row, in nsITreeColumn column);

Constants

Constant Value Description
DROP_BEFORE -1 The drag operation wishes to insert the dragged item before the indicated row.
DROP_ON 0 The drag operation wishes to drop the dragged item onto the indicated row.
DROP_AFTER 1 The drag operation wishes to insert the dragged item after the indicated row.

Methods

canDrop()

Implement this method to report whether or not a drop is permitted onto the specified location.

To provide behavior similar to the folder pane in Thunderbird, where drops are only permitted on items themselves instead of on the pane as a whole, always return false when the orientation isn't DROP_ON.

Warning: Do not change the content of the observer list.
 boolean canDrop(
   in long index,
   in long orientation
 );
Parameters
index
The item over which the drag is currently located.
orientation
Whether the drag target is before, after, or on the indicated row.
Return value

Return true if the drop is permitted or false if it isn't.

onDrop()

Called when the user drops something onto the view being observed.

 void onDrop(
   in long row,
   in long orientation
 );
Parameters
row
The row at which the drop occurred.
orientation
DROP_BEFORE, DROP_ON, or DROP_AFTER, indicating whether the drop destination is before, on, or after the target row.

onToggleOpenState()

Called when an item is opened or closed.

 void onToggleOpenState(
   in long index
 );
Parameters
index
The item being toggled.

onCycleHeader()

Called when a header is clicked.

 void onCycleHeader(
   in nsITreeColumn column
 );
Parameters
column
The column whose header was clicked.

onCycleCell()

Called when a cell in a non-selectable cycling column (such as unread or flagged in Thunderbird) is clicked.

 void onCycleCell(
   in long row,
   in nsITreeColumn column
 );
Parameters
row
The row on which the clicked cell is located.
column
The column in which the clicked cell is located.

onSelectionChanged()

Called when the selection in the tree changes.

 void onSelectionChanged();
Parameters

None.

onPerformAction()

This method provides a command API that can be used to invoke commands on the selection. The tree automatically invokes this method when certain keys are pressed. For example, when the delete key is pressed, this method is called with the string "delete".

 void onPerformAction(
   in wstring action
 );
Parameters
action
A string identifying the action to be performed.

onPerformActionOnRow()

This method provides a command API that can be used to invoke commands on the specified row. The tree automatically invokes this method when certain keys are pressed. For example, when the delete key is pressed, this method is called with the string "delete".

 void onPerformActionOnRow(
   in wstring action,
   in long row
 );
Parameters
action
A string identifying the action to be performed.
row
The row on which to perform the action.

onPerformActionOnCell()

This method provides a command API that can be used to invoke commands on a specified cell. The tree automatically invokes this method when certain keys are pressed. For example, when the delete key is pressed, this method is called with the string "delete".

 void onPerformActionOnCell(
   in wstring action,
   in long row,
   in nsITreeColumn column
 );
Parameters
action
A string identifying the action to be performed.
row
The row in which the cell to perform the action upon is located.
column
The column in which the cell is located.

See also

nsINavServiceHistory, nsITreeView

Document Tags and Contributors

 Last updated by: fscholz,