Here's my first shot at nsIHistoryObserver. I'm not sure where the
AddObserver() RemoveObserver() interfaces should be added. Those could
either go to nsISHistory, making these interfaces specific to Session
History observation or they can go to the general Browser object which
will encapsulate SHistory and the other 2 types of History Global and
Urlbar. I thing it can begin to live in nsISHistory for now.
Please provide me with your comments,
Radha
interface nsIHistoryObserver : nsISupports
{
// XXX Should this interface be used for global History as well?
/**
* Notify when a new page is added to History
*/
//XXX Should there be a option to cancel a addition.
void OnAddNewPage(in nsIURI aNewURI);
/**
* Notification for going back with an option to cancel the operation
*/
boolean OnBack(in nsIURI aBackURI);
/**
* Notification for going forward with an option to cancel the operation
*/
boolean OnForward(in nsIURI aForwardURI);
/**
* Notification for Reload with an option to cancel
*/
// XXX Should ther be an option to modify the reloadtype?
boolean OnReload(in unsigned long aReloadFlags);
/**
* Notify while going to an particular index with an option to cancel
*/
boolean OnGotoIndex(in long aIndex, in nsIURI aGotoURI);
/**
* Notify when History is about to be trimmed with an option to cancel
*/
// XXX Should there be an option to modify the number of enries to
be trimmed?
boolean OnHistoryPurge(in long aNumEntries);
};