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

#include "sipAPIKCodecs.h"

#include <kencodingprober.h>

#include <qstring.h>
#include <qbytearray.h>


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

    {
         ::KEncodingProber *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_KEncodingProber, &sipCpp))
        {
            sipCpp->reset();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return NULL;
}


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

    {
        const  ::QByteArray* a0;
        int a0State = 0;
         ::KEncodingProber *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_KEncodingProber, &sipCpp, sipType_QByteArray, &a0, &a0State))
        {
             ::KEncodingProber::ProberState sipRes;

            sipRes = sipCpp->feed(*a0);
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_KEncodingProber_ProberState);
        }
    }

    {
        const char* a0;
        int a1;
         ::KEncodingProber *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bsi", &sipSelf, sipType_KEncodingProber, &sipCpp, &a0, &a1))
        {
             ::KEncodingProber::ProberState sipRes;

            sipRes = sipCpp->feed(a0,a1);

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_KEncodingProber_ProberState);
        }
    }

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

    return NULL;
}


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

    {
        const  ::KEncodingProber *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_KEncodingProber, &sipCpp))
        {
             ::KEncodingProber::ProberState sipRes;

            sipRes = sipCpp->state();

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_KEncodingProber_ProberState);
        }
    }

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

    return NULL;
}


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

    {
        const  ::KEncodingProber *sipCpp;

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

            sipRes = new  ::QByteArray(sipCpp->encoding());

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

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

    return NULL;
}


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

    {
        const  ::KEncodingProber *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_KEncodingProber, &sipCpp))
        {
            float sipRes;

            sipRes = sipCpp->confidence();

            return PyFloat_FromDouble((double)sipRes);
        }
    }

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

    return NULL;
}


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

    {
        const  ::KEncodingProber *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_KEncodingProber, &sipCpp))
        {
             ::KEncodingProber::ProberType sipRes;

            sipRes = sipCpp->proberType();

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_KEncodingProber_ProberType);
        }
    }

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

    return NULL;
}


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

    {
         ::KEncodingProber::ProberType a0;
         ::KEncodingProber *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BE", &sipSelf, sipType_KEncodingProber, &sipCpp, sipType_KEncodingProber_ProberType, &a0))
        {
            sipCpp->setProberType(a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return NULL;
}


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

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

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

            sipRes =  ::KEncodingProber::proberTypeForName(*a0);
            sipReleaseType(const_cast< ::QString *>(a0),sipType_QString,a0State);

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_KEncodingProber_ProberType);
        }
    }

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

    return NULL;
}


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

    {
         ::KEncodingProber::ProberType a0;

        if (sipParseArgs(&sipParseErr, sipArgs, "E", sipType_KEncodingProber_ProberType, &a0))
        {
             ::QString*sipRes;

            sipRes = new  ::QString( ::KEncodingProber::nameForProberType(a0));

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

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

    return NULL;
}


/* Call the instance's destructor. */
extern "C" {static void release_KEncodingProber(void *, int);}
static void release_KEncodingProber(void *sipCppV, int)
{
    delete reinterpret_cast< ::KEncodingProber *>(sipCppV);
}


extern "C" {static void dealloc_KEncodingProber(sipSimpleWrapper *);}
static void dealloc_KEncodingProber(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_KEncodingProber(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_KEncodingProber(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_KEncodingProber(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::KEncodingProber *sipCpp = 0;

    {
         ::KEncodingProber::ProberType a0 = KEncodingProber::Universal;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, NULL, sipUnused, "|E", sipType_KEncodingProber_ProberType, &a0))
        {
            sipCpp = new  ::KEncodingProber(a0);

            return sipCpp;
        }
    }

    return NULL;
}


static PyMethodDef methods_KEncodingProber[] = {
    {SIP_MLNAME_CAST(sipName_confidence), meth_KEncodingProber_confidence, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_encoding), meth_KEncodingProber_encoding, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_feed), meth_KEncodingProber_feed, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_nameForProberType), meth_KEncodingProber_nameForProberType, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_proberType), meth_KEncodingProber_proberType, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_proberTypeForName), meth_KEncodingProber_proberTypeForName, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_reset), meth_KEncodingProber_reset, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_setProberType), meth_KEncodingProber_setProberType, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_state), meth_KEncodingProber_state, METH_VARARGS, NULL}
};

static sipEnumMemberDef enummembers_KEncodingProber[] = {
    {sipName_Arabic, static_cast<int>( ::KEncodingProber::Arabic), 11},
    {sipName_Baltic, static_cast<int>( ::KEncodingProber::Baltic), 11},
    {sipName_CentralEuropean, static_cast<int>( ::KEncodingProber::CentralEuropean), 11},
    {sipName_ChineseSimplified, static_cast<int>( ::KEncodingProber::ChineseSimplified), 11},
    {sipName_ChineseTraditional, static_cast<int>( ::KEncodingProber::ChineseTraditional), 11},
    {sipName_Cyrillic, static_cast<int>( ::KEncodingProber::Cyrillic), 11},
    {sipName_FoundIt, static_cast<int>( ::KEncodingProber::FoundIt), 10},
    {sipName_Greek, static_cast<int>( ::KEncodingProber::Greek), 11},
    {sipName_Hebrew, static_cast<int>( ::KEncodingProber::Hebrew), 11},
    {sipName_Japanese, static_cast<int>( ::KEncodingProber::Japanese), 11},
    {sipName_Korean, static_cast<int>( ::KEncodingProber::Korean), 11},
    {sipName_None, static_cast<int>( ::KEncodingProber::None), 11},
    {sipName_NorthernSaami, static_cast<int>( ::KEncodingProber::NorthernSaami), 11},
    {sipName_NotMe, static_cast<int>( ::KEncodingProber::NotMe), 10},
    {sipName_Other, static_cast<int>( ::KEncodingProber::Other), 11},
    {sipName_Probing, static_cast<int>( ::KEncodingProber::Probing), 10},
    {sipName_SouthEasternEurope, static_cast<int>( ::KEncodingProber::SouthEasternEurope), 11},
    {sipName_Thai, static_cast<int>( ::KEncodingProber::Thai), 11},
    {sipName_Turkish, static_cast<int>( ::KEncodingProber::Turkish), 11},
    {sipName_Unicode, static_cast<int>( ::KEncodingProber::Unicode), 11},
    {sipName_Universal, static_cast<int>( ::KEncodingProber::Universal), 11},
    {sipName_WesternEuropean, static_cast<int>( ::KEncodingProber::WesternEuropean), 11},
};


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


sipClassTypeDef sipTypeDef_KCodecs_KEncodingProber = {
    {
        -1,
        0,
        0,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_CLASS,
        sipNameNr_KEncodingProber,
        {0},
        &plugin_KEncodingProber
    },
    {
        sipNameNr_KEncodingProber,
        {0, 0, 1},
        9, methods_KEncodingProber,
        22, enummembers_KEncodingProber,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    },
    0,
    -1,
    -1,
    0,
    0,
    init_type_KEncodingProber,
    0,
    0,
#if PY_MAJOR_VERSION >= 3
    0,
    0,
#else
    0,
    0,
    0,
    0,
#endif
    dealloc_KEncodingProber,
    0,
    0,
    0,
    release_KEncodingProber,
    0,
    0,
    0,
    0,
    0,
    0,
    0
};
