nsINavHistoryResultViewObserver 编辑
toolkit/components/places/public/nsINavHistoryService.idl
Scriptable 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.0Method 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
.
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
, orDROP_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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论