nsINavHistoryResultObserver 编辑
toolkit/components/places/nsINavHistoryService.idl
Scriptable Lets clients observe changes to a result as the result updates itself according to bookmark and history system events. 1.0 66 Introduced Gecko 2.0 Inherits from: nsISupports
Last changed in Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8) Note: In Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1), this interface replaced the older nsINavHistoryResultViewer
interface, which only allowed one client at a time.Method overview
void batching(in boolean aToggleMode); |
void containerClosed(in nsINavHistoryContainerResultNode aContainerNode); Deprecated since Gecko 2.0 Obsolete since Gecko 11.0 |
void containerOpened(in nsINavHistoryContainerResultNode aContainerNode); Deprecated since Gecko 2.0 Obsolete since Gecko 11.0 |
void containerStateChanged(in nsINavHistoryContainerResultNode aContainerNode, in unsigned long aOldState, in unsigned long aNewState); |
void invalidateContainer(in nsINavHistoryContainerResultNode aContainerNode); |
void nodeAnnotationChanged(in nsINavHistoryResultNode aNode, in AUTF8String aAnnoName); |
void nodeDateAddedChanged(in nsINavHistoryResultNode aNode, in PRTime aNewValue); |
void nodeHistoryDetailsChanged(in nsINavHistoryResultNode aNode, in PRTime aNewVisitDate, in unsigned long aNewAccessCount); |
void nodeIconChanged(in nsINavHistoryResultNode aNode); |
void nodeInserted(in nsINavHistoryContainerResultNode aParent, in nsINavHistoryResultNode aNode, in unsigned long aNewIndex); |
void nodeKeywordChanged(in nsINavHistoryResultNode aNode, in AUTF8String aNewKeyword); |
void nodeLastModifiedChanged(in nsINavHistoryResultNode aNode, in PRTime aNewValue); |
void nodeMoved(in nsINavHistoryResultNode aNode, in nsINavHistoryContainerResultNode aOldParent, in unsigned long aOldIndex, in nsINavHistoryContainerResultNode aNewParent, in unsigned long aNewIndex); |
void nodeRemoved(in nsINavHistoryContainerResultNode aParent, in nsINavHistoryResultNode aItem, in unsigned long aOldIndex); |
void nodeReplaced(in nsINavHistoryContainerResultNode aParentNode, in nsINavHistoryResultNode aOldNode, in nsINavHistoryResultNode aNewNode, in unsigned long aIndex); |
void nodeTagsChanged(in nsINavHistoryResultNode aNode); |
void nodeTitleChanged(in nsINavHistoryResultNode aNode, in AUTF8String aNewTitle); |
void nodeURIChanged(in nsINavHistoryResultNode aNode, in AUTF8String aNewURI); |
void sortingChanged(in unsigned short sortingMode); |
Attributes
Attribute | Type | Description |
result | nsINavHistoryResult | The nsINavHistoryResult this observer monitors. Although this attribute is read-write, you should not alter it directly; instead, call nsINavHistoryResult.addObserver() to add an observer to a result. |
Methods
batching()
Lets the observer know when a batch operation in Places is about to start or end. The observer can then pause updates or events until the batch is completed, so that it won't handle the large number of updates that are about to be notified. This is especially useful when updating user interfaces, to avoid flicker or continuous selection changes, which may result in performance degradation (for example, if updating a view for each update).
void batching( in boolean aToggleMode );
Parameters
aToggleMode
- Specify
true
to start batch mode orfalse
to finish the batch.
containerClosed()
Obsolete since Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8)Called when a container node's state changes from opened to closed.
Note: This method was deprecated in Gecko 2.0 and removed in Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8). Implement thecontainerStateChanged()
method instead.void containerClosed( in nsINavHistoryContainerResultNode aContainerNode );
Parameters
aContainerNode
- The container node which was closed.
containerOpened()
Obsolete since Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8)Called when a container node's state changes from closed to opened.
Note: This method was deprecated in Gecko 2.0 and removed in Gecko 11.0 (Firefox 11.0 / Thunderbird 11.0 / SeaMonkey 2.8). Implement thecontainerStateChanged()
method instead.void containerOpened( in nsINavHistoryContainerResultNode aContainerNode );
Parameters
aContainerNode
- The container node which was opened.
containerStateChanged()
Called when a container node's state changes.
void containerStateChanged( in nsINavHistoryContainerResultNode aContainerNode, in unsigned long aOldState, in unsigned long aNewState );
Parameters
aContainerNode
- The container node whose state changed.
aOldState
- The prior state of the node; this will be one of the
nsINavHistoryContainerResultNode.State constants
. aNewState
- The new state of the node; this is one of the
nsINavHistoryContainerResultNode.State constants
.
invalidateContainer()
Called when something has happened that requires that the contents of a container be rebuilt.
void invalidateContainer( in nsINavHistoryContainerResultNode aContainerNode );
Parameters
aContainerNode
- The container that should be rebuilt.
nodeAnnotationChanged()
Called right after the annotation on a node has changed. This is called when the annotation is changed, set, or unset.
void nodeAnnotationChanged( in nsINavHistoryResultNode aNode, in AUTF8String aAnnoName );
Parameters
aNode
- The node whose title has changed.
aAnnoName
- The name of the annotation that changed.
nodeDateAddedChanged()
Called right after the dateAdded property property of a node has changed.
void nodeDateAddedChanged( in nsINavHistoryResultNode aNode, in PRTime aNewValue );
Parameters
aNode
- The node whose dateAdded property has changed.
aNewValue
- The new value of the dateAdded property.
nodeHistoryDetailsChanged()
Called right after a node's time property or accessCount property, or both, have changed.
void nodeHistoryDetailsChanged( in nsINavHistoryResultNode aNode, in PRTime aNewVisitDate, in unsigned long aNewAccessCount );
Parameters
aNode
- The node whose details have changed.
aNewVisitDate
- The new value for the last visit date and time for the node.
aNewAccessCount
- The new access count value for the node.
nodeIconChanged()
Called right after a node's icon property has changed.
void nodeIconChanged( in nsINavHistoryResultNode aNode );
Parameters
aNode
- The node whose icon has changed.
nodeInserted()
Called when an item is inserted into a container. The item previously at the specified index (if any) and everything below it is shifted down by one.
void nodeInserted( in nsINavHistoryContainerResultNode aParent, in nsINavHistoryResultNode aNode, in unsigned long aNewIndex );
Parameters
aParent
- The container into which to insert the item.
aNode
- The node to insert into the container; it may be either a leaf or another container.
aNewIndex
- The index at which to insert the item.
nodeKeywordChanged()
Called right after the a node's keyword property has changed.
void nodeKeywordChanged( in nsINavHistoryResultNode aNode, in AUTF8String aNewKeyword );
Parameters
aNode
- The node whose keyword property has changed.
aNewKeyword
- The new value for the node's keyword property.
nodeLastModifiedChanged()
Called right after a node's dateModified property has changed.
void nodeLastModifiedChanged( in nsINavHistoryResultNode aNode, in PRTime aNewValue );
Parameters
aNode
- The node whose last modified property has changed.
aNewValue
- The new value for the node's last modified property.
nodeMoved()
Called when a node is moved from aOldParent
at aOldIndex
to aNewParent
at aNewIndex
. The item may be a container or a leaf.
At the moment, this method is called only when an item is moved within the same container. When an item is moved between containers, a new node is created for the item, and the itemRemoved/itemAdded methods are used.
void nodeMoved( in nsINavHistoryResultNode aNode, in nsINavHistoryContainerResultNode aOldParent, in unsigned long aOldIndex, in nsINavHistoryContainerResultNode aNewParent, in unsigned long aNewIndex );
Parameters
aNode
- The moved node.
aOldParent
- The node's old parent.
aOldIndex
- The node's index in the old parent.
aNewParent
- The node's new parent.
aNewIndex
- The node's index in the new parent.
nodeRemoved()
Called when a item is removed from a container. The item may be a container or a leaf.
This method is called after the item has been removed from the parent, but before any other action is taken (including zeroing out the item's parent reference).
void nodeRemoved( in nsINavHistoryContainerResultNode aParent, in nsINavHistoryResultNode aItem, in unsigned long aOldIndex );
Parameters
aParent
- The container from which the item was removed.
aItem
- The item that was removed from the container. It may be either a container or a leaf.
aOldIndex
- The index from which the item was removed.
nodeReplaced()
Called when a node is being replaced with another node at the same location.
void nodeReplaced( in nsINavHistoryContainerResultNode aParentNode, in nsINavHistoryResultNode aOldNode, in nsINavHistoryResultNode aNewNode, in unsigned long aIndex );
Parameters
aParentNode
- The container (parent node) in which the item is being replaced.
aOldNode
- The node which is being replaced.
aNewNode
- The node replacing the
aOldNode
. aIndex
- The index at which the node is located in the container.
nodeTagsChanged()
Called right after a node's tags have changed.
void nodeTagsChanged( in nsINavHistoryResultNode aNode );
Parameters
aNode
- The node whose tags have changed.
nodeTitleChanged()
Called right after a node's title has changed.
void nodeTitleChanged( in nsINavHistoryResultNode aNode, in AUTF8String aNewTitle );
Parameters
aNode
- The node whose title has changed.
aNewTitle
- The new title of the node.
nodeURIChanged()
Called right after the URI of a node has changed.
void nodeURIChanged( in nsINavHistoryResultNode aNode, in AUTF8String aNewURI );
Parameters
aNode
- The node whose URI has changed.
aNewURI
- The node's new URI.
sortingChanged()
This is called to indicate to the UI that the sort has changed to the given mode. For trees, for example, this would update the column headers to reflect the sorting. For many other types of views, this will not be applicable.
void sortingChanged( in unsigned short sortingMode );
Parameters
sortingMode
- One of the
nsINavHistoryQueryOptions.Sorting methods
, indicating the new sorting mode.
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论