Back to index

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

#include <nsMsgPrintEngine.h>

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

List of all members.

Public Member Functions

 nsMsgPrintEngine ()
virtual ~nsMsgPrintEngine ()
NS_DECL_ISUPPORTS
NS_DECL_NSIMSGPRINTENGINE
NS_DECL_NSIWEBPROGRESSLISTENER
NS_DECL_NSIOBSERVER void 
PrintMsgWindow ()
NS_IMETHOD StartNextPrintOperation ()
void setWindow (in nsIDOMWindowInternal ptr)
void setParentWindow (in nsIDOMWindowInternal ptr)
void showWindow (in boolean aShow)
void setStatusFeedback (in nsIMsgStatusFeedback feedback)
void setPrintURICount (in PRInt32 aCount)
void addPrintURI (in wstring aURI)
void startPrintOperation (in nsIPrintSettings aPS)
void setStartupPPObserver (in nsIObserver startupPPObs)
void setMsgType (in long aMsgType)
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.
void observe (in nsISupports aSubject, in string aTopic, in wstring aData)
 Observe will be called when there is a notification for the topic |aTopic|.

Public Attributes

const short MNAB_START = 0
 Print/PrintPreview Msg Type.
const short MNAB_PRINT_MSG = 0
const short MNAB_PRINTPREVIEW_MSG = 1
const short MNAB_PRINT_AB_CARD = 2
const short MNAB_PRINTPREVIEW_AB_CARD = 3
const short MNAB_PRINT_ADDRBOOK = 4
const short MNAB_PRINTPREVIEW_ADDRBOOK = 5
const short MNAB_END = 6
attribute boolean doPrintPreview
readonly attribute
nsIWebBrowserPrint 
webBrowserPrint
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

Protected Member Functions

PRBool FirePrintEvent ()
PRBool FireStartNextEvent ()
NS_IMETHOD FireThatLoadOperationStartup (nsString *uri)
NS_IMETHOD FireThatLoadOperation (nsString *uri)
void InitializeDisplayCharset ()
void SetupObserver ()
nsresult SetStatusMessage (PRUnichar *aMsgString)
PRUnicharGetString (const PRUnichar *aStringName)
nsresult ShowProgressDialog (PRBool aIsForPrinting, PRBool &aDoNotify)

Protected Attributes

nsCOMPtr< nsIDocShellmDocShell
nsCOMPtr< nsIDOMWindowInternalmWindow
nsCOMPtr< nsIDOMWindowInternalmParentWindow
PRInt32 mURICount
nsStringArray mURIArray
PRInt32 mCurrentlyPrintingURI
nsCOMPtr< nsIContentViewermContentViewer
nsCOMPtr< nsIStringBundlemStringBundle
nsCOMPtr< nsIMsgStatusFeedbackmFeedback
nsCOMPtr< nsIWebBrowserPrintmWebBrowserPrint
nsCOMPtr< nsIPrintSettingsmPrintSettings
nsCOMPtr< nsIDOMWindowmMsgDOMWin
PRBool mIsDoingPrintPreview
nsCOMPtr< nsIObservermStartupPPObs
PRInt32 mMsgInx
nsCOMPtr
< nsIPrintingPromptService
mPrintPromptService
nsCOMPtr< nsIWebProgressListenermPrintProgressListener
nsCOMPtr< nsIPrintProgressmPrintProgress
nsCOMPtr< nsIPrintProgressParamsmPrintProgressParams
nsAutoString mLoadURI

Detailed Description

Definition at line 65 of file nsMsgPrintEngine.h.


Constructor & Destructor Documentation

Definition at line 103 of file nsMsgPrintEngine.cpp.

{
}

Member Function Documentation

void nsIMsgPrintEngine::addPrintURI ( in wstring  aURI) [inherited]

Definition at line 803 of file nsMsgPrintEngine.cpp.

Here is the call graph for this function:

Definition at line 831 of file nsMsgPrintEngine.cpp.

Here is the call graph for this function:

Definition at line 522 of file nsMsgPrintEngine.cpp.

{
  nsresult rv = NS_OK;

  char  *tString = ToNewCString(*uri);
  if (!tString)
    return NS_ERROR_OUT_OF_MEMORY;

  nsCOMPtr <nsIMsgMessageService> messageService;

  // if this is a data: url, skip it, because
  // we've already got something we can print
  // and we know it is not a message.
  //
  // if this an about:blank url, skip it, because
  // ...
  //
  // if this is an addbook: url, skip it, because
  // we know that isn't a message.
  //
  // if this is a message part (or .eml file on disk)
  // skip it, because we don't want to print the parent message
  // we want to print the part.
  // example:  imap://sspitzer@nsmail-1:143/fetch%3EUID%3E/INBOX%3E180958?part=1.1.2&type=application/x-message-display&filename=test"
  if (strncmp(tString, DATA_URL_PREFIX, DATA_URL_PREFIX_LEN) &&
      strncmp(tString, ADDBOOK_URL_PREFIX, ADDBOOK_URL_PREFIX_LEN) &&
      strcmp(tString, "about:blank") &&
      !strstr(tString, "type=application/x-message-display")) {
    rv = GetMessageServiceFromURI(tString, getter_AddRefs(messageService));
  }

  if (NS_SUCCEEDED(rv) && messageService)
  {
    rv = messageService->DisplayMessageForPrinting(tString, mDocShell, nsnull, nsnull, nsnull);
  }
  //If it's not something we know about, then just load try loading it directly.
  else
  {
    nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(mDocShell));
    if (webNav)
      rv = webNav->LoadURI(uri->get(),                        // URI string
                           nsIWebNavigation::LOAD_FLAGS_NONE, // Load flags
                           nsnull,                            // Referring URI
                           nsnull,                            // Post data
                           nsnull);                           // Extra headers
  }

  if (tString) nsCRT::free(tString);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 495 of file nsMsgPrintEngine.cpp.

{
  if (uri)
  {
    mLoadURI = *uri;
  }
  else
  {
    mLoadURI.SetLength(0);
  }

  PRBool   notify = PR_FALSE;
  nsresult rv     = NS_ERROR_FAILURE;
  // Don't show dialog if we are out of URLs
  //if ( mCurrentlyPrintingURI < mURIArray.Count() && !mIsDoingPrintPreview)
  if ( mCurrentlyPrintingURI < mURIArray.Count())
  {
    rv = ShowProgressDialog(!mIsDoingPrintPreview, notify);
  }
  if (NS_FAILED(rv) || !notify)
  {
    return FireThatLoadOperation(uri);
  }
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRUnichar * nsMsgPrintEngine::GetString ( const PRUnichar aStringName) [protected]

Definition at line 628 of file nsMsgPrintEngine.cpp.

{
       nsresult    res = NS_OK;
  PRUnichar   *ptrv = nsnull;

       if (!mStringBundle)
       {
              static const char propertyURL[] = MESSENGER_STRING_URL;

              nsCOMPtr<nsIStringBundleService> sBundleService =
                       do_GetService(NS_STRINGBUNDLE_CONTRACTID, &res);
              if (NS_SUCCEEDED(res) && (nsnull != sBundleService))
              {
                     res = sBundleService->CreateBundle(propertyURL, getter_AddRefs(mStringBundle));
              }
       }

       if (mStringBundle)
              res = mStringBundle->GetStringFromName(aStringName, &ptrv);

  if ( NS_SUCCEEDED(res) && (ptrv) )
    return ptrv;
  else
    return nsCRT::strdup(aStringName);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 574 of file nsMsgPrintEngine.cpp.

{
  // libmime always converts to UTF-8 (both HTML and XML)
  if (mDocShell)
  {
    nsCOMPtr<nsIContentViewer> cv;
    mDocShell->GetContentViewer(getter_AddRefs(cv));
    if (cv)
    {
      nsCOMPtr<nsIMarkupDocumentViewer> muDV = do_QueryInterface(cv);
      if (muDV)
      {
        muDV->SetForceCharacterSet(NS_LITERAL_CSTRING("UTF-8"));
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIObserver::observe ( in nsISupports  aSubject,
in string  aTopic,
in wstring  aData 
) [inherited]

Observe will be called when there is a notification for the topic |aTopic|.

This assumes that the object implementing this interface has been registered with an observer service such as the nsIObserverService.

If you expect multiple topics/subjects, the impl is responsible for filtering.

You should not modify, add, remove, or enumerate notifications in the implemention of observe.

Parameters:
aSubject: Notification specific interface pointer.
aTopic: The notification topic or subject.
aData: Notification specific wide string. subject event.
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.

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 656 of file nsMsgPrintEngine.cpp.

{
  const char* kMsgKeys[] = {"PrintingMessage",  "PrintPreviewMessage",
                            "PrintingCard",     "PrintPreviewCard",
                            "PrintingAddrBook", "PrintPreviewAddrBook"};

  mDocShell->GetContentViewer(getter_AddRefs(mContentViewer));
  if (mContentViewer)
  {
    mWebBrowserPrint = do_QueryInterface(mContentViewer);
    if (mWebBrowserPrint)
    {
      if (!mPrintSettings)
      {
        mWebBrowserPrint->GetGlobalPrintSettings(getter_AddRefs(mPrintSettings));
      }

      // fix for bug #118887 and bug #176016
      // don't show the actual url when printing mail messages or addressbook cards.
      // for mail, it can review the salt.  for addrbook, it's a data:// url, which
      // means nothing to the end user.
      // needs to be " " and not "" or nsnull, otherwise, we'll still print the url
      mPrintSettings->SetDocURL(NS_LITERAL_STRING(" ").get());

      nsresult rv = NS_ERROR_FAILURE;
      if (mIsDoingPrintPreview)
      {
        if (mStartupPPObs) {
          rv = mStartupPPObs->Observe(nsnull, nsnull, nsnull);
        }
      }
      else
      {
        mPrintSettings->SetPrintSilent(mCurrentlyPrintingURI != 0);
        nsCOMPtr<nsIContentViewerFile> contentViewerFile(do_QueryInterface(mWebBrowserPrint));
        if (contentViewerFile && mParentWindow)
        {
          rv = contentViewerFile->PrintWithParent(mParentWindow, mPrintSettings, (nsIWebProgressListener *)this);
        }
        else
        {
          rv = mWebBrowserPrint->Print(mPrintSettings, (nsIWebProgressListener *)this);
        }
      }

      if (NS_FAILED(rv))
      {
        mWebBrowserPrint = nsnull;
        mContentViewer = nsnull;
        PRBool isPrintingCancelled = PR_FALSE;
        if (mPrintSettings)
        {
          mPrintSettings->GetIsCancelled(&isPrintingCancelled);
        }
        if (!isPrintingCancelled)
        {
          StartNextPrintOperation();
        }
        else
        {
          mWindow->Close();
        }
      }
      else
      {
        // Tell the user we started printing...
        PRUnichar *msg = GetString(NS_ConvertASCIItoUCS2(kMsgKeys[mMsgInx]).get());
        SetStatusMessage( msg );
        CRTFREEIF(msg)
      }
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIMsgPrintEngine::setMsgType ( in long  aMsgType) [inherited]
nsresult nsMsgPrintEngine::SetStatusMessage ( PRUnichar aMsgString) [protected]

Definition at line 616 of file nsMsgPrintEngine.cpp.

{
  if ( (!mFeedback) || (!aMsgString) )
    return NS_OK;

  mFeedback->ShowStatusString(aMsgString);
  return NS_OK;
}

Here is the caller graph for this function:

Definition at line 593 of file nsMsgPrintEngine.cpp.

{
  if (!mDocShell)
    return;

  if (mDocShell)
  {
    nsCOMPtr<nsIWebProgress> progress(do_GetInterface(mDocShell));
    NS_ASSERTION(progress, "we were expecting a nsIWebProgress");
    if (progress)
    {
      (void) progress->AddProgressListener((nsIWebProgressListener *)this,
                                        nsIWebProgress::NOTIFY_STATE_DOCUMENT);
    }

    // Cache a pointer to the mail message's DOMWindow
    // so later we know when we can print when the
    // document "loaded" msgs com thru via the Progress listener
    mMsgDOMWin = do_GetInterface(mDocShell);
  }
}

Here is the call graph for this function:

nsresult nsMsgPrintEngine::ShowProgressDialog ( PRBool  aIsForPrinting,
PRBool aDoNotify 
) [protected]

Definition at line 370 of file nsMsgPrintEngine.cpp.

{
  nsresult rv;

  // default to not notifying, that if something here goes wrong
  // or we aren't going to show the progress dialog we can straight into
  // reflowing the doc for printing.
  aDoNotify = PR_FALSE;

  // Assume we can't do progress and then see if we can
  PRBool showProgressDialog = PR_FALSE;

  // if it is already being shown then don't bother to find out if it should be
  // so skip this and leave mShowProgressDialog set to FALSE
  nsCOMPtr<nsIPrefBranch> prefBranch = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
  if (NS_SUCCEEDED(rv))
  {
    prefBranch->GetBoolPref("print.show_print_progress", &showProgressDialog);
  }

  // Turning off the showing of Print Progress in Prefs overrides
  // whether the calling PS desire to have it on or off, so only check PS if
  // prefs says it's ok to be on.
  if (showProgressDialog)
  {
    mPrintSettings->GetShowPrintProgress(&showProgressDialog);
  }

  // Now open the service to get the progress dialog
  // If we don't get a service, that's ok, then just don't show progress
  if (showProgressDialog) {
    if (!mPrintPromptService)
    {
      mPrintPromptService = do_GetService(kPrintingPromptService);
    }
    if (mPrintPromptService)
    {
      nsCOMPtr<nsIDOMWindow> domWin(do_QueryInterface(mParentWindow));
      if (!domWin)
      {
        domWin = mWindow;
      }

      rv = mPrintPromptService->ShowProgress(domWin, mWebBrowserPrint, mPrintSettings, this, aIsForPrinting,
                                            getter_AddRefs(mPrintProgressListener),
                                            getter_AddRefs(mPrintProgressParams),
                                            &aDoNotify);
      if (NS_SUCCEEDED(rv)) {

        showProgressDialog = mPrintProgressListener != nsnull && mPrintProgressParams != nsnull;

        if (showProgressDialog)
        {
          nsIWebProgressListener* wpl = NS_STATIC_CAST(nsIWebProgressListener*, mPrintProgressListener.get());
          NS_ASSERTION(wpl, "nsIWebProgressListener is NULL!");
          NS_ADDREF(wpl);
          PRUnichar *msg = nsnull;
          if (mIsDoingPrintPreview) {
            GetString(NS_LITERAL_STRING("LoadingMailMsgForPrintPreview").get());
          } else {
            GetString(NS_LITERAL_STRING("LoadingMailMsgForPrint").get());
          }
          if (msg)
          {
            mPrintProgressParams->SetDocTitle(msg);
            nsCRT::free(msg);
          }
        }
      }
    }
  }
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsIMsgPrintEngine::showWindow ( in boolean  aShow) [inherited]

Definition at line 446 of file nsMsgPrintEngine.cpp.

{
  nsresult      rv;

  // Only do this the first time through...
  if (mCurrentlyPrintingURI == -1)
    InitializeDisplayCharset();

  mCurrentlyPrintingURI++;

  // First, check if we are at the end of this stuff!
  if ( mCurrentlyPrintingURI >= mURIArray.Count() )
  {
    // This is the end...dum, dum, dum....my only friend...the end
    mWindow->Close();

    // Tell the user we are done...
    PRUnichar *msg = GetString(NS_LITERAL_STRING("PrintingComplete").get());
    SetStatusMessage( msg );
    CRTFREEIF(msg)

    return NS_OK;
  }

  if (!mDocShell)
    return StartNextPrintOperation();

  nsString *uri = mURIArray.StringAt(mCurrentlyPrintingURI);
  rv = FireThatLoadOperationStartup(uri);
  if (NS_FAILED(rv))
    return StartNextPrintOperation();
  else
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 70 of file nsIMsgPrintEngine.idl.

Definition at line 108 of file nsMsgPrintEngine.h.

Definition at line 106 of file nsMsgPrintEngine.h.

Definition at line 101 of file nsMsgPrintEngine.h.

Definition at line 110 of file nsMsgPrintEngine.h.

Definition at line 114 of file nsMsgPrintEngine.h.

Definition at line 124 of file nsMsgPrintEngine.h.

Definition at line 113 of file nsMsgPrintEngine.h.

Definition at line 116 of file nsMsgPrintEngine.h.

const short nsIMsgPrintEngine::MNAB_END = 6 [inherited]

Definition at line 58 of file nsIMsgPrintEngine.idl.

Definition at line 54 of file nsIMsgPrintEngine.idl.

Definition at line 56 of file nsIMsgPrintEngine.idl.

Definition at line 52 of file nsIMsgPrintEngine.idl.

Definition at line 55 of file nsIMsgPrintEngine.idl.

Definition at line 57 of file nsIMsgPrintEngine.idl.

Definition at line 53 of file nsIMsgPrintEngine.idl.

const short nsIMsgPrintEngine::MNAB_START = 0 [inherited]

Print/PrintPreview Msg Type.

Definition at line 51 of file nsIMsgPrintEngine.idl.

Definition at line 103 of file nsMsgPrintEngine.h.

Definition at line 122 of file nsMsgPrintEngine.h.

Definition at line 121 of file nsMsgPrintEngine.h.

Definition at line 123 of file nsMsgPrintEngine.h.

Definition at line 120 of file nsMsgPrintEngine.h.

Definition at line 112 of file nsMsgPrintEngine.h.

Definition at line 115 of file nsMsgPrintEngine.h.

Definition at line 109 of file nsMsgPrintEngine.h.

nsStringArray nsMsgPrintEngine::mURIArray [protected]

Definition at line 105 of file nsMsgPrintEngine.h.

Definition at line 104 of file nsMsgPrintEngine.h.

Definition at line 111 of file nsMsgPrintEngine.h.

Definition at line 102 of file nsMsgPrintEngine.h.

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.

Definition at line 71 of file nsIMsgPrintEngine.idl.


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