/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIMsgHeaderParser.idl
 */

#ifndef __gen_nsIMsgHeaderParser_h__
#define __gen_nsIMsgHeaderParser_h__


#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

#ifndef __gen_nsrootidl_h__
#include "nsrootidl.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsISimpleEnumerator; /* forward declaration */

#define NS_MAILNEWS_MIME_HEADER_PARSER_CONTRACTID \
  "@mozilla.org/messenger/headerparser;1"

/* starting interface:    nsIMsgHeaderParser */
#define NS_IMSGHEADERPARSER_IID_STR "a67d4d96-e5cb-458d-9311-794d5d1a9832"

#define NS_IMSGHEADERPARSER_IID \
  {0xa67d4d96, 0xe5cb, 0x458d, \
    { 0x93, 0x11, 0x79, 0x4d, 0x5d, 0x1a, 0x98, 0x32 }}

class NS_NO_VTABLE NS_SCRIPTABLE nsIMsgHeaderParser : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMSGHEADERPARSER_IID)

  /* void parseHeadersWithArray (in wstring aLine, [array, size_is (count)] out wstring aEmailAddresses, [array, size_is (count)] out wstring aNames, [array, size_is (count)] out wstring aFullNames, [retval] out unsigned long count); */
  NS_SCRIPTABLE NS_IMETHOD ParseHeadersWithArray(const PRUnichar *aLine, PRUnichar ***aEmailAddresses NS_OUTPARAM, PRUnichar ***aNames NS_OUTPARAM, PRUnichar ***aFullNames NS_OUTPARAM, PRUint32 *count NS_OUTPARAM) = 0;

  /**
   * Given a string which contains a list of Header addresses, parses it into
   * their component names and mailboxes.
   *
   * @param aLine          The header line to parse.
   * @param aNames         A string of the names in the header line. The names
   *                       are separated by null-terminators.
   *                       This param may be null if the caller does not want
   *                       this part of the result.
   * @param aAddresses     A string of the addresses in the header line. The
   *                       addresses are separated by null-terminators.
   *                       This param may be null if the caller does not want
   *                       this part of the result.
   * @param aNumAddresses  The number of addresses in the header. If this is
   *                       negative, there has been an error parsing the
   *                       header.
   */
  /* [noscript] void parseHeaderAddresses (in string aLine, out string aNames, out string aAddresses, out PRUint32 aNumAddresses); */
  NS_IMETHOD ParseHeaderAddresses(const char *aLine, char **aNames NS_OUTPARAM, char **aAddresses NS_OUTPARAM, PRUint32 *aNumAddresses NS_OUTPARAM) = 0;

  /**
   * Given a string which contains a list of Header addresses, returns a
   * comma-separated list of just the `mailbox' portions.
   *
   * @param aLine          The header line to parse.
   * @return               A comma-separated list of just the mailbox parts
   *                       of the email-addresses.
   */
  /* ACString extractHeaderAddressMailboxes (in ACString aLine); */
  NS_SCRIPTABLE NS_IMETHOD ExtractHeaderAddressMailboxes(const nsACString & aLine, nsACString & _retval NS_OUTPARAM) = 0;

  /**
   * Given a string which contains a list of Header addresses, returns a
   * comma-separated list of just the `user name' portions.  If any of
   * the addresses doesn't have a name, then the mailbox is used instead.
   *
   * @param aLine          The header line to parse.
   * @return               A comma-separated list of just the name parts
   *                       of the addresses.
   */
  /* AUTF8String extractHeaderAddressNames (in AUTF8String aLine); */
  NS_SCRIPTABLE NS_IMETHOD ExtractHeaderAddressNames(const nsACString & aLine, nsACString & _retval NS_OUTPARAM) = 0;

  /* AUTF8String extractHeaderAddressName (in AUTF8String aLine); */
  NS_SCRIPTABLE NS_IMETHOD ExtractHeaderAddressName(const nsACString & aLine, nsACString & _retval NS_OUTPARAM) = 0;

  /**
   * Given a string which contains a list of Header addresses, returns a new
   * string with the same data, but inserts missing commas, parses and reformats
   * it, and wraps long lines with newline-tab.
   *
   * @param aLine          The header line to parse.
   * @return               The reformatted header line.
   */
  /* [noscript] string reformatHeaderAddresses (in string aLine); */
  NS_IMETHOD ReformatHeaderAddresses(const char *aLine, char **_retval NS_OUTPARAM) = 0;

  /**
   * Returns a copy of the input which may have had some addresses removed.
   * Addresses are removed if they are already in either of the supplied
   * address lists.
   *
   * Addresses are considered to be the same if they contain the same mailbox
   * part (case-insensitive.)  Real names and other comments are not compared.
   *
   * @param aAddrs              The addresses to remove duplicates from.
   * @param aOtherAddrs         Other addresses that the duplicate removal
   *                            process also checks for duplicates against.
   *                            Addresses in this list will not be added to the
   *                            result.
   * @return                    A string based on the original without the
   *                            duplicate addresses.
   */
  /* AUTF8String removeDuplicateAddresses (in AUTF8String aAddrs, in AUTF8String aOtherAddrs); */
  NS_SCRIPTABLE NS_IMETHOD RemoveDuplicateAddresses(const nsACString & aAddrs, const nsACString & aOtherAddrs, nsACString & _retval NS_OUTPARAM) = 0;

  /**
   * Given an e-mail address and a person's name, cons them together into a
   * single string, doing all the necessary quoting.
   *
   * @param  aName     The name of the sender.
   * @param  aAddress  The address of the sender.
   * @return           A string of the form name <address>.
   */
  /* AString makeFullAddress (in AString aName, in AString aAddress); */
  NS_SCRIPTABLE NS_IMETHOD MakeFullAddress(const nsAString & aName, const nsAString & aAddress, nsAString & _retval NS_OUTPARAM) = 0;

  /**
   * Given an e-mail address and a person's name, cons them together into a
   * single string, doing all the necessary quoting (const char* version).
   *
   * @param  aName     The name of the sender. This should be in UTF-8.
   * @param  aAddress  The address of the sender. This should be in UTF-8.
   * @return           A string of the form name <address>.
   */
  /* [noscript] string makeFullAddressString (in string aName, in string aAddress); */
  NS_IMETHOD MakeFullAddressString(const char *aName, const char *aAddress, char **_retval NS_OUTPARAM) = 0;

  /* [noscript] string unquotePhraseOrAddr (in string line, in boolean preserveIntegrity); */
  NS_IMETHOD UnquotePhraseOrAddr(const char *line, PRBool preserveIntegrity, char **_retval NS_OUTPARAM) = 0;

  /* wstring unquotePhraseOrAddrWString (in wstring line, in boolean preserveIntegrity); */
  NS_SCRIPTABLE NS_IMETHOD UnquotePhraseOrAddrWString(const PRUnichar *line, PRBool preserveIntegrity, PRUnichar **_retval NS_OUTPARAM) = 0;

  /* wstring reformatUnquotedAddresses (in wstring line); */
  NS_SCRIPTABLE NS_IMETHOD ReformatUnquotedAddresses(const PRUnichar *line, PRUnichar **_retval NS_OUTPARAM) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIMsgHeaderParser, NS_IMSGHEADERPARSER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIMSGHEADERPARSER \
  NS_SCRIPTABLE NS_IMETHOD ParseHeadersWithArray(const PRUnichar *aLine, PRUnichar ***aEmailAddresses NS_OUTPARAM, PRUnichar ***aNames NS_OUTPARAM, PRUnichar ***aFullNames NS_OUTPARAM, PRUint32 *count NS_OUTPARAM); \
  NS_IMETHOD ParseHeaderAddresses(const char *aLine, char **aNames NS_OUTPARAM, char **aAddresses NS_OUTPARAM, PRUint32 *aNumAddresses NS_OUTPARAM); \
  NS_SCRIPTABLE NS_IMETHOD ExtractHeaderAddressMailboxes(const nsACString & aLine, nsACString & _retval NS_OUTPARAM); \
  NS_SCRIPTABLE NS_IMETHOD ExtractHeaderAddressNames(const nsACString & aLine, nsACString & _retval NS_OUTPARAM); \
  NS_SCRIPTABLE NS_IMETHOD ExtractHeaderAddressName(const nsACString & aLine, nsACString & _retval NS_OUTPARAM); \
  NS_IMETHOD ReformatHeaderAddresses(const char *aLine, char **_retval NS_OUTPARAM); \
  NS_SCRIPTABLE NS_IMETHOD RemoveDuplicateAddresses(const nsACString & aAddrs, const nsACString & aOtherAddrs, nsACString & _retval NS_OUTPARAM); \
  NS_SCRIPTABLE NS_IMETHOD MakeFullAddress(const nsAString & aName, const nsAString & aAddress, nsAString & _retval NS_OUTPARAM); \
  NS_IMETHOD MakeFullAddressString(const char *aName, const char *aAddress, char **_retval NS_OUTPARAM); \
  NS_IMETHOD UnquotePhraseOrAddr(const char *line, PRBool preserveIntegrity, char **_retval NS_OUTPARAM); \
  NS_SCRIPTABLE NS_IMETHOD UnquotePhraseOrAddrWString(const PRUnichar *line, PRBool preserveIntegrity, PRUnichar **_retval NS_OUTPARAM); \
  NS_SCRIPTABLE NS_IMETHOD ReformatUnquotedAddresses(const PRUnichar *line, PRUnichar **_retval NS_OUTPARAM); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIMSGHEADERPARSER(_to) \
  NS_SCRIPTABLE NS_IMETHOD ParseHeadersWithArray(const PRUnichar *aLine, PRUnichar ***aEmailAddresses NS_OUTPARAM, PRUnichar ***aNames NS_OUTPARAM, PRUnichar ***aFullNames NS_OUTPARAM, PRUint32 *count NS_OUTPARAM) { return _to ParseHeadersWithArray(aLine, aEmailAddresses, aNames, aFullNames, count); } \
  NS_IMETHOD ParseHeaderAddresses(const char *aLine, char **aNames NS_OUTPARAM, char **aAddresses NS_OUTPARAM, PRUint32 *aNumAddresses NS_OUTPARAM) { return _to ParseHeaderAddresses(aLine, aNames, aAddresses, aNumAddresses); } \
  NS_SCRIPTABLE NS_IMETHOD ExtractHeaderAddressMailboxes(const nsACString & aLine, nsACString & _retval NS_OUTPARAM) { return _to ExtractHeaderAddressMailboxes(aLine, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD ExtractHeaderAddressNames(const nsACString & aLine, nsACString & _retval NS_OUTPARAM) { return _to ExtractHeaderAddressNames(aLine, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD ExtractHeaderAddressName(const nsACString & aLine, nsACString & _retval NS_OUTPARAM) { return _to ExtractHeaderAddressName(aLine, _retval); } \
  NS_IMETHOD ReformatHeaderAddresses(const char *aLine, char **_retval NS_OUTPARAM) { return _to ReformatHeaderAddresses(aLine, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD RemoveDuplicateAddresses(const nsACString & aAddrs, const nsACString & aOtherAddrs, nsACString & _retval NS_OUTPARAM) { return _to RemoveDuplicateAddresses(aAddrs, aOtherAddrs, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD MakeFullAddress(const nsAString & aName, const nsAString & aAddress, nsAString & _retval NS_OUTPARAM) { return _to MakeFullAddress(aName, aAddress, _retval); } \
  NS_IMETHOD MakeFullAddressString(const char *aName, const char *aAddress, char **_retval NS_OUTPARAM) { return _to MakeFullAddressString(aName, aAddress, _retval); } \
  NS_IMETHOD UnquotePhraseOrAddr(const char *line, PRBool preserveIntegrity, char **_retval NS_OUTPARAM) { return _to UnquotePhraseOrAddr(line, preserveIntegrity, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD UnquotePhraseOrAddrWString(const PRUnichar *line, PRBool preserveIntegrity, PRUnichar **_retval NS_OUTPARAM) { return _to UnquotePhraseOrAddrWString(line, preserveIntegrity, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD ReformatUnquotedAddresses(const PRUnichar *line, PRUnichar **_retval NS_OUTPARAM) { return _to ReformatUnquotedAddresses(line, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIMSGHEADERPARSER(_to) \
  NS_SCRIPTABLE NS_IMETHOD ParseHeadersWithArray(const PRUnichar *aLine, PRUnichar ***aEmailAddresses NS_OUTPARAM, PRUnichar ***aNames NS_OUTPARAM, PRUnichar ***aFullNames NS_OUTPARAM, PRUint32 *count NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseHeadersWithArray(aLine, aEmailAddresses, aNames, aFullNames, count); } \
  NS_IMETHOD ParseHeaderAddresses(const char *aLine, char **aNames NS_OUTPARAM, char **aAddresses NS_OUTPARAM, PRUint32 *aNumAddresses NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseHeaderAddresses(aLine, aNames, aAddresses, aNumAddresses); } \
  NS_SCRIPTABLE NS_IMETHOD ExtractHeaderAddressMailboxes(const nsACString & aLine, nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ExtractHeaderAddressMailboxes(aLine, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD ExtractHeaderAddressNames(const nsACString & aLine, nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ExtractHeaderAddressNames(aLine, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD ExtractHeaderAddressName(const nsACString & aLine, nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ExtractHeaderAddressName(aLine, _retval); } \
  NS_IMETHOD ReformatHeaderAddresses(const char *aLine, char **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReformatHeaderAddresses(aLine, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD RemoveDuplicateAddresses(const nsACString & aAddrs, const nsACString & aOtherAddrs, nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveDuplicateAddresses(aAddrs, aOtherAddrs, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD MakeFullAddress(const nsAString & aName, const nsAString & aAddress, nsAString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->MakeFullAddress(aName, aAddress, _retval); } \
  NS_IMETHOD MakeFullAddressString(const char *aName, const char *aAddress, char **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->MakeFullAddressString(aName, aAddress, _retval); } \
  NS_IMETHOD UnquotePhraseOrAddr(const char *line, PRBool preserveIntegrity, char **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnquotePhraseOrAddr(line, preserveIntegrity, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD UnquotePhraseOrAddrWString(const PRUnichar *line, PRBool preserveIntegrity, PRUnichar **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnquotePhraseOrAddrWString(line, preserveIntegrity, _retval); } \
  NS_SCRIPTABLE NS_IMETHOD ReformatUnquotedAddresses(const PRUnichar *line, PRUnichar **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReformatUnquotedAddresses(line, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsMsgHeaderParser : public nsIMsgHeaderParser
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIMSGHEADERPARSER

  nsMsgHeaderParser();

private:
  ~nsMsgHeaderParser();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsMsgHeaderParser, nsIMsgHeaderParser)

nsMsgHeaderParser::nsMsgHeaderParser()
{
  /* member initializers and constructor code */
}

nsMsgHeaderParser::~nsMsgHeaderParser()
{
  /* destructor code */
}

/* void parseHeadersWithArray (in wstring aLine, [array, size_is (count)] out wstring aEmailAddresses, [array, size_is (count)] out wstring aNames, [array, size_is (count)] out wstring aFullNames, [retval] out unsigned long count); */
NS_IMETHODIMP nsMsgHeaderParser::ParseHeadersWithArray(const PRUnichar *aLine, PRUnichar ***aEmailAddresses NS_OUTPARAM, PRUnichar ***aNames NS_OUTPARAM, PRUnichar ***aFullNames NS_OUTPARAM, PRUint32 *count NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void parseHeaderAddresses (in string aLine, out string aNames, out string aAddresses, out PRUint32 aNumAddresses); */
NS_IMETHODIMP nsMsgHeaderParser::ParseHeaderAddresses(const char *aLine, char **aNames NS_OUTPARAM, char **aAddresses NS_OUTPARAM, PRUint32 *aNumAddresses NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* ACString extractHeaderAddressMailboxes (in ACString aLine); */
NS_IMETHODIMP nsMsgHeaderParser::ExtractHeaderAddressMailboxes(const nsACString & aLine, nsACString & _retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AUTF8String extractHeaderAddressNames (in AUTF8String aLine); */
NS_IMETHODIMP nsMsgHeaderParser::ExtractHeaderAddressNames(const nsACString & aLine, nsACString & _retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AUTF8String extractHeaderAddressName (in AUTF8String aLine); */
NS_IMETHODIMP nsMsgHeaderParser::ExtractHeaderAddressName(const nsACString & aLine, nsACString & _retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] string reformatHeaderAddresses (in string aLine); */
NS_IMETHODIMP nsMsgHeaderParser::ReformatHeaderAddresses(const char *aLine, char **_retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AUTF8String removeDuplicateAddresses (in AUTF8String aAddrs, in AUTF8String aOtherAddrs); */
NS_IMETHODIMP nsMsgHeaderParser::RemoveDuplicateAddresses(const nsACString & aAddrs, const nsACString & aOtherAddrs, nsACString & _retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AString makeFullAddress (in AString aName, in AString aAddress); */
NS_IMETHODIMP nsMsgHeaderParser::MakeFullAddress(const nsAString & aName, const nsAString & aAddress, nsAString & _retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] string makeFullAddressString (in string aName, in string aAddress); */
NS_IMETHODIMP nsMsgHeaderParser::MakeFullAddressString(const char *aName, const char *aAddress, char **_retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] string unquotePhraseOrAddr (in string line, in boolean preserveIntegrity); */
NS_IMETHODIMP nsMsgHeaderParser::UnquotePhraseOrAddr(const char *line, PRBool preserveIntegrity, char **_retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* wstring unquotePhraseOrAddrWString (in wstring line, in boolean preserveIntegrity); */
NS_IMETHODIMP nsMsgHeaderParser::UnquotePhraseOrAddrWString(const PRUnichar *line, PRBool preserveIntegrity, PRUnichar **_retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* wstring reformatUnquotedAddresses (in wstring line); */
NS_IMETHODIMP nsMsgHeaderParser::ReformatUnquotedAddresses(const PRUnichar *line, PRUnichar **_retval NS_OUTPARAM)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


#endif /* __gen_nsIMsgHeaderParser_h__ */
