nsISHistoryListener

IID:3b07f591-e8e1-11d4-9882-00c04fa02f40
Inherits From:nsISupports
Status:FROZEN

nsISHistoryListener defines the interface for an object that wishes to receive notifications about activities in History. A history listener will be notified when pages are added, removed and loaded from session history. A listener to session history can be registered using the interface nsISHistory.


Methods

PRBool OnHistoryGoBack ( nsIURI backURI ) PRBool OnHistoryGoForward ( nsIURI forwardURI ) PRBool OnHistoryGotoIndex ( PRInt32 index , nsIURI gotoURI ) void OnHistoryNewEntry ( nsIURI newURI ) PRBool OnHistoryPurge ( PRInt32 numEntries ) PRBool OnHistoryReload ( nsIURI reloadURI , PRUint32 reloadFlags )

PRBool OnHistoryGoBack ( nsIURI backURI )

Called to notify a listener when the user presses the 'back' button of the browser OR when the user attempts to go back one page in history thro' other means, from javascript or using nsIWebNavigation

Arguments:
backURI: The uri of the previous page which is to be loaded.
Returns:
aReturn A boolean flag returned by the listener to indicate if the back operation is to be aborted or continued. If the listener returns 'true', it indicates that the back operation can be continued. If the listener returns 'false', then the back operation will be aborted. This is a mechanism for the listener to control user's operations with history.

PRBool OnHistoryGoForward ( nsIURI forwardURI )

Called to notify a listener when the user presses the 'forward' button of the browser OR when the user attempts to go forward one page in history thro' other means, from javascript or using nsIWebNavigation

Arguments:
forwardURI: The uri of the next page which is to be loaded.
Returns:
aReturn A boolean flag returned by the listener to indicate if the forward operation is to be aborted or continued. If the listener returns 'true', it indicates that the forward operation can be continued. If the listener returns 'false', then the forward operation will be aborted. This is a mechanism for the listener to control user's operations with history.

PRBool OnHistoryGotoIndex ( PRInt32 index , nsIURI gotoURI )

Called to notify a listener when the user visits a page using the 'Go' menu of the browser OR when the user attempts to go to a page at a particular index through other means, like from javascript or using nsIWebNavigation

Arguments:
index: The index in history of the document to be loaded.
gotoURI: The uri of the document to be loaded.
Returns:
aReturn A boolean flag returned by the listener to indicate if the GotoIndex operation is to be aborted or continued. If the listener returns 'true', it indicates that the GotoIndex operation can be continued. If the listener returns 'false', then the GotoIndex operation will be aborted. This is a mechanism for the listener to control user's operations with history.

void OnHistoryNewEntry ( nsIURI newURI )

Called to notify a listener when a new document is added to session history. New documents are added to session history by docshell when new pages are loaded in a frame or content area.

Arguments:
newURI: The uri of the document to be added to session history
Returns:
NS_OK notification sent out successfully

PRBool OnHistoryPurge ( PRInt32 numEntries )

Called to notify a listener when documents are removed from session history. Documents can be removed from session history for various reasons. For example to control the memory usage of the browser, to prevent users from loading documents from history, to erase evidence of prior page loads etc... To purge documents from session history call nsISHistory::PurgeHistory()

Arguments:
numEntries: The number of documents to be removed from session history.
Returns:
aReturn A boolean flag returned by the listener to indicate if the purge operation is to be aborted or continued. If the listener returns 'true', it indicates that the purge operation can be continued. If the listener returns 'false', then the purge operation will be aborted. This is a mechanism for the listener to control user's operations with history.

PRBool OnHistoryReload ( nsIURI reloadURI , PRUint32 reloadFlags )

Called to notify a listener when the user presses the 'reload' button of the browser OR when the user attempts to reload the current document through other means, like from javascript or using nsIWebNavigation

Arguments:
reloadURI: The uri of the current document to be reloaded.
reloadFlags: Flags that indicate how the document is to be refreshed. For example, from cache or bypassing cache and/or Proxy server.
Returns:
aReturn A boolean flag returned by the listener to indicate if the reload operation is to be aborted or continued. If the listener returns 'true', it indicates that the reload operation can be continued. If the listener returns 'false', then the reload operation will be aborted. This is a mechanism for the listener to control user's operations with history.

References

This interface is the type of the following properties:

nsISHistoryInternal.listener

This interface is passed as an argument to the following methods:

nsISHistory.addSHistoryListener, nsISHistory.removeSHistoryListener

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com