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

#include "sipAPIKConfigCore.h"

#include <kconfigbase.h>

#include <qbytearray.h>
#include <kconfigbase.h>
#include <kconfiggroup.h>
#include <qstring.h>
#include <qstringlist.h>


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

    {
        const  ::KConfigBase *sipCpp;

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

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_KConfigBase, sipName_groupList);
                return NULL;
            }

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

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

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

    return NULL;
}


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

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

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_KConfigBase, &sipCpp, sipType_QString,&a0, &a0State))
        {
            bool sipRes;

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

            return PyBool_FromLong(sipRes);
        }
    }

    {
        const char* a0;
        const  ::KConfigBase *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bs", &sipSelf, sipType_KConfigBase, &sipCpp, &a0))
        {
            bool sipRes;

            sipRes = sipCpp->hasGroup(a0);

            return PyBool_FromLong(sipRes);
        }
    }

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

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_KConfigBase, &sipCpp, sipType_QByteArray, &a0, &a0State))
        {
            bool sipRes;

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

            return PyBool_FromLong(sipRes);
        }
    }

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

    return NULL;
}


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

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

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

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

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

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

    return NULL;
}


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

    {
        const  ::QByteArray* a0;
        int a0State = 0;
         ::KConfigBase::WriteConfigFlags a1def = KConfigBase::Normal;
         ::KConfigBase::WriteConfigFlags* a1 = &a1def;
        int a1State = 0;
         ::KConfigBase *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1|J1", &sipSelf, sipType_KConfigBase, &sipCpp, sipType_QByteArray, &a0, &a0State, sipType_KConfigBase_WriteConfigFlags, &a1, &a1State))
        {
            sipCpp->deleteGroup(*a0,*a1);
            sipReleaseType(const_cast< ::QByteArray *>(a0),sipType_QByteArray,a0State);
            sipReleaseType(a1,sipType_KConfigBase_WriteConfigFlags,a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        const  ::QString* a0;
        int a0State = 0;
         ::KConfigBase::WriteConfigFlags a1def = KConfigBase::Normal;
         ::KConfigBase::WriteConfigFlags* a1 = &a1def;
        int a1State = 0;
         ::KConfigBase *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1|J1", &sipSelf, sipType_KConfigBase, &sipCpp, sipType_QString,&a0, &a0State, sipType_KConfigBase_WriteConfigFlags, &a1, &a1State))
        {
            sipCpp->deleteGroup(*a0,*a1);
            sipReleaseType(const_cast< ::QString *>(a0),sipType_QString,a0State);
            sipReleaseType(a1,sipType_KConfigBase_WriteConfigFlags,a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        const char* a0;
         ::KConfigBase::WriteConfigFlags a1def = KConfigBase::Normal;
         ::KConfigBase::WriteConfigFlags* a1 = &a1def;
        int a1State = 0;
         ::KConfigBase *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bs|J1", &sipSelf, sipType_KConfigBase, &sipCpp, &a0, sipType_KConfigBase_WriteConfigFlags, &a1, &a1State))
        {
            sipCpp->deleteGroup(a0,*a1);
            sipReleaseType(a1,sipType_KConfigBase_WriteConfigFlags,a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return NULL;
}


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

    {
         ::KConfigBase *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_KConfigBase, &sipCpp))
        {
            bool sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_KConfigBase, sipName_sync);
                return NULL;
            }

            sipRes = sipCpp->sync();

            return PyBool_FromLong(sipRes);
        }
    }

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

    return NULL;
}


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

    {
         ::KConfigBase *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_KConfigBase, &sipCpp))
        {
            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_KConfigBase, sipName_markAsClean);
                return NULL;
            }

            sipCpp->markAsClean();

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return NULL;
}


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

    {
        const  ::KConfigBase *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_KConfigBase, &sipCpp))
        {
             ::KConfigBase::AccessMode sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_KConfigBase, sipName_accessMode);
                return NULL;
            }

            sipRes = sipCpp->accessMode();

            return sipConvertFromEnum(sipRes,sipType_KConfigBase_AccessMode);
        }
    }

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

    return NULL;
}


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

    {
        const  ::KConfigBase *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_KConfigBase, &sipCpp))
        {
            bool sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_KConfigBase, sipName_isImmutable);
                return NULL;
            }

            sipRes = sipCpp->isImmutable();

            return PyBool_FromLong(sipRes);
        }
    }

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

    return NULL;
}


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

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

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_KConfigBase, &sipCpp, sipType_QByteArray, &a0, &a0State))
        {
            bool sipRes;

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

            return PyBool_FromLong(sipRes);
        }
    }

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

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_KConfigBase, &sipCpp, sipType_QString,&a0, &a0State))
        {
            bool sipRes;

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

            return PyBool_FromLong(sipRes);
        }
    }

    {
        const char* a0;
        const  ::KConfigBase *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bs", &sipSelf, sipType_KConfigBase, &sipCpp, &a0))
        {
            bool sipRes;

            sipRes = sipCpp->isGroupImmutable(a0);

            return PyBool_FromLong(sipRes);
        }
    }

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

    return NULL;
}


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


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


static PyMethodDef methods_KConfigBase[] = {
    {SIP_MLNAME_CAST(sipName_accessMode), meth_KConfigBase_accessMode, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_deleteGroup), meth_KConfigBase_deleteGroup, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_group), meth_KConfigBase_group, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_groupList), meth_KConfigBase_groupList, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_hasGroup), meth_KConfigBase_hasGroup, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_isGroupImmutable), meth_KConfigBase_isGroupImmutable, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_isImmutable), meth_KConfigBase_isImmutable, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_markAsClean), meth_KConfigBase_markAsClean, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_sync), meth_KConfigBase_sync, METH_VARARGS, NULL}
};

static sipEnumMemberDef enummembers_KConfigBase[] = {
    {sipName_Global, static_cast<int>( ::KConfigBase::Global), 7},
    {sipName_Localized, static_cast<int>( ::KConfigBase::Localized), 7},
    {sipName_NoAccess, static_cast<int>( ::KConfigBase::NoAccess), 6},
    {sipName_Normal, static_cast<int>( ::KConfigBase::Normal), 7},
    {sipName_Persistent, static_cast<int>( ::KConfigBase::Persistent), 7},
    {sipName_ReadOnly, static_cast<int>( ::KConfigBase::ReadOnly), 6},
    {sipName_ReadWrite, static_cast<int>( ::KConfigBase::ReadWrite), 6},
};


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


sipClassTypeDef sipTypeDef_KConfigCore_KConfigBase = {
    {
        -1,
        0,
        0,
        SIP_TYPE_ABSTRACT|SIP_TYPE_SUPER_INIT|SIP_TYPE_CLASS,
        sipNameNr_KConfigBase,
        {0},
        &plugin_KConfigBase
    },
    {
        sipNameNr_KConfigBase,
        {0, 0, 1},
        9, methods_KConfigBase,
        7, enummembers_KConfigBase,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    },
    0,
    -1,
    -1,
    0,
    0,
    0,
    0,
    0,
#if PY_MAJOR_VERSION >= 3
    0,
    0,
#else
    0,
    0,
    0,
    0,
#endif
    dealloc_KConfigBase,
    0,
    0,
    0,
    release_KConfigBase,
    0,
    0,
    0,
    0,
    0,
    0,
    0
};
