Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes
nsEditingSession Class Reference

#include <nsEditingSession.h>

Inheritance diagram for nsEditingSession:
Inheritance graph
[legend]
Collaboration diagram for nsEditingSession:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsEditingSession ()
virtual ~nsEditingSession ()
void makeWindowEditable (in nsIDOMWindow window, in string aEditorType, in boolean doAfterUriLoad)
 Make this window editable.
boolean windowIsEditable (in nsIDOMWindow window)
 Test whether a specific window has had its editable flag set; it may have an editor now, or will get one after the uri load.
nsIEditor getEditorForWindow (in nsIDOMWindow window)
 Get the editor for this window.
void setupEditorOnWindow (in nsIDOMWindow window)
 Setup editor and related support objects.
void tearDownEditorOnWindow (in nsIDOMWindow window)
 Destroy editor and related support objects.
void setEditorOnControllers (in nsIDOMWindow aWindow, in nsIEditor aEditor)
void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus)
 Notification indicating the state has changed for one of the requests associated with aWebProgress.
void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress)
 Notification that the progress has changed for one of the requests associated with aWebProgress.
void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI aLocation)
 Called when the location of the window being watched changes.
void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage)
 Notification that the status of a request has changed.
void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aState)
 Notification called for security progress.
boolean onStartURIOpen (in nsIURI aURI)
 Gives the original content listener first crack at stopping a load before it happens.
boolean doContent (in string aContentType, in boolean aIsContentPreferred, in nsIRequest aRequest, out nsIStreamListener aContentHandler)
 Notifies the content listener to hook up an nsIStreamListener capable of consuming the data stream.
boolean isPreferred (in string aContentType, out string aDesiredContentType)
 When given a uri to dispatch, if the URI is specified as 'preferred content' then the uri loader tries to find a preferred content handler for the content type.
boolean canHandleContent (in string aContentType, in boolean aIsContentPreferred, out string aDesiredContentType)
 When given a uri to dispatch, if the URI is not specified as 'preferred content' then the uri loader calls canHandleContent to see if the content listener is capable of handling the content.

Public Attributes

const long eEditorOK = 0
 Error codes when we fail to create an editor is placed in attribute editorStatus.
const long eEditorCreationInProgress = 1
const long eEditorErrorCantEditMimeType = 2
const long eEditorErrorFileNotFound = 3
const long eEditorErrorCantEditFramesets = 8
const long eEditorErrorUnknown = 9
readonly attribute unsigned long editorStatus
 Status after editor creation and document loading Value is one of the above error codes.
const unsigned long STATE_START = 0x00000001
 State Transition Flags.
const unsigned long STATE_REDIRECTING = 0x00000002
const unsigned long STATE_TRANSFERRING = 0x00000004
const unsigned long STATE_NEGOTIATING = 0x00000008
const unsigned long STATE_STOP = 0x00000010
const unsigned long STATE_IS_REQUEST = 0x00010000
 State Type Flags.
const unsigned long STATE_IS_DOCUMENT = 0x00020000
const unsigned long STATE_IS_NETWORK = 0x00040000
const unsigned long STATE_IS_WINDOW = 0x00080000
const unsigned long STATE_RESTORING = 0x01000000
 State Modifier Flags.
const unsigned long STATE_IS_INSECURE = 0x00000004
 State Security Flags.
const unsigned long STATE_IS_BROKEN = 0x00000001
const unsigned long STATE_IS_SECURE = 0x00000002
const unsigned long STATE_SECURE_HIGH = 0x00040000
 Security Strength Flags.
const unsigned long STATE_SECURE_MED = 0x00010000
const unsigned long STATE_SECURE_LOW = 0x00020000
attribute nsISupports loadCookie
 The load context associated with a particular content listener.
attribute nsIURIContentListener parentContentListener
 The parent content listener if this particular listener is part of a chain of content listeners (i.e.

Protected Member Functions

nsIDocShellGetDocShellFromWindow (nsIDOMWindow *aWindow)
nsresult GetEditorDocShellFromWindow (nsIDOMWindow *aWindow, nsIEditorDocShell **outDocShell)
nsresult SetupEditorCommandController (const char *aControllerClassName, nsIDOMWindow *aWindow, nsISupports *aContext, PRUint32 *aControllerId)
nsresult SetContextOnControllerById (nsIControllers *aControllers, nsISupports *aContext, PRUint32 aID)
nsresult PrepareForEditing (nsIDOMWindow *aWindow)
nsresult StartDocumentLoad (nsIWebProgress *aWebProgress, PRBool isToBeMadeEditable)
nsresult EndDocumentLoad (nsIWebProgress *aWebProgress, nsIChannel *aChannel, nsresult aStatus, PRBool isToBeMadeEditable)
nsresult StartPageLoad (nsIChannel *aChannel)
nsresult EndPageLoad (nsIWebProgress *aWebProgress, nsIChannel *aChannel, nsresult aStatus)
PRBool IsProgressForTargetDocument (nsIWebProgress *aWebProgress)

Static Protected Member Functions

static void TimerCallback (nsITimer *aTimer, void *aClosure)

Protected Attributes

nsCOMPtr< nsITimermLoadBlankDocTimer
PRPackedBool mDoneSetup
PRPackedBool mCanCreateEditor
PRPackedBool mScriptsEnabled
PRPackedBool mPluginsEnabled
PRPackedBool mProgressListenerRegistered
PRUint16 mImageAnimationMode
nsCOMPtr< nsISupports > mStateMaintainer
nsWeakPtr mWindowToBeEdited
nsCString mEditorType
PRUint32 mEditorFlags
PRUint32 mEditorStatus
PRUint32 mBaseCommandControllerId
PRUint32 mDocStateControllerId
PRUint32 mHTMLCommandControllerId

Detailed Description

Definition at line 76 of file nsEditingSession.h.


Constructor & Destructor Documentation

Definition at line 115 of file nsEditingSession.cpp.

{
  // Must cancel previous timer?
  if (mLoadBlankDocTimer)
    mLoadBlankDocTimer->Cancel();
}

Member Function Documentation

boolean nsIURIContentListener::canHandleContent ( in string  aContentType,
in boolean  aIsContentPreferred,
out string  aDesiredContentType 
) [inherited]

When given a uri to dispatch, if the URI is not specified as 'preferred content' then the uri loader calls canHandleContent to see if the content listener is capable of handling the content.

Parameters:
aContentTypeContent type of the data.
aIsContentPreferredIndicates whether the content should be preferred by this listener.
aDesiredContentTypeIndicates that aContentType must be converted to aDesiredContentType before processing the data. This causes a stream converted to be inserted into the nsIStreamListener chain. This argument can be nsnull if the content should be consumed directly as aContentType.
Returns:
true if the data can be consumed. false otherwise.

Note: I really envision canHandleContent as a method implemented by the docshell as the implementation is generic to all doc shells. The isPreferred decision is a decision made by a top level application content listener that sits at the top of the docshell hierarchy.

boolean nsIURIContentListener::doContent ( in string  aContentType,
in boolean  aIsContentPreferred,
in nsIRequest  aRequest,
out nsIStreamListener  aContentHandler 
) [inherited]

Notifies the content listener to hook up an nsIStreamListener capable of consuming the data stream.

Parameters:
aContentTypeContent type of the data.
aIsContentPreferredIndicates whether the content should be preferred by this listener.
aRequestRequest that is providing the data.
aContentHandlernsIStreamListener that will consume the data. This should be set to nsnull if this content listener can't handle the content type.
Returns:
true if the consumer wants to handle the load completely by itself. This causes the URI Loader do nothing else... false if the URI Loader should continue handling the load and call the returned streamlistener's methods.
nsresult nsEditingSession::EndDocumentLoad ( nsIWebProgress aWebProgress,
nsIChannel aChannel,
nsresult  aStatus,
PRBool  isToBeMadeEditable 
) [protected]

Definition at line 1058 of file nsEditingSession.cpp.

{
  NS_ENSURE_ARG_POINTER(aWebProgress);
  
#ifdef NOISY_DOC_LOADING
  printf("======= EndDocumentLoad ========\n");
  printf("with status %d, ", aStatus);
  nsCOMPtr<nsIURI> uri;
  nsXPIDLCString spec;
  if (NS_SUCCEEDED(aChannel->GetURI(getter_AddRefs(uri)))) {
    uri->GetSpec(spec);
    printf(" uri %s\n", spec.get());
  }
#endif

  // We want to call the base class EndDocumentLoad,
  // but avoid some of the stuff
  // that nsWebShell does (need to refactor).
  
  // OK, time to make an editor on this document
  nsCOMPtr<nsIDOMWindow> domWindow;
  aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
  
  // Set the error state -- we will create an editor 
  // anyway and load empty doc later
  if (aIsToBeMadeEditable) {
    if (aStatus == NS_ERROR_FILE_NOT_FOUND)
      mEditorStatus = eEditorErrorFileNotFound;
  }

  nsIDocShell *docShell = GetDocShellFromWindow(domWindow);
  if (!docShell) return NS_ERROR_FAILURE;       // better error handling?

  // cancel refresh from meta tags
  // we need to make sure that all pages in editor (whether editable or not)
  // can't refresh contents being edited
  nsCOMPtr<nsIRefreshURI> refreshURI = do_QueryInterface(docShell);
  if (refreshURI)
    refreshURI->CancelRefreshURITimers();

  nsCOMPtr<nsIEditorDocShell> editorDocShell = do_QueryInterface(docShell);

  nsresult rv = NS_OK;

  // did someone set the flag to make this shell editable?
  if (aIsToBeMadeEditable && mCanCreateEditor && editorDocShell)
  {
    PRBool  makeEditable;
    editorDocShell->GetEditable(&makeEditable);
  
    if (makeEditable)
    {
      mCanCreateEditor = PR_FALSE;
      rv = SetupEditorOnWindow(domWindow);
      if (NS_FAILED(rv))
      {
        // If we had an error, setup timer to load a blank page later
        if (mLoadBlankDocTimer)
        {
          // Must cancel previous timer?
          mLoadBlankDocTimer->Cancel();
          mLoadBlankDocTimer = NULL;
        }
  
        mLoadBlankDocTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
        if (NS_FAILED(rv)) return rv;

        mEditorStatus = eEditorCreationInProgress;
        mLoadBlankDocTimer->InitWithFuncCallback(
                                        nsEditingSession::TimerCallback,
                                        (void*)docShell,
                                        10, nsITimer::TYPE_ONE_SHOT);
      }
    }
  }
  return rv;
}

Here is the call graph for this function:

nsresult nsEditingSession::EndPageLoad ( nsIWebProgress aWebProgress,
nsIChannel aChannel,
nsresult  aStatus 
) [protected]

Definition at line 1174 of file nsEditingSession.cpp.

{
#ifdef NOISY_DOC_LOADING
  printf("======= EndPageLoad ========\n");
  printf("  with status %d, ", aStatus);
  nsCOMPtr<nsIURI> uri;
  nsXPIDLCString spec;
  if (NS_SUCCEEDED(aChannel->GetURI(getter_AddRefs(uri)))) {
    uri->GetSpec(spec);
    printf("uri %s\n", spec.get());
  }
 
  nsCAutoString contentType;
  aChannel->GetContentType(contentType);
  if (!contentType.IsEmpty())
    printf("   flags = %d, status = %d, MIMETYPE = %s\n", 
               mEditorFlags, mEditorStatus, contentType.get());
#endif

  // Set the error state -- we will create an editor anyway 
  // and load empty doc later
  if (aStatus == NS_ERROR_FILE_NOT_FOUND)
    mEditorStatus = eEditorErrorFileNotFound;

  nsCOMPtr<nsIDOMWindow> domWindow;
  aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));

  nsIDocShell *docShell = GetDocShellFromWindow(domWindow);
  if (!docShell) return NS_ERROR_FAILURE;

  // cancel refresh from meta tags
  // we need to make sure that all pages in editor (whether editable or not)
  // can't refresh contents being edited
  nsCOMPtr<nsIRefreshURI> refreshURI = do_QueryInterface(docShell);
  if (refreshURI)
    refreshURI->CancelRefreshURITimers();

#if 0
  // Shouldn't we do this when we want to edit sub-frames?
  return MakeWindowEditable(domWindow, "html", PR_FALSE);
#else
  return NS_OK;
#endif
}

Here is the call graph for this function:

Definition at line 1232 of file nsEditingSession.cpp.

{
  nsCOMPtr<nsIScriptGlobalObject> scriptGO = do_QueryInterface(aWindow);
  if (!scriptGO)
    return nsnull;

  return scriptGO->GetDocShell();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1249 of file nsEditingSession.cpp.

{
  nsIDocShell *docShell = GetDocShellFromWindow(aWindow);
  if (!docShell) return NS_ERROR_FAILURE;
  
  return docShell->QueryInterface(NS_GET_IID(nsIEditorDocShell), 
                                  (void **)outDocShell);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Get the editor for this window.

May return null

boolean nsIURIContentListener::isPreferred ( in string  aContentType,
out string  aDesiredContentType 
) [inherited]

When given a uri to dispatch, if the URI is specified as 'preferred content' then the uri loader tries to find a preferred content handler for the content type.

The thought is that many content listeners may be able to handle the same content type if they have to. i.e. the mail content window can handle text/html just like a browser window content listener. However, if the user clicks on a link with text/html content, then the browser window should handle that content and not the mail window where the user may have clicked the link. This is the difference between isPreferred and canHandleContent.

Parameters:
aContentTypeContent type of the data.
aDesiredContentTypeIndicates that aContentType must be converted to aDesiredContentType before processing the data. This causes a stream converted to be inserted into the nsIStreamListener chain. This argument can be nsnull if the content should be consumed directly as aContentType.
Returns:
true if this is a preferred content handler for aContentType; false otherwise.

Definition at line 993 of file nsEditingSession.cpp.

{
  nsCOMPtr<nsIDOMWindow> domWindow;
  if (aWebProgress)
    aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
  nsCOMPtr<nsIDOMWindow> editedDOMWindow = do_QueryReferent(mWindowToBeEdited);

  return (domWindow && (domWindow == editedDOMWindow));
}

Here is the call graph for this function:

void nsIEditingSession::makeWindowEditable ( in nsIDOMWindow  window,
in string  aEditorType,
in boolean  doAfterUriLoad 
) [inherited]

Make this window editable.

Parameters:
aWindownsIDOMWindow, the window the embedder needs to make editable
aEditorTypestring, "html" "htmlsimple" "text" "textsimple"
void nsIWebProgressListener::onLocationChange ( in nsIWebProgress  aWebProgress,
in nsIRequest  aRequest,
in nsIURI  aLocation 
) [inherited]

Called when the location of the window being watched changes.

This is not when a load is requested, but rather once it is verified that the load is going to occur in the given window. For instance, a load that starts in a window might send progress and status messages for the new site, but it will not send the onLocationChange until we are sure that we are loading this new page here.

Parameters:
aWebProgressThe nsIWebProgress instance that fired the notification.
aRequestThe associated nsIRequest. This may be null in some cases.
aLocationThe URI of the location that is being loaded.
void nsIWebProgressListener::onProgressChange ( in nsIWebProgress  aWebProgress,
in nsIRequest  aRequest,
in long  aCurSelfProgress,
in long  aMaxSelfProgress,
in long  aCurTotalProgress,
in long  aMaxTotalProgress 
) [inherited]

Notification that the progress has changed for one of the requests associated with aWebProgress.

Progress totals are reset to zero when all requests in aWebProgress complete (corresponding to onStateChange being called with aStateFlags including the STATE_STOP and STATE_IS_WINDOW flags).

Parameters:
aWebProgressThe nsIWebProgress instance that fired the notification.
aRequestThe nsIRequest that has new progress.
aCurSelfProgressThe current progress for aRequest.
aMaxSelfProgressThe maximum progress for aRequest.
aCurTotalProgressThe current progress for all requests associated with aWebProgress.
aMaxTotalProgressThe total progress for all requests associated with aWebProgress.

NOTE: If any progress value is unknown, or if its value would exceed the maximum value of type long, then its value is replaced with -1.

NOTE: If the object also implements nsIWebProgressListener2 and the caller knows about that interface, this function will not be called. Instead, nsIWebProgressListener2::onProgressChange64 will be called.

void nsIWebProgressListener::onSecurityChange ( in nsIWebProgress  aWebProgress,
in nsIRequest  aRequest,
in unsigned long  aState 
) [inherited]

Notification called for security progress.

This method will be called on security transitions (eg HTTP -> HTTPS, HTTPS -> HTTP, FOO -> HTTPS) and after document load completion. It might also be called if an error occurs during network loading.

Parameters:
aWebProgressThe nsIWebProgress instance that fired the notification.
aRequestThe nsIRequest that has new security state.
aStateA value composed of the Security State Flags and the Security Strength Flags listed above. Any undefined bits are reserved for future use.

NOTE: These notifications will only occur if a security package is installed.

Gives the original content listener first crack at stopping a load before it happens.

Parameters:
aURIURI that is being opened.
Returns:
false if the load can continue; true if the open should be aborted.
void nsIWebProgressListener::onStateChange ( in nsIWebProgress  aWebProgress,
in nsIRequest  aRequest,
in unsigned long  aStateFlags,
in nsresult  aStatus 
) [inherited]

Notification indicating the state has changed for one of the requests associated with aWebProgress.

Parameters:
aWebProgressThe nsIWebProgress instance that fired the notification
aRequestThe nsIRequest that has changed state.
aStateFlagsFlags indicating the new state. This value is a combination of one of the State Transition Flags and one or more of the State Type Flags defined above. Any undefined bits are reserved for future use.
aStatusError status code associated with the state change. This parameter should be ignored unless aStateFlags includes the STATE_STOP bit. The status code indicates success or failure of the request associated with the state change. NOTE: aStatus may be a success code even for server generated errors, such as the HTTP 404 error. In such cases, the request itself should be queried for extended error information (e.g., for HTTP requests see nsIHttpChannel).
void nsIWebProgressListener::onStatusChange ( in nsIWebProgress  aWebProgress,
in nsIRequest  aRequest,
in nsresult  aStatus,
in wstring  aMessage 
) [inherited]

Notification that the status of a request has changed.

The status message is intended to be displayed to the user (e.g., in the status bar of the browser).

Parameters:
aWebProgressThe nsIWebProgress instance that fired the notification.
aRequestThe nsIRequest that has new status.
aStatusThis value is not an error code. Instead, it is a numeric value that indicates the current status of the request. This interface does not define the set of possible status codes. NOTE: Some status values are defined by nsITransport and nsISocketTransport.
aMessageLocalized text corresponding to aStatus.

Definition at line 1266 of file nsEditingSession.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsEditingSession::SetContextOnControllerById ( nsIControllers aControllers,
nsISupports *  aContext,
PRUint32  aID 
) [protected]

Definition at line 1386 of file nsEditingSession.cpp.

{
  NS_ENSURE_ARG_POINTER(aControllers);

  // aContext can be null (when destroying editor)
  nsCOMPtr<nsIController> controller;    
  aControllers->GetControllerById(aID, getter_AddRefs(controller));
  
  // ok with nil controller
  nsCOMPtr<nsIControllerContext> editorController =
                                       do_QueryInterface(controller);
  if (!editorController) return NS_ERROR_FAILURE;

  return editorController->SetCommandContext(aContext);
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsEditingSession::SetupEditorCommandController ( const char *  aControllerClassName,
nsIDOMWindow aWindow,
nsISupports *  aContext,
PRUint32 aControllerId 
) [protected]

Definition at line 1298 of file nsEditingSession.cpp.

{
  NS_ENSURE_ARG_POINTER(aControllerClassName);
  NS_ENSURE_ARG_POINTER(aWindow);
  NS_ENSURE_ARG_POINTER(aContext);
  NS_ENSURE_ARG_POINTER(aControllerId);

  nsresult rv;
  nsCOMPtr<nsIDOMWindowInternal> domWindowInt =
                                    do_QueryInterface(aWindow, &rv);
  if (NS_FAILED(rv)) return rv;
  
  nsCOMPtr<nsIControllers> controllers;      
  rv = domWindowInt->GetControllers(getter_AddRefs(controllers));
  if (NS_FAILED(rv)) return rv;

  // We only have to create each singleton controller once
  // We know this has happened once we have a controllerId value
  if (!*aControllerId)
  {
    nsresult rv;
    nsCOMPtr<nsIController> controller;
    controller = do_CreateInstance(aControllerClassName, &rv);
    if (NS_FAILED(rv)) return rv;  

    // We must insert at head of the list to be sure our
    //   controller is found before other implementations
    //   (e.g., not-implemented versions by browser)
    rv = controllers->InsertControllerAt(0, controller);
    if (NS_FAILED(rv)) return rv;  

    // Remember the ID for the controller
    rv = controllers->GetControllerId(controller, aControllerId);
    if (NS_FAILED(rv)) return rv;  
  }  

  // Set the context
  return SetContextOnControllerById(controllers, aContext, *aControllerId);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Setup editor and related support objects.

nsresult nsEditingSession::StartDocumentLoad ( nsIWebProgress aWebProgress,
PRBool  isToBeMadeEditable 
) [protected]

Definition at line 1027 of file nsEditingSession.cpp.

{
#ifdef NOISY_DOC_LOADING
  printf("======= StartDocumentLoad ========\n");
#endif

  NS_ENSURE_ARG_POINTER(aWebProgress);
  
  // If we have an editor here, then we got a reload after making the editor.
  // We need to blow it away and make a new one at the end of the load.
  nsCOMPtr<nsIDOMWindow> domWindow;
  aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
  if (domWindow)
  {
    TearDownEditorOnWindow(domWindow);
  }
    
  if (aIsToBeMadeEditable)
    mEditorStatus = eEditorCreationInProgress;

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 1159 of file nsEditingSession.cpp.

{
#ifdef NOISY_DOC_LOADING
  printf("======= StartPageLoad ========\n");
#endif
  return NS_OK;
}

Destroy editor and related support objects.

void nsEditingSession::TimerCallback ( nsITimer aTimer,
void aClosure 
) [static, protected]

Definition at line 1140 of file nsEditingSession.cpp.

{
  nsCOMPtr<nsIDocShell> docShell = (nsIDocShell*)aClosure;
  if (docShell)
  {
    nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(docShell));
    if (webNav)
      webNav->LoadURI(NS_LITERAL_STRING("about:blank").get(),
                      0, nsnull, nsnull, nsnull);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Test whether a specific window has had its editable flag set; it may have an editor now, or will get one after the uri load.

Use this, passing the content root window, to test if we've set up editing for this content.


Member Data Documentation

readonly attribute unsigned long nsIEditingSession::editorStatus [inherited]

Status after editor creation and document loading Value is one of the above error codes.

Definition at line 66 of file nsIEditingSession.idl.

Definition at line 56 of file nsIEditingSession.idl.

Definition at line 59 of file nsIEditingSession.idl.

Definition at line 57 of file nsIEditingSession.idl.

Definition at line 58 of file nsIEditingSession.idl.

Definition at line 60 of file nsIEditingSession.idl.

Error codes when we fail to create an editor is placed in attribute editorStatus.

Definition at line 55 of file nsIEditingSession.idl.

The load context associated with a particular content listener.

The URI Loader stores and accesses this value as needed.

Definition at line 151 of file nsIURIContentListener.idl.

Definition at line 163 of file nsEditingSession.h.

Definition at line 138 of file nsEditingSession.h.

Definition at line 164 of file nsEditingSession.h.

Definition at line 132 of file nsEditingSession.h.

Definition at line 161 of file nsEditingSession.h.

Definition at line 162 of file nsEditingSession.h.

Definition at line 160 of file nsEditingSession.h.

Definition at line 165 of file nsEditingSession.h.

Definition at line 151 of file nsEditingSession.h.

Definition at line 116 of file nsEditingSession.h.

Definition at line 146 of file nsEditingSession.h.

Definition at line 148 of file nsEditingSession.h.

Definition at line 142 of file nsEditingSession.h.

nsCOMPtr<nsISupports> nsEditingSession::mStateMaintainer [protected]

Definition at line 155 of file nsEditingSession.h.

Definition at line 157 of file nsEditingSession.h.

The parent content listener if this particular listener is part of a chain of content listeners (i.e.

a docshell!)

Note:
If this attribute is set to an object that implements nsISupportsWeakReference, the implementation should get the nsIWeakReference and hold that. Otherwise, the implementation should not refcount this interface; it should assume that a non null value is always valid. In that case, the caller is responsible for explicitly setting this value back to null if the parent content listener is destroyed.

Definition at line 165 of file nsIURIContentListener.idl.

const unsigned long nsIWebProgressListener::STATE_IS_BROKEN = 0x00000001 [inherited]

Definition at line 205 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_IS_DOCUMENT = 0x00020000 [inherited]

Definition at line 163 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_IS_INSECURE = 0x00000004 [inherited]

State Security Flags.

These flags describe the security state reported by a call to the onSecurityChange method. These flags are mutually exclusive.

STATE_IS_INSECURE This flag indicates that the data corresponding to the request was received over an insecure channel.

STATE_IS_BROKEN This flag indicates an unknown security state. This may mean that the request is being loaded as part of a page in which some content was received over an insecure channel.

STATE_IS_SECURE This flag indicates that the data corresponding to the request was received over a secure channel. The degree of security is expressed by STATE_SECURE_HIGH, STATE_SECURE_MED, or STATE_SECURE_LOW.

Definition at line 204 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_IS_NETWORK = 0x00040000 [inherited]

Definition at line 164 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_IS_REQUEST = 0x00010000 [inherited]

State Type Flags.

These flags further describe the entity for which the state transition is occuring. These flags are NOT mutually exclusive (i.e., an onStateChange event may indicate some combination of these flags).

STATE_IS_REQUEST This flag indicates that the state transition is for a request, which includes but is not limited to document requests. (See below for a description of document requests.) Other types of requests, such as requests for inline content (e.g., images and stylesheets) are considered normal requests.

STATE_IS_DOCUMENT This flag indicates that the state transition is for a document request. This flag is set in addition to STATE_IS_REQUEST. A document request supports the nsIChannel interface and its loadFlags attribute includes the nsIChannel::LOAD_DOCUMENT_URI flag.

A document request does not complete until all requests associated with the loading of its corresponding document have completed. This includes other document requests (e.g., corresponding to HTML <iframe> elements). The document corresponding to a document request is available via the DOMWindow attribute of onStateChange's aWebProgress parameter.

STATE_IS_NETWORK This flag indicates that the state transition corresponds to the start or stop of activity in the indicated nsIWebProgress instance. This flag is accompanied by either STATE_START or STATE_STOP, and it may be combined with other State Type Flags.

Unlike STATE_IS_WINDOW, this flag is only set when activity within the nsIWebProgress instance being observed starts or stops. If activity only occurs in a child nsIWebProgress instance, then this flag will be set to indicate the start and stop of that activity.

For example, in the case of navigation within a single frame of a HTML frameset, a nsIWebProgressListener instance attached to the nsIWebProgress of the frameset window will receive onStateChange calls with the STATE_IS_NETWORK flag set to indicate the start and stop of said navigation. In other words, an observer of an outer window can determine when activity, that may be constrained to a child window or set of child windows, starts and stops.

STATE_IS_WINDOW This flag indicates that the state transition corresponds to the start or stop of activity in the indicated nsIWebProgress instance. This flag is accompanied by either STATE_START or STATE_STOP, and it may be combined with other State Type Flags.

This flag is similar to STATE_IS_DOCUMENT. However, when a document request completes, two onStateChange calls with STATE_STOP are generated. The document request is passed as aRequest to both calls. The first has STATE_IS_REQUEST and STATE_IS_DOCUMENT set, and the second has the STATE_IS_WINDOW flag set (and possibly the STATE_IS_NETWORK flag set as well -- see above for a description of when the STATE_IS_NETWORK flag may be set). This second STATE_STOP event may be useful as a way to partition the work that occurs when a document request completes.

Definition at line 162 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_IS_SECURE = 0x00000002 [inherited]

Definition at line 206 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_IS_WINDOW = 0x00080000 [inherited]

Definition at line 165 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_NEGOTIATING = 0x00000008 [inherited]

Definition at line 98 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_REDIRECTING = 0x00000002 [inherited]

Definition at line 96 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_RESTORING = 0x01000000 [inherited]

State Modifier Flags.

These flags further describe the transition which is occuring. These flags are NOT mutually exclusive (i.e., an onStateChange event may indicate some combination of these flags).

STATE_RESTORING This flag indicates that the state transition corresponds to the start or stop of activity for restoring a previously-rendered presentation. As such, there is no actual network activity associated with this request, and any modifications made to the document or presentation when it was originally loaded will still be present.

Definition at line 182 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_SECURE_HIGH = 0x00040000 [inherited]

Security Strength Flags.

These flags describe the security strength and accompany STATE_IS_SECURE in a call to the onSecurityChange method. These flags are mutually exclusive.

These flags are not meant to provide a precise description of data transfer security. These are instead intended as a rough indicator that may be used to, for example, color code a security indicator or otherwise provide basic data transfer security feedback to the user.

STATE_SECURE_HIGH This flag indicates a high degree of security.

STATE_SECURE_MED This flag indicates a medium degree of security.

STATE_SECURE_LOW This flag indicates a low degree of security.

Definition at line 229 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_SECURE_LOW = 0x00020000 [inherited]

Definition at line 231 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_SECURE_MED = 0x00010000 [inherited]

Definition at line 230 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_START = 0x00000001 [inherited]

State Transition Flags.

These flags indicate the various states that requests may transition through as they are being loaded. These flags are mutually exclusive.

For any given request, onStateChange is called once with the STATE_START flag, zero or more times with the STATE_TRANSFERRING flag or once with the STATE_REDIRECTING flag, and then finally once with the STATE_STOP flag. NOTE: For document requests, a second STATE_STOP is generated (see the description of STATE_IS_WINDOW for more details).

STATE_START This flag indicates the start of a request. This flag is set when a request is initiated. The request is complete when onStateChange is called for the same request with the STATE_STOP flag set.

STATE_REDIRECTING This flag indicates that a request is being redirected. The request passed to onStateChange is the request that is being redirected. When a redirect occurs, a new request is generated automatically to process the new request. Expect a corresponding STATE_START event for the new request, and a STATE_STOP for the redirected request.

STATE_TRANSFERRING This flag indicates that data for a request is being transferred to an end consumer. This flag indicates that the request has been targeted, and that the user may start seeing content corresponding to the request.

STATE_NEGOTIATING This flag is not used.

STATE_STOP This flag indicates the completion of a request. The aStatus parameter to onStateChange indicates the final status of the request.

Definition at line 95 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_STOP = 0x00000010 [inherited]

Definition at line 99 of file nsIWebProgressListener.idl.

const unsigned long nsIWebProgressListener::STATE_TRANSFERRING = 0x00000004 [inherited]

Definition at line 97 of file nsIWebProgressListener.idl.


The documentation for this class was generated from the following files: