Implemented by
- @mozilla.org/browser/livemark-service;2
- @mozilla.org/places/sync;1
- @mozilla.org/browser/tagging-service;1
Observer for bookmark changes.
[scriptable, uuid(a3544e1e-36a8-404a-9b30-918abf8e005e)]
interface nsINavBookmarkObserver : nsISupports
Methods
Notify this observer that an item is about to be removed. Called before
the actual removal will take place.
@param aItemId
The id of the bookmark to be removed.
void
onBeforeItemRemoved(in long long aItemId)
Notify 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.
void
onBeginUpdateBatch()
Notify this observer that a batch transaction has ended.
void
onEndUpdateBatch()
Notify this observer that an item was added. Called after the actual
add took place. The items following the index will be shifted down, but
no additional notifications will be sent.
@param aItemId
The id of the bookmark that was added.
@param aFolder
The folder that the item was added to.
@param aIndex
The item's index in the folder.
void
onItemAdded(in long long aItemId, in long long aFolder, in long aIndex)
Notify this observer that an item's information has changed. This
will be called whenever any attributes like "title" are changed.
@param aItemId
The id of the item that was changed.
@param aProperty
The property which changed.
@param aIsAnnotationProperty
Is aProperty the name of an item annotation
property = "cleartime": (history was deleted, there is no last visit date):
value = empty string.
property = "title": value = new title.
property = "favicon": value = new "moz-anno" URL of favicon image
property = "uri": value = new uri spec.
property = "tags: (tags set for the bookmarked uri have changed)
value = empty string.
property = "dateAdded": value = PRTime when the item was first added
property = "lastModified": value = PRTime when the item was last modified
aIsAnnotationProperty = true: value = empty string.
void
onItemChanged(in long long aBookmarkId, in ACString aProperty, in boolean aIsAnnotationProperty, in AUTF8String aValue)
Notify this observer that an item has been moved.
@param aItemId
The id of the item that was moved.
@param aOldParent
The id of the old parent.
@param aOldIndex
The old index inside aOldParent.
@param aNewParent
The id of the new parent.
@param aNewIndex
The foindex inside aNewParent.
void
onItemMoved(in long long aItemId, in long long aOldParent, in long aOldIndex, in long long aNewParent, in long aNewIndex)
Notify this observer that an item was removed. Called after the actual
remove took place. The items following the index will be shifted up, but
no additional notifications will be sent.
@param aItemId
The id of the bookmark that was removed.
@param aFolder
The folder that the item was removed from.
@param aIndex
The bookmark's index in the folder.
void
onItemRemoved(in long long aItemId, in long long aFolder, in long aIndex)
Notify that the item was visited. 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's
actually more recent before using this new time.
@param aBookmarkId
The id of the bookmark that was visited.
@see onItemChanged property = "cleartime" for when all visit dates are
deleted for the URI.
void
onItemVisited(in long long aBookmarkId, in long long aVisitID, in PRTime time)
Compare to: