Back to index

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

#include <nsMsgWindow.h>

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

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS nsMsgWindow ()
virtual ~nsMsgWindow ()
nsresult Init ()
void displayHTMLInMessagePane (in wstring title, in wstring body, in boolean clearMsgHdr)
void SetDOMWindow (in nsIDOMWindowInternal window)
void StopUrls ()
void SelectFolder (in string folderUri)
void SelectMessage (in string messageUri)
void closeWindow ()
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

attribute
nsIMsgMessagePaneController 
messagePaneController
attribute nsIMsgStatusFeedback statusFeedback
attribute nsIMsgHeaderSink msgHeaderSink
attribute nsITransactionManager transactionManager
attribute nsIMsgFolder openFolder
attribute nsIDocShell rootDocShell
readonly attribute nsIPrompt promptDialog
attribute string mailCharacterSet
attribute boolean charsetOverride
attribute boolean stopped
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

void GetMessageWindowDocShell (nsIDocShell **aDocShell)

Protected Attributes

nsCOMPtr< nsIMsgHeaderSinkmMsgHeaderSink
nsCOMPtr< nsIMsgStatusFeedbackmStatusFeedback
nsCOMPtr
< nsIMsgMessagePaneController
mMsgPaneController
nsCOMPtr< nsITransactionManagermTransactionManager
nsCOMPtr< nsIMsgFoldermOpenFolder
nsCOMPtr< nsIMsgWindowCommandsmMsgWindowCommands
nsWeakPtr mRootDocShellWeak
nsWeakPtr mMessageWindowDocShellWeak
nsCString mMailCharacterSet
PRBool mCharsetOverride
PRBool m_stopped

Detailed Description

Definition at line 52 of file nsMsgWindow.h.


Constructor & Destructor Documentation

Definition at line 87 of file nsMsgWindow.cpp.

{
  CloseWindow();
}

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.

void nsIMsgWindow::displayHTMLInMessagePane ( in wstring  title,
in wstring  body,
in boolean  clearMsgHdr 
) [inherited]
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.

Definition at line 113 of file nsMsgWindow.cpp.

{
  nsCOMPtr<nsIDocShell> docShell(do_QueryReferent(mMessageWindowDocShellWeak));
  if (!docShell)
  {
    // if we don't have a docshell, then we need to look up the message pane docshell
    nsCOMPtr<nsIDocShell> rootShell(do_QueryReferent(mRootDocShellWeak));
    if (rootShell)
    {
      nsCOMPtr<nsIDocShellTreeNode> rootAsNode(do_QueryInterface(rootShell));

      nsCOMPtr<nsIDocShellTreeItem> msgDocShellItem;
      if(rootAsNode)
         rootAsNode->FindChildWithName(NS_LITERAL_STRING("messagepane").get(),
                                       PR_TRUE, PR_FALSE, nsnull, nsnull,
                                       getter_AddRefs(msgDocShellItem));

      docShell = do_QueryInterface(msgDocShellItem);
      // we don't own mMessageWindowDocShell so don't try to keep a reference to it!
      mMessageWindowDocShellWeak = do_GetWeakReference(docShell);
    }
  }

  *aDocShell = docShell;
  NS_IF_ADDREF(*aDocShell);
}

Here is the call graph for this function:

Definition at line 92 of file nsMsgWindow.cpp.

{
  // register ourselves as a content listener with the uri dispatcher service
  nsresult rv;
  nsCOMPtr<nsIURILoader> dispatcher = 
           do_GetService(NS_URI_LOADER_CONTRACTID, &rv);
  if (NS_FAILED(rv))
    return rv;

  rv = dispatcher->RegisterContentListener(this);
  if (NS_FAILED(rv))
    return rv;

  // create Undo/Redo Transaction Manager
  mTransactionManager = do_CreateInstance(kTransactionManagerCID, &rv);
  if (NS_SUCCEEDED(rv))
    mTransactionManager->SetMaxTransactionCount(-1);

  return rv;
}

Here is the call graph for this function:

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.

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 nsIMsgWindow::SelectFolder ( in string  folderUri) [inherited]
void nsIMsgWindow::SelectMessage ( in string  messageUri) [inherited]
void nsIMsgWindow::StopUrls ( ) [inherited]

Member Data Documentation

Definition at line 77 of file nsIMsgWindow.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 81 of file nsMsgWindow.h.

Definition at line 75 of file nsIMsgWindow.idl.

Definition at line 80 of file nsMsgWindow.h.

Definition at line 66 of file nsIMsgWindow.idl.

Definition at line 79 of file nsMsgWindow.h.

Definition at line 77 of file nsMsgWindow.h.

Definition at line 68 of file nsMsgWindow.h.

Definition at line 70 of file nsMsgWindow.h.

Definition at line 73 of file nsMsgWindow.h.

Definition at line 72 of file nsMsgWindow.h.

Definition at line 76 of file nsMsgWindow.h.

Definition at line 68 of file nsIMsgWindow.idl.

Definition at line 69 of file nsMsgWindow.h.

Definition at line 71 of file nsMsgWindow.h.

Definition at line 70 of file nsIMsgWindow.idl.

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.

Definition at line 74 of file nsIMsgWindow.idl.

Definition at line 71 of file nsIMsgWindow.idl.

Definition at line 67 of file nsIMsgWindow.idl.

Definition at line 83 of file nsIMsgWindow.idl.

Definition at line 69 of file nsIMsgWindow.idl.


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