Back to index

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

#include <nsMsgCompFields.h>

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

List of all members.

Public Types

enum  MsgHeaderID {
  MSG_FROM_HEADER_ID = 0, MSG_REPLY_TO_HEADER_ID, MSG_TO_HEADER_ID, MSG_CC_HEADER_ID,
  MSG_BCC_HEADER_ID, MSG_FCC_HEADER_ID, MSG_FCC2_HEADER_ID, MSG_NEWSGROUPS_HEADER_ID,
  MSG_FOLLOWUP_TO_HEADER_ID, MSG_SUBJECT_HEADER_ID, MSG_ATTACHMENTS_HEADER_ID, MSG_ORGANIZATION_HEADER_ID,
  MSG_REFERENCES_HEADER_ID, MSG_OTHERRANDOMHEADERS_HEADER_ID, MSG_NEWSPOSTURL_HEADER_ID, MSG_PRIORITY_HEADER_ID,
  MSG_CHARACTER_SET_HEADER_ID, MSG_MESSAGE_ID_HEADER_ID, MSG_X_TEMPLATE_HEADER_ID, MSG_DRAFT_ID_HEADER_ID,
  MSG_TEMPORARY_FILES_HEADER_ID, MSG_MAX_HEADERS
}
typedef NS_DECL_ISUPPORTS
NS_DECL_NSIMSGCOMPFIELDS enum
nsMsgCompFields::MsgHeaderID 
MsgHeaderID

Public Member Functions

 nsMsgCompFields ()
virtual ~nsMsgCompFields ()
nsresult SetAsciiHeader (MsgHeaderID header, const char *value)
const char * GetAsciiHeader (MsgHeaderID header)
nsresult SetUnicodeHeader (MsgHeaderID header, const nsAString &value)
nsresult GetUnicodeHeader (MsgHeaderID header, nsAString &_retval)
nsresult SetFrom (const char *value)
const char * GetFrom (void)
nsresult SetReplyTo (const char *value)
const char * GetReplyTo ()
nsresult SetTo (const char *value)
const char * GetTo ()
nsresult SetCc (const char *value)
const char * GetCc ()
nsresult SetBcc (const char *value)
const char * GetBcc ()
nsresult SetFcc (const char *value)
const char * GetFcc ()
nsresult SetFcc2 (const char *value)
const char * GetFcc2 ()
nsresult SetNewsgroups (const char *aValue)
const char * GetNewsgroups ()
const char * GetNewshost ()
const char * GetFollowupTo ()
nsresult SetSubject (const char *value)
const char * GetSubject ()
const char * GetAttachments ()
const char * GetTemporaryFiles ()
nsresult SetOrganization (const char *value)
const char * GetOrganization ()
const char * GetReferences ()
nsresult SetOtherRandomHeaders (const char *value)
const char * GetOtherRandomHeaders ()
const char * GetNewspostUrl ()
const char * GetPriority ()
const char * GetCharacterSet ()
const char * GetMessageId ()
nsresult SetTemplateName (const char *value)
const char * GetTemplateName ()
const char * GetDraftId ()
PRBool GetReturnReceipt ()
PRBool GetAttachVCard ()
PRBool GetForcePlainText ()
PRBool GetUseMultipartAlternative ()
PRBool GetUuEncodeAttachments ()
PRBool GetBodyIsAsciiOnly ()
PRBool GetForceMsgEncoding ()
nsresult SetBody (const char *value)
const char * GetBody ()
nsresult SplitRecipientsEx (const PRUnichar *recipients, nsIMsgRecipientArray **fullAddrsArray, nsIMsgRecipientArray **emailsArray)
void addAttachment (in nsIMsgAttachment attachment)
void removeAttachment (in nsIMsgAttachment attachment)
void removeAttachments ()
nsIMsgRecipientArray SplitRecipients (in wstring recipients, in boolean emailAddressOnly)
void ConvertBodyToPlainText ()
boolean checkCharsetConversion (out string fallbackCharset)

Public Attributes

attribute AString from
attribute AString replyTo
attribute AString to
attribute AString cc
attribute AString bcc
attribute AString fcc
attribute AString fcc2
attribute AString newsgroups
attribute string newshost
attribute string newspostUrl
attribute string followupTo
attribute AString subject
attribute string attachments
 attachments
attribute AString organization
attribute string references
attribute string priority
attribute string messageId
attribute string characterSet
readonly attribute string defaultCharacterSet
attribute AString templateName
attribute string draftId
attribute boolean returnReceipt
attribute long receiptHeaderType
attribute boolean attachVCard
attribute boolean forcePlainText
attribute boolean useMultipartAlternative
attribute boolean uuEncodeAttachments
attribute boolean bodyIsAsciiOnly
attribute boolean forceMsgEncoding
attribute AString otherRandomHeaders
attribute AString body
attribute string temporaryFiles
 temporaryFiles
readonly attribute nsISupportsArray attachmentsArray
attribute boolean needToCheckCharset
 Indicates whether we need to check if the current |DocumentCharset| can represent all the characters in the message body.
attribute nsISupports securityInfo

Protected Attributes

char * m_headers [MSG_MAX_HEADERS]
nsCString m_body
nsCOMPtr< nsISupportsArraym_attachments
PRBool m_attachVCard
PRBool m_forcePlainText
PRBool m_useMultipartAlternative
PRBool m_uuEncodeAttachments
PRBool m_returnReceipt
PRBool m_bodyIsAsciiOnly
PRBool m_forceMsgEncoding
PRInt32 m_receiptHeaderType
nsCString m_DefaultCharacterSet
PRBool m_needToCheckCharset
nsCOMPtr< nsISupports > mSecureCompFields

Detailed Description

Definition at line 49 of file nsMsgCompFields.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
MSG_FROM_HEADER_ID 
MSG_REPLY_TO_HEADER_ID 
MSG_TO_HEADER_ID 
MSG_CC_HEADER_ID 
MSG_BCC_HEADER_ID 
MSG_FCC_HEADER_ID 
MSG_FCC2_HEADER_ID 
MSG_NEWSGROUPS_HEADER_ID 
MSG_FOLLOWUP_TO_HEADER_ID 
MSG_SUBJECT_HEADER_ID 
MSG_ATTACHMENTS_HEADER_ID 
MSG_ORGANIZATION_HEADER_ID 
MSG_REFERENCES_HEADER_ID 
MSG_OTHERRANDOMHEADERS_HEADER_ID 
MSG_NEWSPOSTURL_HEADER_ID 
MSG_PRIORITY_HEADER_ID 
MSG_CHARACTER_SET_HEADER_ID 
MSG_MESSAGE_ID_HEADER_ID 
MSG_X_TEMPLATE_HEADER_ID 
MSG_DRAFT_ID_HEADER_ID 
MSG_TEMPORARY_FILES_HEADER_ID 
MSG_MAX_HEADERS 

Definition at line 58 of file nsMsgCompFields.h.


Constructor & Destructor Documentation

Definition at line 55 of file nsMsgCompFields.cpp.

Here is the call graph for this function:

Definition at line 84 of file nsMsgCompFields.cpp.

{
  PRInt16 i;
  for (i = 0; i < MSG_MAX_HEADERS; i ++)
    PR_FREEIF(m_headers[i]);
}

Member Function Documentation

boolean nsIMsgCompFields::checkCharsetConversion ( out string  fallbackCharset) [inherited]

Here is the caller graph for this function:

Definition at line 119 of file nsMsgCompFields.cpp.

{
  NS_ASSERTION(header >= 0 && header < MSG_MAX_HEADERS,
               "Invalid message header index!");

  return m_headers[header] ? m_headers[header] : "";
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 128 of file nsMsgCompFields.h.

                               {
    NS_ASSERTION(0, "nsMsgCompFields::GetAttachments is not supported anymore, please use nsMsgCompFields::GetAttachmentsArray");
    return GetAsciiHeader(MSG_ATTACHMENTS_HEADER_ID);
    }

Here is the call graph for this function:

Definition at line 160 of file nsMsgCompFields.h.

{return m_attachVCard;}

Here is the caller graph for this function:

Definition at line 110 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 477 of file nsMsgCompFields.cpp.

{
  CopyUTF8toUTF16(m_body, _retval);
  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 164 of file nsMsgCompFields.h.

Here is the caller graph for this function:

Definition at line 107 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 150 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 157 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 113 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 116 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 123 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 165 of file nsMsgCompFields.h.

Here is the caller graph for this function:

Definition at line 161 of file nsMsgCompFields.h.

{return m_forcePlainText;}

Here is the caller graph for this function:

Definition at line 98 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 152 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 119 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 121 of file nsMsgCompFields.h.

Here is the call graph for this function:

Definition at line 146 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 139 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 144 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 148 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 141 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 101 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 159 of file nsMsgCompFields.h.

{return m_returnReceipt;}

Here is the caller graph for this function:

Definition at line 126 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 155 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 133 of file nsMsgCompFields.h.

                                  {
    NS_ASSERTION(0, "nsMsgCompFields::GetTemporaryFiles is not supported anymore, please use nsMsgCompFields::GetAttachmentsArray");
    return GetAsciiHeader(MSG_TEMPORARY_FILES_HEADER_ID);
    }

Here is the call graph for this function:

Definition at line 104 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgCompFields::GetUnicodeHeader ( MsgHeaderID  header,
nsAString &  _retval 
)

Definition at line 132 of file nsMsgCompFields.cpp.

Here is the call graph for this function:

Definition at line 162 of file nsMsgCompFields.h.

Here is the caller graph for this function:

Definition at line 163 of file nsMsgCompFields.h.

Here is the caller graph for this function:

Definition at line 91 of file nsMsgCompFields.cpp.

{
  NS_ASSERTION(header >= 0 && header < MSG_MAX_HEADERS,
               "Invalid message header index!");

  int rv = NS_OK;
  char* old = m_headers[header]; /* Done with careful paranoia, in case the
                                    value given is the old value (or worse,
                                    a substring of the old value, as does
                                    happen here and there.)
                                  */
  if (value != old)
  {
    if (value)
    {
        m_headers[header] = nsCRT::strdup(value);
        if (!m_headers[header]) 
           rv = NS_ERROR_OUT_OF_MEMORY;
    }
    else 
      m_headers[header] = nsnull;

    PR_FREEIF(old);
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsMsgCompFields::SetBcc ( const char *  value) [inline]

Definition at line 109 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 471 of file nsMsgCompFields.cpp.

Here is the call graph for this function:

NS_IMETHODIMP nsMsgCompFields::SetCc ( const char *  value) [inline]

Definition at line 106 of file nsMsgCompFields.h.

Here is the call graph for this function:

NS_IMETHODIMP nsMsgCompFields::SetFcc ( const char *  value) [inline]

Definition at line 112 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsMsgCompFields::SetFcc2 ( const char *  value) [inline]

Definition at line 115 of file nsMsgCompFields.h.

Here is the call graph for this function:

NS_IMETHODIMP nsMsgCompFields::SetFrom ( const char *  value) [inline]

Definition at line 97 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsMsgCompFields::SetNewsgroups ( const char *  aValue) [inline]

Definition at line 118 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 138 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 143 of file nsMsgCompFields.h.

Here is the call graph for this function:

NS_IMETHODIMP nsMsgCompFields::SetReplyTo ( const char *  value) [inline]

Definition at line 100 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsMsgCompFields::SetSubject ( const char *  value) [inline]

Definition at line 125 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 154 of file nsMsgCompFields.h.

Here is the call graph for this function:

NS_IMETHODIMP nsMsgCompFields::SetTo ( const char *  value) [inline]

Definition at line 103 of file nsMsgCompFields.h.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsMsgCompFields::SetUnicodeHeader ( MsgHeaderID  header,
const nsAString &  value 
)

Definition at line 127 of file nsMsgCompFields.cpp.

Here is the call graph for this function:

nsIMsgRecipientArray nsIMsgCompFields::SplitRecipients ( in wstring  recipients,
in boolean  emailAddressOnly 
) [inherited]
nsresult nsMsgCompFields::SplitRecipientsEx ( const PRUnichar recipients,
nsIMsgRecipientArray **  fullAddrsArray,
nsIMsgRecipientArray **  emailsArray 
)

Definition at line 644 of file nsMsgCompFields.cpp.

{
  NS_ASSERTION(recipients, "The recipient list is not supposed to be null -Fix the caller!");

  nsresult rv = NS_OK;

  nsMsgRecipientArray* pAddrsArray = nsnull;
  if (fullAddrsArray)
  {
    *fullAddrsArray = nsnull;
    pAddrsArray = new nsMsgRecipientArray;
    if (! pAddrsArray)
      return NS_ERROR_OUT_OF_MEMORY;
    rv = pAddrsArray->QueryInterface(NS_GET_IID(nsIMsgRecipientArray), (void **)fullAddrsArray);
    if (NS_FAILED(rv))
      return rv;
  }
  
  nsMsgRecipientArray* pEmailsArray = nsnull;
  if (emailsArray)
  {
    *emailsArray = nsnull;
    pEmailsArray = new nsMsgRecipientArray;
    if (! pEmailsArray)
      return NS_ERROR_OUT_OF_MEMORY;
    rv = pEmailsArray->QueryInterface(NS_GET_IID(nsIMsgRecipientArray), (void **)emailsArray);
    if (NS_FAILED(rv))
      return rv;
  }
       
       if (pAddrsArray || pEmailsArray)
       {
              nsCOMPtr<nsIMsgHeaderParser> parser = do_GetService(NS_MAILNEWS_MIME_HEADER_PARSER_CONTRACTID);
              if (parser)
              {
                     nsCAutoString recipientsStr;
                     char * names;
                     char *addresses;
                     PRUint32 numAddresses;

                        CopyUTF16toUTF8(recipients, recipientsStr);
                     rv= parser->ParseHeaderAddresses("UTF-8", recipientsStr.get(), &names,
                                       &addresses, &numAddresses);
                     if (NS_SUCCEEDED(rv))
                     {
                            PRUint32 i=0;
                            char * pNames = names;
                            char * pAddresses = addresses;
                            nsAutoString recipient;
                            PRBool aBool;
                            
        for (i = 0; i < numAddresses; i ++)
        {
          nsXPIDLCString fullAddress;
          if (pAddrsArray)
          {
            rv = parser->MakeFullAddress("UTF-8", pNames, pAddresses, 
                                         getter_Copies(fullAddress));
            if (NS_SUCCEEDED(rv))
            {
              rv = ConvertToUnicode("UTF-8", fullAddress, recipient);
            }
            else
              rv = ConvertToUnicode("UTF-8", pAddresses, recipient);
            if (NS_FAILED(rv))
              return rv;
              
            rv = pAddrsArray->AppendString(recipient.get(), &aBool);
            if (NS_FAILED(rv))
              return rv;
          }

          if (pEmailsArray)
          {
            rv = ConvertToUnicode("UTF-8", pAddresses, recipient);
            if (NS_FAILED(rv))
              return rv;
            rv = pEmailsArray->AppendString(recipient.get(), &aBool);
            if (NS_FAILED(rv))
              return rv;
          }

          pNames += PL_strlen(pNames) + 1;
          pAddresses += PL_strlen(pAddresses) + 1;
        }
      
                            PR_FREEIF(names);
                            PR_FREEIF(addresses);
      }
    }
    else
      rv = NS_ERROR_FAILURE;
  }
    
  return rv;
}

Here is the call graph for this function:


Member Data Documentation

attachments

, DO NOT USE ANYMORE

Definition at line 67 of file nsIMsgCompFields.idl.

Definition at line 99 of file nsIMsgCompFields.idl.

Definition at line 81 of file nsIMsgCompFields.idl.

attribute AString nsIMsgCompFields::bcc [inherited]

Definition at line 50 of file nsIMsgCompFields.idl.

attribute AString nsIMsgCompFields::body [inherited]

Definition at line 90 of file nsIMsgCompFields.idl.

Definition at line 85 of file nsIMsgCompFields.idl.

attribute AString nsIMsgCompFields::cc [inherited]

Definition at line 49 of file nsIMsgCompFields.idl.

Definition at line 73 of file nsIMsgCompFields.idl.

Definition at line 74 of file nsIMsgCompFields.idl.

Definition at line 77 of file nsIMsgCompFields.idl.

attribute AString nsIMsgCompFields::fcc [inherited]

Definition at line 52 of file nsIMsgCompFields.idl.

attribute AString nsIMsgCompFields::fcc2 [inherited]

Definition at line 53 of file nsIMsgCompFields.idl.

Definition at line 58 of file nsIMsgCompFields.idl.

Definition at line 86 of file nsIMsgCompFields.idl.

Definition at line 82 of file nsIMsgCompFields.idl.

attribute AString nsIMsgCompFields::from [inherited]

Definition at line 46 of file nsIMsgCompFields.idl.

Definition at line 175 of file nsMsgCompFields.h.

Definition at line 176 of file nsMsgCompFields.h.

Definition at line 174 of file nsMsgCompFields.h.

Definition at line 181 of file nsMsgCompFields.h.

Definition at line 184 of file nsMsgCompFields.h.

Definition at line 182 of file nsMsgCompFields.h.

Definition at line 177 of file nsMsgCompFields.h.

Definition at line 173 of file nsMsgCompFields.h.

Definition at line 185 of file nsMsgCompFields.h.

Definition at line 183 of file nsMsgCompFields.h.

Definition at line 180 of file nsMsgCompFields.h.

Definition at line 178 of file nsMsgCompFields.h.

Definition at line 179 of file nsMsgCompFields.h.

Definition at line 72 of file nsIMsgCompFields.idl.

nsCOMPtr<nsISupports> nsMsgCompFields::mSecureCompFields [protected]

Definition at line 187 of file nsMsgCompFields.h.

Indicates whether we need to check if the current |DocumentCharset| can represent all the characters in the message body.

It should be initialized to true and set to false when 'Send Anyway' is selected by a user. (bug 249530)

Definition at line 117 of file nsIMsgCompFields.idl.

Definition at line 55 of file nsIMsgCompFields.idl.

Definition at line 56 of file nsIMsgCompFields.idl.

Definition at line 57 of file nsIMsgCompFields.idl.

Definition at line 69 of file nsIMsgCompFields.idl.

Definition at line 88 of file nsIMsgCompFields.idl.

Definition at line 71 of file nsIMsgCompFields.idl.

Definition at line 80 of file nsIMsgCompFields.idl.

Definition at line 70 of file nsIMsgCompFields.idl.

attribute AString nsIMsgCompFields::replyTo [inherited]

Definition at line 47 of file nsIMsgCompFields.idl.

Definition at line 79 of file nsIMsgCompFields.idl.

attribute nsISupports nsIMsgCompFields::securityInfo [inherited]

Definition at line 119 of file nsIMsgCompFields.idl.

attribute AString nsIMsgCompFields::subject [inherited]

Definition at line 60 of file nsIMsgCompFields.idl.

Definition at line 76 of file nsIMsgCompFields.idl.

temporaryFiles

, DO NOT USE ANYMORE

Definition at line 97 of file nsIMsgCompFields.idl.

attribute AString nsIMsgCompFields::to [inherited]

Definition at line 48 of file nsIMsgCompFields.idl.

Definition at line 83 of file nsIMsgCompFields.idl.

Definition at line 84 of file nsIMsgCompFields.idl.


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