/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * 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/. */ #include "domstubs.idl" #include "nsIDocShellTreeItem.idl" #include "nsIRequest.idl" %{ C++ #include "js/TypeDecls.h" #include "mozilla/Maybe.h" #include "mozilla/NotNull.h" #include "mozilla/UniquePtr.h" #include "nsCOMPtr.h" #include "nsIURI.h" class nsPresContext; class nsIPresShell; class nsDocShellLoadState; namespace mozilla { class Encoding; class HTMLEditor; namespace dom { class BrowsingContext; class ClientSource; } // namespace dom } %} /** * The nsIDocShell interface. */ [ptr] native nsPresContext(nsPresContext); [ptr] native nsIPresShell(nsIPresShell); [ref] native MaybeURI(mozilla::Maybe>); [ref] native Encoding(const mozilla::Encoding*); native UniqueClientSource(mozilla::UniquePtr); interface nsIURI; interface nsIChannel; interface nsIContentViewer; interface nsIDocShellLoadInfo; interface nsIEditor; interface nsIEditingSession; interface nsISimpleEnumerator; interface nsIInputStream; interface nsIRequest; interface nsISHEntry; interface nsILayoutHistoryState; interface nsISecureBrowserUI; interface nsIScriptGlobalObject; interface nsIDOMStorage; interface nsIPrincipal; interface nsIWebBrowserPrint; interface nsIPrivacyTransitionObserver; interface nsIReflowObserver; interface nsIScrollObserver; interface nsITabParent; interface nsITabChild; interface nsICommandManager; interface nsICommandParams; interface nsILoadURIDelegate; native TabChildRef(already_AddRefed); native nsDocShellLoadStatePtr(nsDocShellLoadState*); webidl BrowsingContext; webidl ContentFrameMessageManager; webidl EventTarget; [scriptable, builtinclass, uuid(049234fe-da10-478b-bc5d-bc6f9a1ba63d)] interface nsIDocShell : nsIDocShellTreeItem { /** * Loads a given URI. This will give priority to loading the requested URI * in the object implementing this interface. If it can't be loaded here * however, the URL dispatcher will go through its normal process of content * loading. * * @param loadState - This is the extended load info for this load. */ [noscript]void loadURI(in nsDocShellLoadStatePtr loadState); /** * Do either a history.pushState() or history.replaceState() operation, * depending on the value of aReplace. */ [implicit_jscontext] void addState(in jsval aData, in AString aTitle, in AString aURL, in boolean aReplace); /** * Reset state to a new content model within the current document and the document * viewer. Called by the document before initiating an out of band document.write(). */ void prepareForNewContentModel(); /** * For editors and suchlike who wish to change the URI associated with the * document. Note if you want to get the current URI, use the read-only * property on nsIWebNavigation. */ void setCurrentURI(in nsIURI aURI); /** * Notify the associated content viewer and all child docshells that they are * about to be hidden. If |isUnload| is true, then the document is being * unloaded and all dynamic subframe history entries are removed as well. * * @param isUnload * True to fire the unload event in addition to the pagehide event, * and remove all dynamic subframe history entries. */ [noscript] void firePageHideNotification(in boolean isUnload); /** * Presentation context for the currently loaded document. This may be null. */ [notxpcom,nostdcall] readonly attribute nsPresContext presContext; /** * Presentation shell for the currently loaded document. This may be null. */ [notxpcom,nostdcall] readonly attribute nsIPresShell presShell; /** * Presentation shell for the oldest document, if this docshell is * currently transitioning between documents. */ [notxpcom,nostdcall] readonly attribute nsIPresShell eldestPresShell; /** * Content Viewer that is currently loaded for this DocShell. This may * change as the underlying content changes. */ readonly attribute nsIContentViewer contentViewer; /** * Get the id of the outer window that is or will be in this docshell. */ [infallible] readonly attribute unsigned long long outerWindowID; /** * This attribute allows chrome to tie in to handle DOM events that may * be of interest to chrome. */ attribute EventTarget chromeEventHandler; /** * This allows chrome to set a custom User agent on a specific docshell */ attribute AString customUserAgent; /** * Whether CSS error reporting is enabled. */ attribute boolean cssErrorReportingEnabled; /** * Whether to allow plugin execution */ attribute boolean allowPlugins; /** * Whether to allow Javascript execution */ attribute boolean allowJavascript; /** * Attribute stating if refresh based redirects can be allowed */ attribute boolean allowMetaRedirects; /** * Attribute stating if it should allow subframes (framesets/iframes) or not */ attribute boolean allowSubframes; /** * Attribute stating whether or not images should be loaded. */ attribute boolean allowImages; /** * Attribute stating whether or not media (audio/video) should be loaded. */ [infallible] attribute boolean allowMedia; /** * Attribute that determines whether DNS prefetch is allowed for this subtree * of the docshell tree. Defaults to true. Setting this will make it take * effect starting with the next document loaded in the docshell. */ attribute boolean allowDNSPrefetch; /** * Attribute that determines whether window control (move/resize) is allowed. */ attribute boolean allowWindowControl; /** * True if the docshell allows its content to be handled by a content listener * other than the docshell itself, including the external helper app service, * and false otherwise. Defaults to true. */ [infallible] attribute boolean allowContentRetargeting; /** * True if new child docshells should allow content retargeting. * Setting allowContentRetargeting also overwrites this value. */ [infallible] attribute boolean allowContentRetargetingOnChildren; /** * True if this docShell should inherit the private browsing ID from * its parent when reparented. * * NOTE: This should *not* be set false in new code, or for docShells * inserted anywhere other than as children of panels. */ [infallible] attribute boolean inheritPrivateBrowsingId; /** * Get an enumerator over this docShell and its children. * * @param aItemType - Only include docShells of this type, or if typeAll, * include all child shells. * Uses types from nsIDocShellTreeItem. * @param aDirection - Whether to enumerate forwards or backwards. */ cenum DocShellEnumeratorDirection : 8 { ENUMERATE_FORWARDS = 0, ENUMERATE_BACKWARDS = 1 }; nsISimpleEnumerator getDocShellEnumerator(in long aItemType, in nsIDocShell_DocShellEnumeratorDirection aDirection); /** * The type of application that created this window. * * DO NOT DELETE, see bug 176166. For firefox, this value will always be * UNKNOWN. However, it is used heavily in Thunderbird/comm-central and we * don't really have a great replacement at the moment, so we'll just leave it * here. */ cenum AppType : 8 { APP_TYPE_UNKNOWN = 0, APP_TYPE_MAIL = 1, APP_TYPE_EDITOR = 2 }; [infallible] attribute nsIDocShell_AppType appType; /** * certain docshells (like the message pane) * should not throw up auth dialogs * because it can act as a password trojan */ attribute boolean allowAuth; /** * Set/Get the document scale factor. When setting this attribute, a * NS_ERROR_NOT_IMPLEMENTED error may be returned by implementations * not supporting zoom. Implementations not supporting zoom should return * 1.0 all the time for the Get operation. 1.0 by the way is the default * of zoom. This means 100% of normal scaling or in other words normal size * no zoom. */ attribute float zoom; /* * The size, in CSS pixels, of the horizontal margins for the of an * HTML document in this docshell; used to implement the marginwidth attribute * on HTML /