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

#ifndef __gen_msgIStructuredHeaders_h__
#define __gen_msgIStructuredHeaders_h__


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

#include "js/Value.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
#include "nsCOMArray.h"
#define NS_ISTRUCTUREDHEADERS_CONTRACTID \
  "@mozilla.org/messenger/structuredheaders;1"
class msgIAddressObject; /* forward declaration */

class nsIUTF8StringEnumerator; /* forward declaration */


/* starting interface:    msgIStructuredHeaders */
#define MSGISTRUCTUREDHEADERS_IID_STR "e109bf4f-788f-47ba-bfa8-1236ede05597"

#define MSGISTRUCTUREDHEADERS_IID \
  {0xe109bf4f, 0x788f, 0x47ba, \
    { 0xbf, 0xa8, 0x12, 0x36, 0xed, 0xe0, 0x55, 0x97 }}

class msgIStructuredHeaders : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(MSGISTRUCTUREDHEADERS_IID)

  /* jsval getHeader (in string aHeaderName); */
  NS_IMETHOD GetHeader(const char * aHeaderName, JS::MutableHandleValue _retval) = 0;

  /* bool hasHeader (in string aHeaderName); */
  NS_IMETHOD HasHeader(const char * aHeaderName, bool *_retval) = 0;

  /* AString getUnstructuredHeader (in string aHeaderName); */
  NS_IMETHOD GetUnstructuredHeader(const char * aHeaderName, nsAString & _retval) = 0;

  /* void getAddressingHeader (in string aHeaderName, [optional] in boolean aPreserveGroups, [optional] out unsigned long count, [array, size_is (count), retval] out msgIAddressObject addresses); */
  NS_IMETHOD GetAddressingHeader(const char * aHeaderName, bool aPreserveGroups, uint32_t *count, msgIAddressObject * **addresses) = 0;

  /* AUTF8String getRawHeader (in string aHeaderName); */
  NS_IMETHOD GetRawHeader(const char * aHeaderName, nsACString & _retval) = 0;

  /* readonly attribute nsIUTF8StringEnumerator headerNames; */
  NS_IMETHOD GetHeaderNames(nsIUTF8StringEnumerator * *aHeaderNames) = 0;

  /* AUTF8String buildMimeText (); */
  NS_IMETHOD BuildMimeText(nsACString & _retval) = 0;

   /**
   * A special variant of getAddressingHeader that is specialized better for C++
   * users of this API.
   */
  nsresult GetAddressingHeader(const char *aPropertyName,
                               nsCOMArray<msgIAddressObject> &addrs,
                               bool aPreserveGroups = false)
  {
    msgIAddressObject **addrPtr;
    uint32_t length;
    nsresult rv = GetAddressingHeader(aPropertyName, aPreserveGroups, &length,
      &addrPtr);
    NS_ENSURE_SUCCESS(rv, rv);
    addrs.Adopt(addrPtr, length);
    return NS_OK;
  }
};

  NS_DEFINE_STATIC_IID_ACCESSOR(msgIStructuredHeaders, MSGISTRUCTUREDHEADERS_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_MSGISTRUCTUREDHEADERS \
  NS_IMETHOD GetHeader(const char * aHeaderName, JS::MutableHandleValue _retval) override; \
  NS_IMETHOD HasHeader(const char * aHeaderName, bool *_retval) override; \
  NS_IMETHOD GetUnstructuredHeader(const char * aHeaderName, nsAString & _retval) override; \
  NS_IMETHOD GetAddressingHeader(const char * aHeaderName, bool aPreserveGroups, uint32_t *count, msgIAddressObject * **addresses) override; \
  NS_IMETHOD GetRawHeader(const char * aHeaderName, nsACString & _retval) override; \
  NS_IMETHOD GetHeaderNames(nsIUTF8StringEnumerator * *aHeaderNames) override; \
  NS_IMETHOD BuildMimeText(nsACString & _retval) override; \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_MSGISTRUCTUREDHEADERS(_to) \
  NS_IMETHOD GetHeader(const char * aHeaderName, JS::MutableHandleValue _retval) override { return _to GetHeader(aHeaderName, _retval); } \
  NS_IMETHOD HasHeader(const char * aHeaderName, bool *_retval) override { return _to HasHeader(aHeaderName, _retval); } \
  NS_IMETHOD GetUnstructuredHeader(const char * aHeaderName, nsAString & _retval) override { return _to GetUnstructuredHeader(aHeaderName, _retval); } \
  NS_IMETHOD GetAddressingHeader(const char * aHeaderName, bool aPreserveGroups, uint32_t *count, msgIAddressObject * **addresses) override { return _to GetAddressingHeader(aHeaderName, aPreserveGroups, count, addresses); } \
  NS_IMETHOD GetRawHeader(const char * aHeaderName, nsACString & _retval) override { return _to GetRawHeader(aHeaderName, _retval); } \
  NS_IMETHOD GetHeaderNames(nsIUTF8StringEnumerator * *aHeaderNames) override { return _to GetHeaderNames(aHeaderNames); } \
  NS_IMETHOD BuildMimeText(nsACString & _retval) override { return _to BuildMimeText(_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_MSGISTRUCTUREDHEADERS(_to) \
  NS_IMETHOD GetHeader(const char * aHeaderName, JS::MutableHandleValue _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHeader(aHeaderName, _retval); } \
  NS_IMETHOD HasHeader(const char * aHeaderName, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->HasHeader(aHeaderName, _retval); } \
  NS_IMETHOD GetUnstructuredHeader(const char * aHeaderName, nsAString & _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUnstructuredHeader(aHeaderName, _retval); } \
  NS_IMETHOD GetAddressingHeader(const char * aHeaderName, bool aPreserveGroups, uint32_t *count, msgIAddressObject * **addresses) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAddressingHeader(aHeaderName, aPreserveGroups, count, addresses); } \
  NS_IMETHOD GetRawHeader(const char * aHeaderName, nsACString & _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRawHeader(aHeaderName, _retval); } \
  NS_IMETHOD GetHeaderNames(nsIUTF8StringEnumerator * *aHeaderNames) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHeaderNames(aHeaderNames); } \
  NS_IMETHOD BuildMimeText(nsACString & _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->BuildMimeText(_retval); } \

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

/* Header file */
class _MYCLASS_ : public msgIStructuredHeaders
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_MSGISTRUCTUREDHEADERS

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(_MYCLASS_, msgIStructuredHeaders)

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

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

/* jsval getHeader (in string aHeaderName); */
NS_IMETHODIMP _MYCLASS_::GetHeader(const char * aHeaderName, JS::MutableHandleValue _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* bool hasHeader (in string aHeaderName); */
NS_IMETHODIMP _MYCLASS_::HasHeader(const char * aHeaderName, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AString getUnstructuredHeader (in string aHeaderName); */
NS_IMETHODIMP _MYCLASS_::GetUnstructuredHeader(const char * aHeaderName, nsAString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getAddressingHeader (in string aHeaderName, [optional] in boolean aPreserveGroups, [optional] out unsigned long count, [array, size_is (count), retval] out msgIAddressObject addresses); */
NS_IMETHODIMP _MYCLASS_::GetAddressingHeader(const char * aHeaderName, bool aPreserveGroups, uint32_t *count, msgIAddressObject * **addresses)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AUTF8String getRawHeader (in string aHeaderName); */
NS_IMETHODIMP _MYCLASS_::GetRawHeader(const char * aHeaderName, nsACString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsIUTF8StringEnumerator headerNames; */
NS_IMETHODIMP _MYCLASS_::GetHeaderNames(nsIUTF8StringEnumerator * *aHeaderNames)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AUTF8String buildMimeText (); */
NS_IMETHODIMP _MYCLASS_::BuildMimeText(nsACString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


/* starting interface:    msgIWritableStructuredHeaders */
#define MSGIWRITABLESTRUCTUREDHEADERS_IID_STR "5dcbbef6-2356-45d8-86d7-b3e73f9c9a0c"

#define MSGIWRITABLESTRUCTUREDHEADERS_IID \
  {0x5dcbbef6, 0x2356, 0x45d8, \
    { 0x86, 0xd7, 0xb3, 0xe7, 0x3f, 0x9c, 0x9a, 0x0c }}

class msgIWritableStructuredHeaders : public msgIStructuredHeaders {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(MSGIWRITABLESTRUCTUREDHEADERS_IID)

  /* void setHeader (in string aHeaderName, in jsval aValue); */
  NS_IMETHOD SetHeader(const char * aHeaderName, JS::HandleValue aValue) = 0;

  /* void deleteHeader (in string aHeaderName); */
  NS_IMETHOD DeleteHeader(const char * aHeaderName) = 0;

  /* void addAllHeaders (in msgIStructuredHeaders aOtherHeaders); */
  NS_IMETHOD AddAllHeaders(msgIStructuredHeaders *aOtherHeaders) = 0;

  /* void setUnstructuredHeader (in string aHeaderName, in AString aValue); */
  NS_IMETHOD SetUnstructuredHeader(const char * aHeaderName, const nsAString & aValue) = 0;

  /* void setAddressingHeader (in string aHeaderName, [array, size_is (aCount)] in msgIAddressObject aAddresses, in unsigned long aCount); */
  NS_IMETHOD SetAddressingHeader(const char * aHeaderName, msgIAddressObject **aAddresses, uint32_t aCount) = 0;

  /* void setRawHeader (in string aHeaderName, in ACString aValue, in string aCharset); */
  NS_IMETHOD SetRawHeader(const char * aHeaderName, const nsACString & aValue, const char * aCharset) = 0;

   /**
   * A special variant of setAddressingHeader that is specialized better for C++
   * users of this API.
   */
  nsresult SetAddressingHeader(const char *aPropertyName,
                               const nsCOMArray<msgIAddressObject> &addrs)
  {
    return SetAddressingHeader(aPropertyName,
      const_cast<nsCOMArray<msgIAddressObject>&>(addrs).Elements(),
      addrs.Length());
  }
};

  NS_DEFINE_STATIC_IID_ACCESSOR(msgIWritableStructuredHeaders, MSGIWRITABLESTRUCTUREDHEADERS_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_MSGIWRITABLESTRUCTUREDHEADERS \
  NS_IMETHOD SetHeader(const char * aHeaderName, JS::HandleValue aValue) override; \
  NS_IMETHOD DeleteHeader(const char * aHeaderName) override; \
  NS_IMETHOD AddAllHeaders(msgIStructuredHeaders *aOtherHeaders) override; \
  NS_IMETHOD SetUnstructuredHeader(const char * aHeaderName, const nsAString & aValue) override; \
  NS_IMETHOD SetAddressingHeader(const char * aHeaderName, msgIAddressObject **aAddresses, uint32_t aCount) override; \
  NS_IMETHOD SetRawHeader(const char * aHeaderName, const nsACString & aValue, const char * aCharset) override; \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_MSGIWRITABLESTRUCTUREDHEADERS(_to) \
  NS_IMETHOD SetHeader(const char * aHeaderName, JS::HandleValue aValue) override { return _to SetHeader(aHeaderName, aValue); } \
  NS_IMETHOD DeleteHeader(const char * aHeaderName) override { return _to DeleteHeader(aHeaderName); } \
  NS_IMETHOD AddAllHeaders(msgIStructuredHeaders *aOtherHeaders) override { return _to AddAllHeaders(aOtherHeaders); } \
  NS_IMETHOD SetUnstructuredHeader(const char * aHeaderName, const nsAString & aValue) override { return _to SetUnstructuredHeader(aHeaderName, aValue); } \
  NS_IMETHOD SetAddressingHeader(const char * aHeaderName, msgIAddressObject **aAddresses, uint32_t aCount) override { return _to SetAddressingHeader(aHeaderName, aAddresses, aCount); } \
  NS_IMETHOD SetRawHeader(const char * aHeaderName, const nsACString & aValue, const char * aCharset) override { return _to SetRawHeader(aHeaderName, aValue, aCharset); } \

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_MSGIWRITABLESTRUCTUREDHEADERS(_to) \
  NS_IMETHOD SetHeader(const char * aHeaderName, JS::HandleValue aValue) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetHeader(aHeaderName, aValue); } \
  NS_IMETHOD DeleteHeader(const char * aHeaderName) override { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteHeader(aHeaderName); } \
  NS_IMETHOD AddAllHeaders(msgIStructuredHeaders *aOtherHeaders) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AddAllHeaders(aOtherHeaders); } \
  NS_IMETHOD SetUnstructuredHeader(const char * aHeaderName, const nsAString & aValue) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetUnstructuredHeader(aHeaderName, aValue); } \
  NS_IMETHOD SetAddressingHeader(const char * aHeaderName, msgIAddressObject **aAddresses, uint32_t aCount) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAddressingHeader(aHeaderName, aAddresses, aCount); } \
  NS_IMETHOD SetRawHeader(const char * aHeaderName, const nsACString & aValue, const char * aCharset) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRawHeader(aHeaderName, aValue, aCharset); } \

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

/* Header file */
class _MYCLASS_ : public msgIWritableStructuredHeaders
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_MSGIWRITABLESTRUCTUREDHEADERS

  _MYCLASS_();

private:
  ~_MYCLASS_();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(_MYCLASS_, msgIWritableStructuredHeaders)

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

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

/* void setHeader (in string aHeaderName, in jsval aValue); */
NS_IMETHODIMP _MYCLASS_::SetHeader(const char * aHeaderName, JS::HandleValue aValue)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void deleteHeader (in string aHeaderName); */
NS_IMETHODIMP _MYCLASS_::DeleteHeader(const char * aHeaderName)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void addAllHeaders (in msgIStructuredHeaders aOtherHeaders); */
NS_IMETHODIMP _MYCLASS_::AddAllHeaders(msgIStructuredHeaders *aOtherHeaders)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setUnstructuredHeader (in string aHeaderName, in AString aValue); */
NS_IMETHODIMP _MYCLASS_::SetUnstructuredHeader(const char * aHeaderName, const nsAString & aValue)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setAddressingHeader (in string aHeaderName, [array, size_is (aCount)] in msgIAddressObject aAddresses, in unsigned long aCount); */
NS_IMETHODIMP _MYCLASS_::SetAddressingHeader(const char * aHeaderName, msgIAddressObject **aAddresses, uint32_t aCount)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setRawHeader (in string aHeaderName, in ACString aValue, in string aCharset); */
NS_IMETHODIMP _MYCLASS_::SetRawHeader(const char * aHeaderName, const nsACString & aValue, const char * aCharset)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_msgIStructuredHeaders_h__ */
