1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is the Mozilla gecko engine.
17 * The Initial Developer of the Original Code is
19 * Portions created by the Initial Developer are Copyright (C) 2006
20 * the Initial Developer. All Rights Reserved.
23 * Brett Wilson <brettw@gmail.com>
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
39 #include
"nsISupports.idl"
40 #include
"nsIGlobalHistory2.idl"
45 // This is NOT part of the interface! It could change.
46 #define NS_GECKO_FLAG_NEEDS_VERTICAL_SCROLLBAR
(1 << 0)
51 * Provides information about global history to gecko, extending GlobalHistory2
53 [scriptable
, uuid(24306852-c60e
-49c3
-a455
-90f6747118ba
)]
54 interface nsIGlobalHistory3
: nsIGlobalHistory2
57 * Notifies the history system that the page loading via aOldChannel
58 * redirected to aNewChannel. Implementations should generally add the URI for
59 * aOldChannel to history for link coloring, but are advised not to expose it
60 * in the history user interface. This function is preferred if
61 * nsIGlobalHistory3 is available. Otherwise, nsIGlobalHistory2.addURI should
62 * be called with redirect=true.
64 * This function is preferred to nsIGlobalHistory2.addURI because it provides
65 * more information (including the redirect destination, channels involved,
66 * and redirect flags) to the history implementation.
68 * For implementors of nsIGlobalHistory3: The history implementation is
69 * responsible for sending NS_LINK_VISITED_EVENT_TOPIC to observers for
70 * redirect pages. This notification must be sent for history consumers for
71 * all non-redirect pages.
73 * @param aToplevel whether the URI is loaded in a top-level window. If
74 * false, the load is in a subframe.
76 * The other params to this function are the same as those for
77 * nsIChannelEventSink::OnChannelRedirect.
79 * Note: Implementors who wish to implement this interface but rely on
80 * nsIGlobalHistory2.addURI for redirect processing may throw
81 * NS_ERROR_NOT_IMPLEMENTED from this method. If they do so, then callers
82 * must call nsIGlobalHistory2.addURI upon getting the
83 * NS_ERROR_NOT_IMPLEMENTED result.
85 void addDocumentRedirect
(in nsIChannel aOldChannel
,
86 in nsIChannel aNewChannel
,
88 in boolean aTopLevel
);
91 * Get the Gecko flags for this URI. These flags are used by Gecko as hints
92 * to optimize page loading. Not all histories have them; this need not be
93 * supported (just return NS_ERROR_NOT_IMPLEMENTED. These flags are opaque
94 * and should not be interpreted by the history engine.
96 unsigned long getURIGeckoFlags
(in nsIURI aURI
);
99 * Set the Gecko flags for this URI. May fail if the history entry
100 * doesn't have any flags or if there is no entry for the URI.
102 void setURIGeckoFlags
(in nsIURI aURI
, in unsigned long aFlags
);