nsINavHistoryResultViewObserver 编辑

toolkit/components/places/public/nsINavHistoryService.idlScriptable 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

ConstantValueDescription
DROP_BEFORE-1The drag operation wishes to insert the dragged item before the indicated row.
DROP_ON0The drag operation wishes to drop the dragged item onto the indicated row.
DROP_AFTER1The 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:116 次

字数:8966

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文