nsINavHistoryObserver
| IID: | 849e2184-3dee-416f-91cd-6a619ca49d1c |
| Inherits From: | nsISupports |
This interface is implemented by the following components:
Constants
| A page has had some attribute on it changed. Note that for TYPED and HIDDEN, the page may not necessarily have been added yet. | ||
| PRUint32 | ATTRIBUTE_FAVICON | = 3 |
Methods
void onBeginUpdateBatch ( )
void onClearHistory ( )
void onDeleteURI ( nsIURI URI )
void onEndUpdateBatch ( )
void onPageChanged ( nsIURI URI , PRUint32 what , AString value )
void onPageExpired ( nsIURI URI , PRTime visitTime , PRBool wholeEntry )
void onTitleChanged ( nsIURI URI , AString pageTitle )
void onVisit ( nsIURI URI , PRInt64 visitID , PRTime time , PRInt64 sessionID , PRInt64 referringID , PRUint32 transitionType )
Notifies you that a bunch of things are about to change, don't do any heavy-duty processing until onEndUpdateBatch is called.
void onDeleteURI ( nsIURI URI )
This page and all of its visits are being deleted. Note: the page may not necessarily have actually existed for this function to be called.
Delete notifications are only 99.99% accurate. Batch delete operations must be done in two steps, so first come notifications, then a bulk delete. If there is some error in the middle (for example, out of memory) then you'll get a notification and it won't get deleted. There's no easy way around this.
- Arguments:
- URI
Notifies you that we are done doing a bunch of things and you should go ahead and update UI, etc.
void onPageChanged ( nsIURI URI , PRUint32 what , AString value )
- Arguments:
- URI
- what
- value
void onPageExpired ( nsIURI URI , PRTime visitTime , PRBool wholeEntry )
Called when a history entry expires. You will recieve notifications that a specific visit has expired with the time of that visit. When the last visit for a history entry expires, the history entry itself is deleted and wholeEntry is set. (If your observer only cares about URLs and not specific visits, it needs only to listen for wholeEntry notifications).
It is possible for a history entry to be deleted that has no visits if something is out of sync or after a bookmark is deleted that has no visits (thus freeing the history entry). In these cases, visitTime will be 0.
- Arguments:
- URI
- visitTime
- wholeEntry
void onTitleChanged ( nsIURI URI , AString pageTitle )
Called whenever either the "real" title or the custom title of the page changed. BOTH TITLES ARE ALWAYS INCLUDED in this notification, even though only one will change at a time. Often, consumers will want to display the user title if it is available, and fall back to the page title (the one specified in the
Note that there is a difference between an empty title and a NULL title. An empty string means that somebody specifically set the title to be nothing. NULL means nobody set it. From C++: use IsVoid() and SetIsVoid() to see whether an empty string is "null" or not (it will always be an empty string in either case).
- Arguments:
- URI
- pageTitle
void onVisit ( nsIURI URI , PRInt64 visitID , PRTime time , PRInt64 sessionID , PRInt64 referringID , PRUint32 transitionType )
Called when a resource is visited. This is called the first time a resource (page, image, etc.) is seen as well as every subsequent time.
Normally, transition types of TRANSITION_EMBED (corresponding to images in a page, for example) are not displayed in history results (unless includeHidden is set). Many observers can ignore _EMBED notifications (which will comprise the majority of visit notifications) to save work.
- Arguments:
- URI
- visitID: ID of the visit that was just created.
- time: Time of the visit
- sessionID: The ID of one connected sequence of visits.
- referringID: The ID of the visit the user came from. 0 if empty.
- transitionType: One of nsINavHistory.TRANSITION_*
References
This interface is passed as an argument to the following methods:
nsINavHistoryService.addObserver, nsINavHistoryService.removeObserver
Reference documentation is generated from Mozilla's source.
