michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** michael@0: * Provides information about global history to gecko. michael@0: * michael@0: * @note This interface replaces and deprecates nsIGlobalHistory. michael@0: */ michael@0: michael@0: #include "nsISupports.idl" michael@0: interface nsIURI; michael@0: michael@0: %{ C++ michael@0: michael@0: // nsIObserver topic to fire when you add new visited URIs to the history; michael@0: // the nsIURI is the subject michael@0: #define NS_LINK_VISITED_EVENT_TOPIC "link-visited" michael@0: michael@0: %} michael@0: michael@0: [scriptable, uuid(cf777d42-1270-4b34-be7b-2931c93feda5)] michael@0: interface nsIGlobalHistory2 : nsISupports michael@0: { michael@0: /** michael@0: * Add a URI to global history michael@0: * michael@0: * @param aURI the URI of the page michael@0: * @param aRedirect whether the URI was redirected to another location; michael@0: * this is 'true' for the original URI which is michael@0: * redirected. michael@0: * @param aToplevel whether the URI is loaded in a top-level window michael@0: * @param aReferrer the URI of the referring page michael@0: * michael@0: * @note Docshell will not filter out URI schemes like chrome: data: michael@0: * about: and view-source:. Embedders should consider filtering out michael@0: * these schemes and others, e.g. mailbox: for the main URI and the michael@0: * referrer. michael@0: */ michael@0: void addURI(in nsIURI aURI, in boolean aRedirect, in boolean aToplevel, in nsIURI aReferrer); michael@0: michael@0: /** michael@0: * Checks to see whether the given URI is in history. michael@0: * michael@0: * @param aURI the uri to the page michael@0: * @return true if a URI has been visited michael@0: */ michael@0: boolean isVisited(in nsIURI aURI); michael@0: michael@0: /** michael@0: * Set the page title for the given uri. URIs that are not already in michael@0: * global history will not be added. michael@0: * michael@0: * @param aURI the URI for which to set to the title michael@0: * @param aTitle the page title michael@0: */ michael@0: void setPageTitle(in nsIURI aURI, in AString aTitle); michael@0: };