nsISupports
Last changed in Gecko 21.0 (Firefox 21.0 / Thunderbird 21.0 / SeaMonkey 2.18)void onBeforeItemRemoved(in long long aItemId, in unsigned short aItemType, in long long aParentId, in ACString aGUID, in ACString aParentGUID); Obsolete since Gecko 21.0 |
void onBeginUpdateBatch(); |
void onEndUpdateBatch(); |
void onFolderAdded(in PRInt64 folder, in PRInt64 parent, in PRInt32 index); Obsolete since Gecko 1.9 |
void onFolderChanged(in PRInt64 folder, in ACString property); Obsolete since Gecko 1.9 |
void onFolderMoved(in PRInt64 folder, in PRInt64 oldParent, in PRInt32 oldIndex, in PRInt64 newParent, in PRInt32 newIndex); Obsolete since Gecko 1.9 |
void onFolderRemoved(in PRInt64 folder, in PRInt64 parent, in PRInt32 index); Obsolete since Gecko 1.9 |
void onItemAdded(in long long aItemId, in long long aParentId, in long aIndex, in unsigned short aItemType, in nsIURI aURI, in AUTF8String aTitle, in PRTime aDateAdded, in ACString aGUID, in ACString aParentGUID); |
void onItemChanged(in long long aItemId, in ACString aProperty, in boolean aIsAnnotationProperty, in AUTF8String aNewValue, in PRTime aLastModified, in unsigned short aItemType, in long long aParentId, in ACString aGUID, in ACString aParentGUID); |
void onItemMoved(in long long aItemId, in long long aOldParentId, in long aOldIndex, in long long aNewParentId, in long aNewIndex, in unsigned short aItemType, in ACString aGUID, in ACString aOldParentGUID, in ACString aNewParentGUID); |
void onItemRemoved(in long long aItemId, in long long aParentId, in long aIndex, in unsigned short aItemType, in nsIURI aURI, in ACString aGUID, in ACString aParentGUID); |
void onItemReplaced(in PRInt64 folder, in nsIURI item, in nsIURI newItem); Obsolete since Gecko 1.9 |
void onItemVisited(in long long aItemId, in long long aVisitId, in PRTime aTime, in unsigned long aTransitionType, in nsIURI aURI, in long long aParentId, in ACString aGUID, in ACString aParentGUID); |
void onSeparatorAdded(in PRInt64 parent, in PRInt32 index); Obsolete since Gecko 1.9 |
void onSeparatorRemoved(in PRInt64 parent, in PRInt32 index); Obsolete since Gecko 1.9 |
Note: This method was removed in Gecko 21.0 as part of Bug 826409.
This method notifies this observer that an item is about to be removed. It is called before the actual removal takes place.
void onBeforeItemRemoved( in long long aItemId, in unsigned short aItemType, in long long aParentId, in ACString aGUID, in ACString aParentGUID );
aItemId
aItemType
nsINavBookmarksService.Type constants
.aParentId
aGUID
aParentGUID
This method notifies this observer that a batch transaction has started. Other notifications will be sent during the batch change, but the observer is guaranteed that onEndUpdateBatch()
will be called at the completion of changes. During a batch the observer should do its best to reduce the work done to handle notifications, since multiple changes are going to happen in a short timeframe.
void onBeginUpdateBatch();
None.
This method notifies this observer that a batch transaction has ended.
void onEndUpdateBatch();
None.
Notify this observer that a bookmark folder has been added.
void onFolderAdded( in PRInt64 folder, in PRInt64 parent, in PRInt32 index );
folder
parent
index
Notify this observer that a bookmark folder's information has changed. This will be called whenever any attributes like "title" are changed.
void onFolderChanged( in PRInt64 folder, in ACString property );
folder
property
Notify this observer that a bookmark folder has been moved.
void onFolderMoved( in PRInt64 folder, in PRInt64 oldParent, in PRInt32 oldIndex, in PRInt64 newParent, in PRInt32 newIndex );
folder
oldParent
oldIndex
newParent
newIndex
Notify this observer that a bookmark folder has been removed.
void onFolderRemoved( in PRInt64 folder, in PRInt64 parent, in PRInt32 index );
folder
parent
index
This method notifies this observer that an item was added. It is called after the actual addition took place. When a new item is created, all the items following it in the same folder will have their index shifted down, but no additional notifications will be sent.
void onItemAdded( in long long aItemId, in long long aParentId, in long aIndex, in unsigned short aItemType, in nsIURI aURI, in AUTF8String aTitle, in PRTime aDateAdded, in ACString aGUID, in ACString aParentGUID );
aItemId
aParentId
aIndex
aItemType
nsINavBookmarksService.Type constants
.aURI
TYPE_BOOKMARK
, null
otherwise.aTitle
aDateAdded
aGUID
aParentGUID
This method notifies this observer that an item's information has changed. It is called whenever any attributes like "title" are changed.
void onItemChanged( in long long aItemId, in ACString aProperty, in boolean aIsAnnotationProperty, in AUTF8String aNewValue, in PRTime aLastModified, in unsigned short aItemType, in long long aParentId, in ACString aGUID, in ACString aParentGUID );
aItemId
aProperty
aIsAnnotationProperty
aProperty
is the name of an item annotation. If this is true
, aNewValue
is always an empty string.aNewValue
aProperty
.aLastModified
aItemType
nsINavBookmarksService.Type constants
.aParentId
aGUID
aParentGUID
This table indicates what aNewValue
should be depending on property specified by aProperty
:
Property string | Value |
"cleartime" | Empty string; this property means the history was deleted, so there's no last visit date. |
"title" | The new title for the item |
"favicon" | The "moz-anno" URL for the new favicon image. |
"uri" | The new URI for the item. |
"tags" | Empty string; this property indicates that the set of tags for the item have changed. |
"dateAdded" | The PRTime at which the item was first added to the database. |
"lastModified" | The PRTime at which the item was last modified. |
This method notifies this observer that an item has been moved.
void onItemMoved( in long long aItemId, in long long aOldParentId, in long aOldIndex, in long long aNewParentId, in long aNewIndex, in unsigned short aItemType, in ACString aGUID, in ACString aOldParentGUID, in ACString aNewParentGUID );
aItemId
aOldParentId
aOldIndex
aOldParentId
.aNewParentId
aNewIndex
aNewParentId
.aItemType
nsINavBookmarksService.Type constants
.aGUID
aOldParentGUID
aNewParentGUID
This method notifies that an item was removed. It is called after the actual remove took place. When an item is removed, all the items following it in the same folder will have their index shifted down, but no additional notifications will be sent.
void onItemRemoved( in long long aItemId, in long long aParentId, in long aIndex, in unsigned short aItemType, in nsIURI aURI, in ACString aGUID, in ACString aParentGUID );
aItemId
aParentId
aIndex
aItemType
nsINavBookmarksService.Type constants
.aURI
null
otherwise.aGUID
aParentGUID
Notify this observer that a bookmark has been replaced.
void onItemReplaced( in PRInt64 folder, in nsIURI item, in nsIURI newItem );
folder
item
newItem
This method notifies that the item was visited. Can be invoked only for TYPE_BOOKMARK
items.
Normally in bookmarks we use the last visit date, and normally the time will be a new visit that will be more recent, but this is not guaranteed. You should check to see if it is actually more recent before using this new time.
See onItemChanged()
method property = "cleartime" for when all visit dates are deleted for the URI.
void onItemVisited( in long long aItemId, in long long aVisitId, in PRTime aTime, in unsigned long aTransitionType, in nsIURI aURI, in long long aParentId, in ACString aGUID, in ACString aParentGUID );
aItemId
aVisitId
aTime
aTransitionType
nsINavBookmarksService.Transaction constants
for a list of possible values.aURI
nsIURI
for this bookmark.aParentId
aGUID
aParentGUID
Notify this observer that a separator has been added.
void onSeparatorAdded( in PRInt64 parent, in PRInt32 index );
parent
index
Notify this observer that a separator has been removed.
void onSeparatorRemoved( in PRInt64 parent, in PRInt32 index );
parent
index
If you wish to support onBeforeItemRemoved()
in applications based on Gecko 1.9.1, you must implement your observer's QueryInterface()
method to match on both nsINavBookmarkObserver
and nsINavBookmarkObserver_MOZILLA_1_9_1_ADDITIONS
, as shown below.
QueryInterface: function(iid) { if (iid.equals(Ci.nsINavBookmarkObserver) || iid.equals(Ci.nsINavBookmarkObserver_MOZILLA_1_9_1_ADDITIONS) || iid.equals(Ci.nsISupports)) { return this; } throw Cr.NS_ERROR_NO_INTERFACE; }