/*
 * Interface wrapper code.
 *
 * Generated by SIP 4.19.6
 */

#include "sipAPIKCodecs.h"

#include <kcharsets.h>

#include <qstring.h>
#include <qlist.h>
#include <qstringlist.h>
#include <qchar.h>
#include <qtextcodec.h>


class sipKCharsets : public  ::KCharsets
{
public:
    sipKCharsets();
    ~sipKCharsets();

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipKCharsets(const sipKCharsets &);
    sipKCharsets &operator = (const sipKCharsets &);
};

sipKCharsets::sipKCharsets():  ::KCharsets(), sipPySelf(0)
{
}

sipKCharsets::~sipKCharsets()
{
    sipInstanceDestroyed(sipPySelf);
}


extern "C" {static PyObject *meth_KCharsets_codecForName(PyObject *, PyObject *);}
static PyObject *meth_KCharsets_codecForName(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QString* a0;
        int a0State = 0;
        const  ::KCharsets *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_KCharsets, &sipCpp, sipType_QString,&a0, &a0State))
        {
             ::QTextCodec*sipRes;

            sipRes = sipCpp->codecForName(*a0);
            sipReleaseType(const_cast< ::QString *>(a0),sipType_QString,a0State);

            return sipConvertFromType(sipRes,sipType_QTextCodec,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KCharsets, sipName_codecForName, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KCharsets_charsets(PyObject *, PyObject *);}
static PyObject *meth_KCharsets_charsets(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        if (sipParseArgs(&sipParseErr, sipArgs, ""))
        {
             ::KCharsets*sipRes;

            sipRes =  ::KCharsets::charsets();

            return sipConvertFromType(sipRes,sipType_KCharsets,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KCharsets, sipName_charsets, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KCharsets_fromEntity(PyObject *, PyObject *);}
static PyObject *meth_KCharsets_fromEntity(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QString* a0;
        int a0State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1", sipType_QString,&a0, &a0State))
        {
             ::QChar*sipRes;

            sipRes = new  ::QChar( ::KCharsets::fromEntity(*a0));
            sipReleaseType(const_cast< ::QString *>(a0),sipType_QString,a0State);

            return sipConvertFromNewType(sipRes,sipType_QChar,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KCharsets, sipName_fromEntity, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KCharsets_toEntity(PyObject *, PyObject *);}
static PyObject *meth_KCharsets_toEntity(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QChar* a0;
        int a0State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1", sipType_QChar,&a0, &a0State))
        {
             ::QString*sipRes;

            sipRes = new  ::QString( ::KCharsets::toEntity(*a0));
            sipReleaseType(const_cast< ::QChar *>(a0),sipType_QChar,a0State);

            return sipConvertFromNewType(sipRes,sipType_QString,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KCharsets, sipName_toEntity, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KCharsets_resolveEntities(PyObject *, PyObject *);}
static PyObject *meth_KCharsets_resolveEntities(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QString* a0;
        int a0State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J1", sipType_QString,&a0, &a0State))
        {
             ::QString*sipRes;

            sipRes = new  ::QString( ::KCharsets::resolveEntities(*a0));
            sipReleaseType(const_cast< ::QString *>(a0),sipType_QString,a0State);

            return sipConvertFromNewType(sipRes,sipType_QString,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KCharsets, sipName_resolveEntities, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KCharsets_availableEncodingNames(PyObject *, PyObject *);}
static PyObject *meth_KCharsets_availableEncodingNames(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::KCharsets *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_KCharsets, &sipCpp))
        {
             ::QStringList*sipRes;

            sipRes = new  ::QStringList(sipCpp->availableEncodingNames());

            return sipConvertFromNewType(sipRes,sipType_QStringList,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KCharsets, sipName_availableEncodingNames, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KCharsets_descriptiveEncodingNames(PyObject *, PyObject *);}
static PyObject *meth_KCharsets_descriptiveEncodingNames(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::KCharsets *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_KCharsets, &sipCpp))
        {
             ::QStringList*sipRes;

            sipRes = new  ::QStringList(sipCpp->descriptiveEncodingNames());

            return sipConvertFromNewType(sipRes,sipType_QStringList,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KCharsets, sipName_descriptiveEncodingNames, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KCharsets_encodingsByScript(PyObject *, PyObject *);}
static PyObject *meth_KCharsets_encodingsByScript(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::KCharsets *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_KCharsets, &sipCpp))
        {
            QList< ::QStringList>*sipRes;

            sipRes = new QList< ::QStringList>(sipCpp->encodingsByScript());

            return sipConvertFromNewType(sipRes,sipType_QList_0100QStringList,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KCharsets, sipName_encodingsByScript, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KCharsets_descriptionForEncoding(PyObject *, PyObject *);}
static PyObject *meth_KCharsets_descriptionForEncoding(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QString* a0;
        int a0State = 0;
        const  ::KCharsets *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_KCharsets, &sipCpp, sipType_QString,&a0, &a0State))
        {
             ::QString*sipRes;

            sipRes = new  ::QString(sipCpp->descriptionForEncoding(*a0));
            sipReleaseType(const_cast< ::QString *>(a0),sipType_QString,a0State);

            return sipConvertFromNewType(sipRes,sipType_QString,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KCharsets, sipName_descriptionForEncoding, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KCharsets_encodingForName(PyObject *, PyObject *);}
static PyObject *meth_KCharsets_encodingForName(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        const  ::QString* a0;
        int a0State = 0;
        const  ::KCharsets *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_KCharsets, &sipCpp, sipType_QString,&a0, &a0State))
        {
             ::QString*sipRes;

            sipRes = new  ::QString(sipCpp->encodingForName(*a0));
            sipReleaseType(const_cast< ::QString *>(a0),sipType_QString,a0State);

            return sipConvertFromNewType(sipRes,sipType_QString,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KCharsets, sipName_encodingForName, NULL);

    return NULL;
}


/* Call the instance's destructor. */
extern "C" {static void release_KCharsets(void *, int);}
static void release_KCharsets(void *sipCppV, int sipState)
{
    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipKCharsets *>(sipCppV);
    else
        delete reinterpret_cast< ::KCharsets *>(sipCppV);
}


extern "C" {static void dealloc_KCharsets(sipSimpleWrapper *);}
static void dealloc_KCharsets(sipSimpleWrapper *sipSelf)
{
    if (sipIsDerivedClass(sipSelf))
        reinterpret_cast<sipKCharsets *>(sipGetAddress(sipSelf))->sipPySelf = NULL;

    if (sipIsOwnedByPython(sipSelf))
    {
        release_KCharsets(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
    }
}


extern "C" {static void *init_type_KCharsets(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_KCharsets(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    sipKCharsets *sipCpp = 0;

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, NULL, sipUnused, ""))
        {
            sipCpp = new sipKCharsets();

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return NULL;
}


static PyMethodDef methods_KCharsets[] = {
    {SIP_MLNAME_CAST(sipName_availableEncodingNames), meth_KCharsets_availableEncodingNames, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_charsets), meth_KCharsets_charsets, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_codecForName), meth_KCharsets_codecForName, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_descriptionForEncoding), meth_KCharsets_descriptionForEncoding, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_descriptiveEncodingNames), meth_KCharsets_descriptiveEncodingNames, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_encodingForName), meth_KCharsets_encodingForName, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_encodingsByScript), meth_KCharsets_encodingsByScript, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_fromEntity), meth_KCharsets_fromEntity, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_resolveEntities), meth_KCharsets_resolveEntities, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_toEntity), meth_KCharsets_toEntity, METH_VARARGS, NULL}
};


static pyqt5ClassPluginDef plugin_KCharsets = {
    0,
    0,
    0,
    0
};


sipClassTypeDef sipTypeDef_KCodecs_KCharsets = {
    {
        -1,
        0,
        0,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_CLASS,
        sipNameNr_KCharsets,
        {0},
        &plugin_KCharsets
    },
    {
        sipNameNr_KCharsets,
        {0, 0, 1},
        10, methods_KCharsets,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    },
    0,
    -1,
    -1,
    0,
    0,
    init_type_KCharsets,
    0,
    0,
#if PY_MAJOR_VERSION >= 3
    0,
    0,
#else
    0,
    0,
    0,
    0,
#endif
    dealloc_KCharsets,
    0,
    0,
    0,
    release_KCharsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0
};
