nsIDocShell

IID:9f0c7461-b9a4-47f6-b88c-421dce1bce66
Inherits From:nsISupports

This interface is implemented by the following components:


Constants

PRInt32 INTERNAL_LOAD_FLAGS_NONE = 0
PRInt32 INTERNAL_LOAD_FLAGS_INHERIT_OWNER = 1
PRInt32 INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER = 2
Get an enumerator over this docShell and its children.

PRInt32 ENUMERATE_FORWARDS = 0
PRInt32 ENUMERATE_BACKWARDS = 1
The type of application that created this window
PRUint32 APP_TYPE_UNKNOWN = 0
PRUint32 APP_TYPE_MAIL = 1
PRUint32 APP_TYPE_EDITOR = 2
Current busy state for DocShell
PRUint32 BUSY_FLAGS_NONE = 0
PRUint32 BUSY_FLAGS_BUSY = 1
PRUint32 BUSY_FLAGS_BEFORE_PAGE_LOAD = 2
PRUint32 BUSY_FLAGS_PAGE_LOADING = 4
Load commands for the document
PRUint32 LOAD_CMD_NORMAL = 1
PRUint32 LOAD_CMD_RELOAD = 2
PRUint32 LOAD_CMD_HISTORY = 4

Properties

PRBool allowAuth

Certain dochshells (like the message pane) should not throw up auth dialogs because it can act as a password trojan

PRBool allowImages

Attribute stating whether or not images should be loaded.

PRBool allowJavascript

Whether to allow Javascript execution

PRBool allowMetaRedirects

Attribute stating if refresh based redirects can be allowed

PRBool allowPlugins

Whether to allow plugin execution

PRBool allowSubframes

Attribute stating if it should allow subframes (framesets/iframes) or not

PRUint32 appType

readonly PRUint32 busyFlags

PRBool canvasHasFocus

nsIChromeEventHandler chromeEventHandler

This attribute allows chrome to tie in to handle DOM events that may be of interest to chrome.

readonly nsIContentViewer contentViewer

Content Viewer that is currently loaded for this DocShell. This may change as the underlying content changes.

nsIDocumentCharsetInfo documentCharsetInfo

The document charset info. This is used by a load to determine priorities for charset detection etc.

readonly nsIPresShell eldestPresShell

Presentation shell for the oldest document, if this docshell is currently transitioning between documents.

PRBool hasFocus

readonly PRBool isExecutingOnLoadHandler

nsILayoutHistoryState layoutHistoryState

readonly PRInt32 loadedTransIndex

PRUint32 loadType

PRInt32 marginHeight

PRInt32 marginWidth

readonly nsPresContext* presContext

Presentation context for the currently loaded document. This may be null.

readonly nsIPresShell presShell

Presentation shell for the currently loaded document. This may be null.

readonly PRInt32 previousTransIndex

Keeps track of the previous SHTransaction index and the current SHTransaction index at the time that the doc shell begins to load. Used for ContentViewer eviction.

readonly PRBool restoringDocument

nsISecureBrowserUI securityUI

The SecureBrowserUI object for this docshell. This is set by XUL or nsWebBrowser for their root docshell.

readonly PRBool shouldSaveLayoutState

PRBool useErrorPages

float zoom

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.


Methods

void beginRestore ( nsIContentViewer viewer , PRBool top ) void createLoadInfo ( out nsIDocShellLoadInfo loadInfo ) void finishRestore ( ) [noscript] void firePageHideNotification ( PRBool isUnload ) nsISimpleEnumerator getDocShellEnumerator ( PRInt32 itemType , PRInt32 direction ) void historyPurged ( PRInt32 numEntries ) [noscript] void internalLoad ( nsIURI URI , nsIURI referrer , nsISupports owner , PRUint32 flags , PRUnichar* windowTarget , char* typeHint , nsIInputStream postDataStream , nsIInputStream headersStream , PRUint32 loadFlags , nsISHEntry SHEntry , PRBool firstParty , out nsIDocShell docShell , out nsIRequest request ) PRBool isBeingDestroyed ( ) [noscript] void loadStream ( nsIInputStream stream , nsIURI URI , ACString contentType , ACString contentCharset , nsIDocShellLoadInfo loadInfo ) [noscript] void loadURI ( nsIURI uri , nsIDocShellLoadInfo loadInfo , PRUint32 loadFlags , PRBool firstParty ) void prepareForNewContentModel ( ) void resumeRefreshURIs ( ) void setCurrentURI ( nsIURI URI ) void suspendRefreshURIs ( ) void tabToTreeOwner ( PRBool forward , out PRBool tookFocus )

void beginRestore ( nsIContentViewer viewer , PRBool top )

Begin firing WebProgressListener notifications for restoring a page presentation. viewer is the content viewer whose document we are starting to load. If null, it defaults to the docshell's current content viewer, creating one if necessary. top should be true for the toplevel docshell that is being restored; it will be set to false when this method is called for child docshells. This method will post an event to complete the simulated load after returning to the event loop.

Arguments:
viewer
top

void createLoadInfo ( out nsIDocShellLoadInfo loadInfo )

Creates a DocShellLoadInfo object that you can manipulate and then pass to loadURI.

Arguments:
loadInfo

void finishRestore ( )

Finish firing WebProgressListener notifications and DOM events for restoring a page presentation. This should only be called via beginRestore().


void firePageHideNotification ( PRBool isUnload )

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 as well.

Arguments:
isUnload

nsISimpleEnumerator getDocShellEnumerator ( PRInt32 itemType , PRInt32 direction )

Arguments:
itemType
direction

void historyPurged ( PRInt32 numEntries )

Notification that entries have been removed from the beginning of a nsSHistory which has this as its rootDocShell.

Arguments:
numEntries: - The number of entries removed

void internalLoad ( nsIURI URI , nsIURI referrer , nsISupports owner , PRUint32 flags , PRUnichar* windowTarget , char* typeHint , nsIInputStream postDataStream , nsIInputStream headersStream , PRUint32 loadFlags , nsISHEntry SHEntry , PRBool firstParty , out nsIDocShell docShell , out nsIRequest request )

Loads the given URI. This method is identical to loadURI(...) except that its parameter list is broken out instead of being packaged inside of an nsIDocShellLoadInfo object...

Arguments:
URI: - The URI to load.
referrer: - Referring URI
owner: - Owner (security principal)
flags
windowTarget: - Window target for the load.
typeHint: - A hint as to the content-type of the resulting data. May be null or empty if no hint.
postDataStream: - Post data stream (if POSTing)
headersStream: - Stream containing "extra" request headers...
loadFlags: - Flags to modify load behaviour. Flags are defined in nsIWebNavigation.
SHEntry: - Active Session History entry (if loading from SH)
firstParty
docShell
request

PRBool isBeingDestroyed ( )


void loadStream ( nsIInputStream stream , nsIURI URI , ACString contentType , ACString contentCharset , nsIDocShellLoadInfo loadInfo )

Loads a given stream. This will give priority to loading the requested stream in the object implementing this interface. If it can't be loaded here however, the URL dispatched will go through its normal process of content loading.

Arguments:
stream: - The input stream that provides access to the data to be loaded. This must be a blocking, threadsafe stream implementation.
URI: - The URI representing the stream, or null.
contentType: - The type (MIME) of data being loaded (empty if unknown).
contentCharset: - The charset of the data being loaded (empty if unknown).
loadInfo: - This is the extended load info for this load. This most often will be null, but if you need to do additional setup for this load you can get a loadInfo object by calling createLoadInfo. Once you have this object you can set the needed properties on it and then pass it to loadStream.

void loadURI ( nsIURI uri , nsIDocShellLoadInfo loadInfo , PRUint32 loadFlags , PRBool firstParty )

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.

Arguments:
uri: - The URI to load.
loadInfo: - This is the extended load info for this load. This most often will be null, but if you need to do additional setup for this load you can get a loadInfo object by calling createLoadInfo. Once you have this object you can set the needed properties on it and then pass it to loadURI.
loadFlags: - Flags to modify load behaviour. Flags are defined in nsIWebNavigation.
firstParty

void prepareForNewContentModel ( )

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 resumeRefreshURIs ( )

Restart the XPCOM timers for each meta-refresh URI in this docshell, and this docshell's children, recursively. If the timers are already running, this has no effect.


void setCurrentURI ( nsIURI URI )

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.

Arguments:
URI

void suspendRefreshURIs ( )

Cancel the XPCOM timers for each meta-refresh URI in this docshell, and this docshell's children, recursively. The meta-refresh timers can be restarted using resumeRefreshURIs(). If the timers are already suspended, this has no effect.


void tabToTreeOwner ( PRBool forward , out PRBool tookFocus )

Arguments:
forward
tookFocus

References

This interface is the type of the following properties:

nsIBrowserBoxObject.docShell, nsIEditorBoxObject.docShell, nsIFrameLoader.docShell, nsIIFrameBoxObject.docShell, nsIMsgWindow.rootDocShell, nsISHistoryInternal.rootDocShell, nsIXULWindow.docShell

This interface is passed as an argument to the following methods:

nsIDocShell.internalLoad, nsIFormFillController.attachToBrowser, nsIFormFillController.detachFromBrowser, nsIMsgStatusFeedback.setDocShell, nsIPrintStatusFeedback.setDocShell, nsITypeAheadFind.init, nsITypeAheadFind.setDocShell

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com