From e490ec52fd27f3a8b07fff43377c916cdc36fa77 Mon Sep 17 00:00:00 2001 From: "benjamin%smedbergs.us" Date: Tue, 18 Jul 2006 17:46:29 +0000 Subject: [PATCH] Bug 318653 r=annie.sullivan Add functions for externally creating history/visit entries. (places is not compiled by default) Original committer: brettw%gmail.com Original revision: 1.24 Original date: 2005/12/30 23:23:28 --- .../places/public/nsINavHistoryService.idl | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/toolkit/components/places/public/nsINavHistoryService.idl b/toolkit/components/places/public/nsINavHistoryService.idl index 0682ecb56477..56f447ba2b69 100644 --- a/toolkit/components/places/public/nsINavHistoryService.idl +++ b/toolkit/components/places/public/nsINavHistoryService.idl @@ -681,6 +681,45 @@ interface nsINavHistoryService : nsISupports */ boolean canAddURI(in nsIURI aURI); + /** + * Call to set the full information for a given page. If the page does not + * exist, it will be added to the database. If it does, the existing values + * WILL BE OVERWRITTEN. This is an updated version of addPageWithDetails + * for backup/restore type operations. + * + * @param aURI Page to add/change. + * @param aTitle Title as specified by the page. + * @param aUserTitle Custom title provided by user. Set to NULL if none. + * @param aVisitCount Number of times this page has been visited. Setting this + * to 0 may make the page invisible in some views. + * @param aHidden Whether the page is hidden. If the page has only + * TRANSITION_EMBED visits, this will be true, otherwise + * false. + * @param aTyped True if this URL has ever been typed. + */ + void setPageDetails(in nsIURI aURI, in AString aTitle, in AString aUserTitle, + in PRUint32 aVisitCount, in boolean aHidden, + in boolean aTyped); + + /** + * Call to manually add a visit for a specific page. This will probably not + * be commonly used other than for backup/restore type operations. If the URI + * does not have an entry in the history database already, one will be created + * with no visits, no title, hidden, not typed. + * + * @param aURI Visited page + * @param aTime Time page was visited (microseconds) + * @param aReferrer The ID of the visit that generated this one. Use 0 + * for no referrer. This must be a valid visit already + * in the DB or 0. + * @param aTranstitionType Type of transition: one of TRANSITION_* above + * @param aSession The session ID that this page belongs to. Use 0 for + * no session. + * @returns The ID of the created visit + */ + PRInt64 addVisit(in nsIURI aURI, in PRTime aTime, in PRInt64 aReferrer, + in PRInt32 aTransitionType, in PRInt64 aSession); + /** * This returns a new query object that you can pass to executeQuer[y/ies]. * It will be initialized to all empty (so using it will give you all history).