docshell/base/nsIGlobalHistory2.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/docshell/base/nsIGlobalHistory2.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,59 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +/**
    1.10 + * Provides information about global history to gecko. 
    1.11 + *
    1.12 + * @note  This interface replaces and deprecates nsIGlobalHistory.
    1.13 + */
    1.14 +
    1.15 +#include "nsISupports.idl"
    1.16 +interface nsIURI;
    1.17 +
    1.18 +%{ C++
    1.19 +
    1.20 +// nsIObserver topic to fire when you add new visited URIs to the history;
    1.21 +// the nsIURI is the subject
    1.22 +#define NS_LINK_VISITED_EVENT_TOPIC "link-visited"
    1.23 +
    1.24 +%}
    1.25 +
    1.26 +[scriptable, uuid(cf777d42-1270-4b34-be7b-2931c93feda5)]
    1.27 +interface nsIGlobalHistory2 : nsISupports
    1.28 +{
    1.29 +    /**
    1.30 +     * Add a URI to global history
    1.31 +     *
    1.32 +     * @param aURI      the URI of the page
    1.33 +     * @param aRedirect whether the URI was redirected to another location;
    1.34 +     *                  this is 'true' for the original URI which is
    1.35 +     *                  redirected.
    1.36 +     * @param aToplevel whether the URI is loaded in a top-level window
    1.37 +     * @param aReferrer the URI of the referring page
    1.38 +     *
    1.39 +     * @note  Docshell will not filter out URI schemes like chrome: data:
    1.40 +     *        about: and view-source:.  Embedders should consider filtering out
    1.41 +     *        these schemes and others, e.g. mailbox: for the main URI and the
    1.42 +     *        referrer.
    1.43 +     */
    1.44 +    void addURI(in nsIURI aURI, in boolean aRedirect, in boolean aToplevel, in nsIURI aReferrer);
    1.45 +
    1.46 +    /**
    1.47 +     * Checks to see whether the given URI is in history.
    1.48 +     *
    1.49 +     * @param aURI the uri to the page
    1.50 +     * @return true if a URI has been visited
    1.51 +     */
    1.52 +    boolean isVisited(in nsIURI aURI);
    1.53 +
    1.54 +    /**
    1.55 +     * Set the page title for the given uri. URIs that are not already in
    1.56 +     * global history will not be added.
    1.57 +     *
    1.58 +     * @param aURI    the URI for which to set to the title
    1.59 +     * @param aTitle  the page title
    1.60 +     */
    1.61 +    void setPageTitle(in nsIURI aURI, in AString aTitle);
    1.62 +};

mercurial