Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Attributes
nsMsgComposeSendListener Class Reference

#include <nsMsgCompose.h>

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

List of all members.

Public Member Functions

 nsMsgComposeSendListener (void)
virtual ~nsMsgComposeSendListener (void)
NS_DECL_ISUPPORTS
NS_DECL_NSIMSGCOMPOSESENDLISTENER
NS_DECL_NSIMSGSENDLISTENER
NS_DECL_NSIMSGCOPYSERVICELISTENER
NS_DECL_NSIWEBPROGRESSLISTENER
nsresult 
RemoveCurrentDraftMessage (nsIMsgCompose *compObj, PRBool calledByCopy)
nsresult GetMsgFolder (nsIMsgCompose *compObj, nsIMsgFolder **msgFolder)
void setMsgCompose (in nsIMsgCompose msgCompose)
void setDeliverMode (in MSG_DeliverMode deliverMode)
void onStartSending (in string aMsgID, in PRUint32 aMsgSize)
 Notify the observer that the message has started to be delivered.
void onProgress (in string aMsgID, in PRUint32 aProgress, in PRUint32 aProgressMax)
 Notify the observer that progress as occurred for the message send.
void onStatus (in string aMsgID, in wstring aMsg)
 Notify the observer with a status message for the message send.
void onStopSending (in string aMsgID, in nsresult aStatus, in wstring aMsg, in nsIFileSpec returnFileSpec)
 Notify the observer that the message has been sent.
void onGetDraftFolderURI (in string aFolderURI)
 Notify the observer with the folder uri before the draft is copied.
void onSendNotPerformed (in string aMsgID, in nsresult aStatus)
 Notify the observer when the user aborts the send without actually doing the send eg : by closing the compose window without Send.
void OnStartCopy ()
 Notify the observer that the message has started to be copied.
void OnProgress (in PRUint32 aProgress, in PRUint32 aProgressMax)
 Notify the observer that progress as occurred for the message copy aProgress - aProgressMax -.
void SetMessageKey (in PRUint32 aKey)
 Setting newly created message key.
void GetMessageId (in nsCString aMessageId)
 Getting the file message message ID.
void OnStopCopy (in nsresult aStatus)
 Notify the observer that the message copied operation has completed.
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.

Public Attributes

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

Private Attributes

nsWeakPtr mWeakComposeObj
MSG_DeliverMode mDeliverMode

Detailed Description

Definition at line 221 of file nsMsgCompose.h.


Constructor & Destructor Documentation

Definition at line 3059 of file nsMsgCompose.cpp.

{ 
#if defined(DEBUG_ducarroz)
  printf("CREATE nsMsgComposeSendListener: %x\n", this);
#endif
  mDeliverMode = 0;
}

Definition at line 3067 of file nsMsgCompose.cpp.

{
#if defined(DEBUG_ducarroz)
  printf("DISPOSE nsMsgComposeSendListener: %x\n", this);
#endif
}

Member Function Documentation

Getting the file message message ID.

This method is taylored specifically for nsIMsgCopyService::CopyFileMessage() when saving Drafts/Templates. In order to work with imap server which doesn't support uidplus we have to use search comman to retrieve the key of newly created message. Message ID generated by the compose gurantee its uniqueness. aMessageId -

Definition at line 3345 of file nsMsgCompose.cpp.

{
  nsresult    rv;
  nsCOMPtr<nsIMsgFolder> aMsgFolder;
  nsXPIDLCString folderUri;

  rv = compObj->GetSavedFolderURI(getter_Copies(folderUri));
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr<nsIRDFService> rdfService (do_GetService("@mozilla.org/rdf/rdf-service;1", &rv));
  NS_ENSURE_SUCCESS(rv, rv); 

  nsCOMPtr <nsIRDFResource> resource;
  rv = rdfService->GetResource(folderUri, getter_AddRefs(resource));
  NS_ENSURE_SUCCESS(rv, rv); 

  aMsgFolder = do_QueryInterface(resource, &rv);
  NS_ENSURE_SUCCESS(rv, rv);
  *msgFolder = aMsgFolder;
  NS_IF_ADDREF(*msgFolder);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Notify the observer with the folder uri before the draft is copied.

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 nsIMsgSendListener::onProgress ( in string  aMsgID,
in PRUint32  aProgress,
in PRUint32  aProgressMax 
) [inherited]

Notify the observer that progress as occurred for the message send.

void nsIMsgCopyServiceListener::OnProgress ( in PRUint32  aProgress,
in PRUint32  aProgressMax 
) [inherited]

Notify the observer that progress as occurred for the message copy aProgress - aProgressMax -.

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 nsIMsgSendListener::onSendNotPerformed ( in string  aMsgID,
in nsresult  aStatus 
) [inherited]

Notify the observer when the user aborts the send without actually doing the send eg : by closing the compose window without Send.

Notify the observer that the message has started to be copied.

This method is called only once, at the beginning of a message copyoperation.

Implemented in CopyListener.

void nsIMsgSendListener::onStartSending ( in string  aMsgID,
in PRUint32  aMsgSize 
) [inherited]

Notify the observer that the message has started to be delivered.

This method is called only once, at the beginning of a message send operation.

Returns:
The return value is currently ignored. In the future it may be used to cancel the URL load..
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 nsIMsgSendListener::onStatus ( in string  aMsgID,
in wstring  aMsg 
) [inherited]

Notify the observer with a status message for the message send.

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.

Notify the observer that the message copied operation has completed.

This method is called regardless of whether the the operation was successful. aStatus - indicate whether the operation was succeeded

void nsIMsgSendListener::onStopSending ( in string  aMsgID,
in nsresult  aStatus,
in wstring  aMsg,
in nsIFileSpec  returnFileSpec 
) [inherited]

Notify the observer that the message has been sent.

This method is called once when the networking library has finished processing the message.

This method is called regardless of whether the the operation was successful. aMsgID The message id for the mail message status Status code for the message send. msg A text string describing the error. returnFileSpec The returned file spec for save to file operations.

Definition at line 3369 of file nsMsgCompose.cpp.

{
  nsresult    rv;
  nsCOMPtr <nsIMsgCompFields> compFields = nsnull;

  rv = compObj->GetCompFields(getter_AddRefs(compFields));
  NS_ASSERTION(NS_SUCCEEDED(rv), "RemoveCurrentDraftMessage can't get compose fields");
  if (NS_FAILED(rv) || !compFields)
    return rv;

  nsXPIDLCString curDraftIdURL;
  nsMsgKey newUid = 0;
  nsXPIDLCString newDraftIdURL;
  nsCOMPtr<nsIMsgFolder> msgFolder;

  rv = compFields->GetDraftId(getter_Copies(curDraftIdURL));
  NS_ASSERTION((NS_SUCCEEDED(rv) && (curDraftIdURL)), "RemoveCurrentDraftMessage can't get draft id");

  // Skip if no draft id (probably a new draft msg).
  if (NS_SUCCEEDED(rv) && curDraftIdURL.get() && strlen(curDraftIdURL.get()))
  { 
    nsCOMPtr <nsIMsgDBHdr> msgDBHdr;
    rv = GetMsgDBHdrFromURI(curDraftIdURL, getter_AddRefs(msgDBHdr));
    NS_ASSERTION(NS_SUCCEEDED(rv), "RemoveCurrentDraftMessage can't get msg header DB interface pointer.");
    if (NS_SUCCEEDED(rv) && msgDBHdr)
    { // get the folder for the message resource
      msgDBHdr->GetFolder(getter_AddRefs(msgFolder));
      NS_ASSERTION(NS_SUCCEEDED(rv), "RemoveCurrentDraftMessage can't get msg folder interface pointer.");
      if (NS_SUCCEEDED(rv) && msgFolder)
      {
        PRUint32 folderFlags;
        msgFolder->GetFlags(&folderFlags);
        // only do this if it's a drafts folder.
        if (folderFlags & MSG_FOLDER_FLAG_DRAFTS)
        {  // build the msg arrary
          nsCOMPtr<nsISupportsArray> messageArray;
          rv = NS_NewISupportsArray(getter_AddRefs(messageArray));
          NS_ASSERTION(NS_SUCCEEDED(rv), "RemoveCurrentDraftMessage can't allocate support array.");

          //nsCOMPtr<nsISupports> msgSupport = do_QueryInterface(msgDBHdr, &rv);
          //NS_ASSERTION(NS_SUCCEEDED(rv), "RemoveCurrentDraftMessage can't get msg header interface pointer.");
          if (NS_SUCCEEDED(rv) && messageArray)
          {   // ready to delete the msg
            rv = messageArray->AppendElement(msgDBHdr);
            NS_ASSERTION(NS_SUCCEEDED(rv), "RemoveCurrentDraftMessage can't append msg header to array.");
            if (NS_SUCCEEDED(rv))
            rv = msgFolder->DeleteMessages(messageArray, nsnull, PR_TRUE, PR_FALSE, nsnull, PR_FALSE /*allowUndo*/);
            NS_ASSERTION(NS_SUCCEEDED(rv), "RemoveCurrentDraftMessage can't delete message.");
          }
        }
      }
    }
    else
    {
      // If we get here we have the case where the draft folder 
                  // is on the server and
      // it's not currently open (in thread pane), so draft 
                  // msgs are saved to the server
      // but they're not in our local DB. In this case, 
      // GetMsgDBHdrFromURI() will never
      // find the msg. If the draft folder is a local one 
      // then we'll not get here because
      // the draft msgs are saved to the local folder and 
      // are in local DB. Make sure the
      // msg folder is imap.  Even if we get here due to 
      // DB errors (worst case), we should
      // still try to delete msg on the server because 
      // that's where the master copy of the
      // msgs are stored, if draft folder is on the server.  
      // For local case, since DB is bad
      // we can't do anything with it anyway so it'll be 
      // noop in this case.
      rv = GetMsgFolder(compObj, getter_AddRefs(msgFolder));
      if (NS_SUCCEEDED(rv) && msgFolder)
      {
        nsCOMPtr <nsIMsgImapMailFolder> imapFolder = do_QueryInterface(msgFolder);
        NS_ASSERTION(imapFolder, "The draft folder MUST be an imap folder in order to mark the msg delete!");
        if (NS_SUCCEEDED(rv) && imapFolder)
        {
          const char * str = PL_strstr(curDraftIdURL.get(), "#");
          NS_ASSERTION(str, "Failed to get current draft id url");
          if (str)
          {
            nsMsgKeyArray messageID;
            nsCAutoString srcStr(str+1);
            PRInt32 num=0, err;
            num = srcStr.ToInteger(&err);
            if (num != PRInt32(nsMsgKey_None))
            {
              messageID.Add(num);
              rv = imapFolder->StoreImapFlags(kImapMsgDeletedFlag, PR_TRUE, messageID.GetArray(), 
                                                messageID.GetSize(), nsnull);
            }
          }
        }
      }
    }
  }

  // Now get the new uid so that next save will remove the right msg
  // regardless whether or not the exiting msg can be deleted.
  if (calledByCopy)
  {
    nsCOMPtr<nsIMsgFolder> savedToFolder;
    nsCOMPtr<nsIMsgSend> msgSend;
    rv = compObj->GetMessageSend(getter_AddRefs(msgSend));
    NS_ASSERTION(msgSend, "RemoveCurrentDraftMessage msgSend is null.");
    if (NS_FAILED(rv) || !msgSend)
      return rv;

    rv = msgSend->GetMessageKey(&newUid);
    NS_ENSURE_SUCCESS(rv, rv);

    // Make sure we have a folder interface pointer
    rv = GetMsgFolder(compObj, getter_AddRefs(savedToFolder));

    // Reset draft (uid) url with the new uid.
    if (savedToFolder && newUid != nsMsgKey_None)
    {
      PRUint32 folderFlags;
      savedToFolder->GetFlags(&folderFlags);
      if (folderFlags & MSG_FOLDER_FLAG_DRAFTS)
      {
        rv = savedToFolder->GenerateMessageURI(newUid, getter_Copies(newDraftIdURL));
        NS_ENSURE_SUCCESS(rv, rv);
        compFields->SetDraftId(newDraftIdURL.get());
      }
    }
  }
  return rv;
}

Here is the call graph for this function:

Setting newly created message key.

This method is taylored specifically for nsIMsgCopyService::CopyFileMessage() when saveing Drafts/Templates. We need to have a way to inform the client what's the key of the newly created message. aKey -


Member Data Documentation

Definition at line 247 of file nsMsgCompose.h.

Definition at line 246 of file nsMsgCompose.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.


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