org.mozilla.jrex.event.history
Interface HistoryListener

All Known Implementing Classes:
JRexToolBarImpl

public interface HistoryListener

The JRex HistoryListener interface, This listener can be added to listen to any History related events.

Version:
1.0
Author:
C.N.Medappa
See Also:
JRexCanvas.addHistoryListener(org.mozilla.jrex.event.history.HistoryListener)

Method Summary
 void addEntry(HistoryEvent event)
          called to notify a listener when a new document is added to session history.
 boolean goBack(HistoryEvent event)
          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 For this event the HistoryEvent's getEventParam will return uri of the previous page which is to be loaded.
 boolean goForward(HistoryEvent event)
          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 For this event the HistoryEvent's getEventParam will return uri of the next page which is to be loaded.
 boolean goToIndex(HistoryEvent event)
          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 For this event the HistoryEvent's getEventParam will return IntegerEventParam instance with 'int' data containing index in history of the document to be loaded and 'uri' containing uri of the document to be loaded.
 boolean purge(HistoryEvent event)
          called to notify a listener when documents are removed from session history.
 boolean reload(HistoryEvent event)
          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 For this event the HistoryEvent's getEventParam will return IntegerEventParam instance with 'int' data containing reloadFlags and 'uri' containing uri of the current document to be reloaded.
 

Method Detail

addEntry

public void addEntry(HistoryEvent event)
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. For this event the HistoryEvent's getEventParam will return uri of the document to be added to session history

See Also:
HistoryEvent.getEventParam()

goBack

public boolean goBack(HistoryEvent event)
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 For this event the HistoryEvent's getEventParam will return uri of the previous page which is to be loaded.

Returns:
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 else back operation will be aborted. This is a mechanism for the listener to control user's operations with history.
See Also:
HistoryEvent.getEventParam()

goForward

public boolean goForward(HistoryEvent event)
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 For this event the HistoryEvent's getEventParam will return uri of the next page which is to be loaded.

Returns:
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 else forward operation will be aborted. This is a mechanism for the listener to control user's operations with history.
See Also:
HistoryEvent.getEventParam()

reload

public boolean reload(HistoryEvent event)
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 For this event the HistoryEvent's getEventParam will return IntegerEventParam instance with 'int' data containing reloadFlags and 'uri' containing uri of the current document to be reloaded.

Returns:
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 else reload operation will be aborted. This is a mechanism for the listener to control user's operations with history.
See Also:
IntegerEventParam, HistoryEvent.getEventParam()

goToIndex

public boolean goToIndex(HistoryEvent event)
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 For this event the HistoryEvent's getEventParam will return IntegerEventParam instance with 'int' data containing index in history of the document to be loaded and 'uri' containing uri of the document to be loaded.

Returns:
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 else GotoIndex operation will be aborted. This is a mechanism for the listener to control user's operations with history.
See Also:
IntegerEventParam, HistoryEvent.getEventParam()

purge

public boolean purge(HistoryEvent event)
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... For this event the HistoryEvent's getEventParam will return IntegerEventParam instance with 'int' data containing number of documents to be removed from session history.

Returns:
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 else purge operation will be aborted. This is a mechanism for the listener to control user's operations with history.
See Also:
Note:- While purging history, the older documents are removed and newly loaded documents are kept. For example if there are 5 documents in history, and purge is called with 3 entries to be removed, then document 1, 2 and 3 are removed from history and most recently loaded document 4 and 5 are kept.


Copyright © 2004 C.N.Medappa. All Rights Reserved.