DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * browser-specific interface to global history
 */

#include "nsISupports.idl"
#include "nsIGlobalHistory2.idl"

[scriptable, uuid(d176f8e8-383f-4109-812d-cce015e2d804)]
interface nsIBrowserHistory : nsIGlobalHistory2
{
    /**
     * Removes a page from global history.
     *
     * @note It is preferrable to use this one rather then RemovePages when
     *       removing less than 10 pages, since it won't start a full batch
     *       operation.
     */
    void removePage(in nsIURI aURI);

    /**
     * Removes a list of pages from global history.
     *
     * @param aURIs
     *        Array of URIs to be removed.
     * @param aLength
     *        Length of the array.
     *
     * @note the removal happens in a batch.
     */
    void removePages([array, size_is(aLength)] in nsIURI aURIs,
                     in unsigned long aLength);

    /**
     * Removes all global history information about pages for a given host.
     *
     * @param aHost
     *        Hostname to be removed.
     *        An empty host name means local files and anything else with no
     *        hostname.  You can also pass in the localized "(local files)"
     *        title given to you from a history query to remove all
     *        history information from local files.
     * @param aEntireDomain
     *        If true, will also delete pages from sub hosts (so if
     *        passed in "microsoft.com" will delete "www.microsoft.com",
     *        "msdn.microsoft.com", etc.).
     *
     * @note The removal happens in a batch.
     */
    void removePagesFromHost(in AUTF8String aHost,
                             in boolean aEntireDomain);

    /**
     * Removes all pages for a given timeframe.
     * Limits are included: aBeginTime <= timeframe <= aEndTime
     *
     * @param aBeginTime
     *        Microseconds from epoch, representing the initial time.
     * @param aEndTime
     *        Microseconds from epoch, representing the final time.
     *
     * @note The removal happens in a batch.
     */
    void removePagesByTimeframe(in PRTime aBeginTime,
                                in PRTime aEndTime);

    /**
     * Removes all visits in a given timeframe.
     * Limits are included: aBeginTime <= timeframe <= aEndTime.
     * Any pages that becomes unvisited as a result will also be deleted.
     *
     * @param aBeginTime
     *        Microseconds from epoch, representing the initial time.
     * @param aEndTime
     *        Microseconds from epoch, representing the final time.
     *
     * @note The removal happens in a batch.
     */
    void removeVisitsByTimeframe(in PRTime aBeginTime,
                                 in PRTime aEndTime);

    /**
     * Removes all existing pages from global history.
     * Visits are removed synchronously, but pages are expired asynchronously
     * off the main-thread.
     *
     * @note The removal happens in a batch. Single removals are not notified,
     *       instead an onClearHistory notification is sent to
     *       nsINavHistoryObserver implementers.
     */
    void removeAllPages();

    /**
     * Designates the url as having been explicitly typed in by the user.
     *
     * @param aURI
     *        URI of the page to be marked.
     */
    void markPageAsTyped(in nsIURI aURI);

    /**
     * Designates the url as coming from a link explicitly followed by
     * the user (for example by clicking on it).
     *
     * @param aURI
     *        URI of the page to be marked.
     */
    void markPageAsFollowedLink(in nsIURI aURI);
};