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

#ifndef __gen_nsIScriptableUConv_h__
#define __gen_nsIScriptableUConv_h__


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

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
// {0A698C44-3BFF-11d4-9649-00C0CA135B4E}
#define NS_ISCRIPTABLEUNICODECONVERTER_CID { 0x0A698C44, 0x3BFF, 0x11d4, { 0x96, 0x49, 0x00, 0xC0, 0xCA, 0x13, 0x5B, 0x4E } }
#define NS_ISCRIPTABLEUNICODECONVERTER_CONTRACTID "@mozilla.org/intl/scriptableunicodeconverter"

/* starting interface:    nsIScriptableUnicodeConverter */
#define NS_ISCRIPTABLEUNICODECONVERTER_IID_STR "6a4bd9ef-abbc-47bb-a634-8c944205515a"

#define NS_ISCRIPTABLEUNICODECONVERTER_IID \
  {0x6a4bd9ef, 0xabbc, 0x47bb, \
    { 0xa6, 0x34, 0x8c, 0x94, 0x42, 0x05, 0x51, 0x5a }}

/**
 * This interface is a unicode encoder for use by scripts
 *
 * @created         8/Jun/2000
 * @author          Makoto Kato [m_kato@ga2.so-net.ne.jp]
 */
class NS_NO_VTABLE nsIScriptableUnicodeConverter : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEUNICODECONVERTER_IID)

  /**
   * Converts the data from Unicode to one Charset.
   * Returns the converted string. After converting, Finish should be called
   * and its return value appended to this return value.
   */
  /* string ConvertFromUnicode (in wstring aSrc); */
  NS_IMETHOD ConvertFromUnicode(const PRUnichar *aSrc, char **_retval) = 0;

  /**
   * Returns the terminator string.
   * Should be called after ConvertFromUnicode() and appended to that
   * function's return value.
   */
  /* string Finish (); */
  NS_IMETHOD Finish(char **_retval) = 0;

  /**
   * Converts the data from one Charset to Unicode.
   */
  /* wstring ConvertToUnicode (in string aSrc); */
  NS_IMETHOD ConvertToUnicode(const char *aSrc, PRUnichar **_retval) = 0;

  /**
   * Converts an array of bytes to a unicode string.
   */
  /* wstring convertFromByteArray ([array, size_is (aCount), const] in octet aData, in unsigned long aCount); */
  NS_IMETHOD ConvertFromByteArray(const PRUint8 *aData, PRUint32 aCount, PRUnichar **_retval) = 0;

  /**
   * Convert a unicode string to an array of bytes. Finish does not need to be
   * called.
   */
  /* void convertToByteArray (in wstring aString, out unsigned long aLen, [array, size_is (aLen), retval] out octet aData); */
  NS_IMETHOD ConvertToByteArray(const PRUnichar *aString, PRUint32 *aLen, PRUint8 **aData) = 0;

  /**
   * Current character set.
   *
   * @throw NS_ERROR_UCONV_NOCONV The requested charset is not supported.
   */
  /* attribute string charset; */
  NS_IMETHOD GetCharset(char * *aCharset) = 0;
  NS_IMETHOD SetCharset(const char * aCharset) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISCRIPTABLEUNICODECONVERTER \
  NS_IMETHOD ConvertFromUnicode(const PRUnichar *aSrc, char **_retval); \
  NS_IMETHOD Finish(char **_retval); \
  NS_IMETHOD ConvertToUnicode(const char *aSrc, PRUnichar **_retval); \
  NS_IMETHOD ConvertFromByteArray(const PRUint8 *aData, PRUint32 aCount, PRUnichar **_retval); \
  NS_IMETHOD ConvertToByteArray(const PRUnichar *aString, PRUint32 *aLen, PRUint8 **aData); \
  NS_IMETHOD GetCharset(char * *aCharset); \
  NS_IMETHOD SetCharset(const char * aCharset); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISCRIPTABLEUNICODECONVERTER(_to) \
  NS_IMETHOD ConvertFromUnicode(const PRUnichar *aSrc, char **_retval) { return _to ConvertFromUnicode(aSrc, _retval); } \
  NS_IMETHOD Finish(char **_retval) { return _to Finish(_retval); } \
  NS_IMETHOD ConvertToUnicode(const char *aSrc, PRUnichar **_retval) { return _to ConvertToUnicode(aSrc, _retval); } \
  NS_IMETHOD ConvertFromByteArray(const PRUint8 *aData, PRUint32 aCount, PRUnichar **_retval) { return _to ConvertFromByteArray(aData, aCount, _retval); } \
  NS_IMETHOD ConvertToByteArray(const PRUnichar *aString, PRUint32 *aLen, PRUint8 **aData) { return _to ConvertToByteArray(aString, aLen, aData); } \
  NS_IMETHOD GetCharset(char * *aCharset) { return _to GetCharset(aCharset); } \
  NS_IMETHOD SetCharset(const char * aCharset) { return _to SetCharset(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_NSISCRIPTABLEUNICODECONVERTER(_to) \
  NS_IMETHOD ConvertFromUnicode(const PRUnichar *aSrc, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ConvertFromUnicode(aSrc, _retval); } \
  NS_IMETHOD Finish(char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Finish(_retval); } \
  NS_IMETHOD ConvertToUnicode(const char *aSrc, PRUnichar **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ConvertToUnicode(aSrc, _retval); } \
  NS_IMETHOD ConvertFromByteArray(const PRUint8 *aData, PRUint32 aCount, PRUnichar **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ConvertFromByteArray(aData, aCount, _retval); } \
  NS_IMETHOD ConvertToByteArray(const PRUnichar *aString, PRUint32 *aLen, PRUint8 **aData) { return !_to ? NS_ERROR_NULL_POINTER : _to->ConvertToByteArray(aString, aLen, aData); } \
  NS_IMETHOD GetCharset(char * *aCharset) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCharset(aCharset); } \
  NS_IMETHOD SetCharset(const char * aCharset) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCharset(aCharset); } 

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

/* Header file */
class nsScriptableUnicodeConverter : public nsIScriptableUnicodeConverter
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISCRIPTABLEUNICODECONVERTER

  nsScriptableUnicodeConverter();

private:
  ~nsScriptableUnicodeConverter();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsScriptableUnicodeConverter, nsIScriptableUnicodeConverter)

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

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

/* string ConvertFromUnicode (in wstring aSrc); */
NS_IMETHODIMP nsScriptableUnicodeConverter::ConvertFromUnicode(const PRUnichar *aSrc, char **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* string Finish (); */
NS_IMETHODIMP nsScriptableUnicodeConverter::Finish(char **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* wstring ConvertToUnicode (in string aSrc); */
NS_IMETHODIMP nsScriptableUnicodeConverter::ConvertToUnicode(const char *aSrc, PRUnichar **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* wstring convertFromByteArray ([array, size_is (aCount), const] in octet aData, in unsigned long aCount); */
NS_IMETHODIMP nsScriptableUnicodeConverter::ConvertFromByteArray(const PRUint8 *aData, PRUint32 aCount, PRUnichar **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void convertToByteArray (in wstring aString, out unsigned long aLen, [array, size_is (aLen), retval] out octet aData); */
NS_IMETHODIMP nsScriptableUnicodeConverter::ConvertToByteArray(const PRUnichar *aString, PRUint32 *aLen, PRUint8 **aData)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute string charset; */
NS_IMETHODIMP nsScriptableUnicodeConverter::GetCharset(char * *aCharset)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsScriptableUnicodeConverter::SetCharset(const char * aCharset)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_nsIScriptableUConv_h__ */
