
// Workaround to access protected functions
#ifndef protected
#  define protected public
#endif

// default includes
#include <shiboken.h>
#include <sbkpep.h>
#include <sbkpepbuffer.h>

#define PYSIDE6_COMOPT_COMPRESS 1

#ifndef QT_NO_VERSION_TAGGING
#  define QT_NO_VERSION_TAGGING
#endif
#include <QtCore/QDebug>
#include <pysideqenum.h>
#include <pysideutils.h>
#include <feature_select.h>
QT_WARNING_DISABLE_DEPRECATED


// module include
#include "kcalendarcore_python.h"

// main header
#include "kcalendarcore_exception_wrapper.h"

// Argument includes
#include <QStringList>
#include <exceptions.h>

#include <cctype>
#include <cstring>
#include <iterator>
#include <type_traits>
#include <typeinfo>

using namespace KCalendarCore;

extern "C" {
static PyTypeObject *Sbk_KCalendarCore_Exception_TypeF(void)
{
    return SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_IDX].type;
}
} // extern "C"

// Native ---------------------------------------------------------

void ExceptionWrapper::resetPyMethodCache()
{
    std::fill(m_PyMethodCache.begin(), m_PyMethodCache.end(), nullptr);
}

ExceptionWrapper::ExceptionWrapper(const ::KCalendarCore::Exception::ErrorCode code, const ::QStringList & arguments) : KCalendarCore::Exception(code, arguments)
{
}

::QStringList ExceptionWrapper::arguments() const
{
    static const char *funcName = "arguments";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_KCalendarCore_Exception_TypeF(), gil, funcName, m_PyMethodCache[0], nameCache));
    if (pyOverride.isNull()) {
        return this->::KCalendarCore::Exception::arguments();
    }
    return sbk_o_arguments("Exception", funcName, gil, pyOverride);
}

::QStringList ExceptionWrapper::sbk_o_arguments([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride)
{
#if defined(PYPY_VERSION)
    Shiboken::AutoDecRef pyArgs(PyTuple_New(0));
#endif

#if !defined(PYPY_VERSION)
    Shiboken::AutoDecRef pyResult(PyObject_CallNoArgs(pyOverride));
#else
    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
#endif
    if (pyResult.isNull()) {
        // An error happened in python code!
        Shiboken::Errors::storePythonOverrideErrorOrPrint(ownerClassName, funcName);
        return ::QStringList();
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QStringList_IDX], pyResult);
    if (!pythonToCpp) {
        Shiboken::Warnings::warnInvalidReturnValue(ownerClassName, funcName, "QStringList", Py_TYPE(pyResult)->tp_name);
        return ::QStringList();
    }
    ::QStringList cppResult;
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

::KCalendarCore::Exception::ErrorCode ExceptionWrapper::code() const
{
    static const char *funcName = "code";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_KCalendarCore_Exception_TypeF(), gil, funcName, m_PyMethodCache[1], nameCache));
    if (pyOverride.isNull()) {
        return this->::KCalendarCore::Exception::code();
    }
    return sbk_o_code("Exception", funcName, gil, pyOverride);
}

::KCalendarCore::Exception::ErrorCode ExceptionWrapper::sbk_o_code([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride)
{
#if defined(PYPY_VERSION)
    Shiboken::AutoDecRef pyArgs(PyTuple_New(0));
#endif

#if !defined(PYPY_VERSION)
    Shiboken::AutoDecRef pyResult(PyObject_CallNoArgs(pyOverride));
#else
    Shiboken::AutoDecRef pyResult(PyObject_Call(pyOverride, pyArgs, nullptr));
#endif
    if (pyResult.isNull()) {
        // An error happened in python code!
        Shiboken::Errors::storePythonOverrideErrorOrPrint(ownerClassName, funcName);
        return KCalendarCore::Exception::LoadError;
    }
    // Check return type
    Shiboken::Conversions::PythonToCppConversion pythonToCpp =
        Shiboken::Conversions::pythonToCppConversion(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_ErrorCode_IDX]))), pyResult);
    if (!pythonToCpp) {
        Shiboken::Warnings::warnInvalidReturnValue(ownerClassName, funcName, PepType_GetFullyQualifiedNameStr(Shiboken::SbkType< KCalendarCore::Exception::ErrorCode >()), Py_TYPE(pyResult)->tp_name);
        return KCalendarCore::Exception::LoadError;
    }
    ::KCalendarCore::Exception::ErrorCode cppResult{KCalendarCore::Exception::LoadError};
    pythonToCpp(pyResult, &cppResult);
    return cppResult;
}

ExceptionWrapper::~ExceptionWrapper()
{
    auto *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(this, Sbk_KCalendarCore_Exception_TypeF());
    Shiboken::Object::destroy(wrapper, this);
}

// Target ---------------------------------------------------------

extern "C" {
static int
Sbk_KCalendarCore_Exception_Init(PyObject *self, PyObject *args, [[maybe_unused]] PyObject *kwds)
{
    auto *sbkSelf = reinterpret_cast<SbkObject *>(self);
    PySide::Feature::Select(self);
    if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType< ::KCalendarCore::Exception >()))
        return -1;

    ExceptionWrapper *cptr{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp[2];
    const Py_ssize_t numArgs = PyTuple_Size(args);
    SBK_UNUSED(numArgs)
    PyObject *pyArgs[] = {nullptr, nullptr};

    // invalid argument lengths
    errInfo.reset(Shiboken::checkInvalidArgumentCount(numArgs, 1, 2));
    if (!errInfo.isNull())
        return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_IDX]);

    if (PyArg_ParseTuple(args, "|OO:Exception", &(pyArgs[0]), &(pyArgs[1])) == 0)
        return -1;


    // Overloaded function decisor
    // 0: Exception::Exception(const KCalendarCore::Exception::ErrorCode,const QStringList&=)
    if (numArgs >= 1
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_ErrorCode_IDX]))), (pyArgs[0])))) {
        if (numArgs == 1) {
            overloadId = 0; // Exception(KCalendarCore::Exception::ErrorCode,QStringList)
        } else if (numArgs >= 2
            && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QStringList_IDX], (pyArgs[1])))) {
            overloadId = 0; // Exception::Exception(const KCalendarCore::Exception::ErrorCode,const QStringList&=)
        }
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments_MinusOne(args, "__init__", SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_IDX]);

    // Resolve keyword arguments
    {
        if (kwds != nullptr && PyDict_Size(kwds) > 0) {
            static const Shiboken::ArgumentNameIndexMapping mapping[1] = {{"arguments", 1}};
            if (!Shiboken::parseKeywordArguments(kwds, mapping, 1, errInfo, pyArgs)
                || (pyArgs[1] != nullptr && !((pythonToCpp[1] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QStringList_IDX], (pyArgs[1])))))) {
                Py_XINCREF(errInfo.object());
                return Shiboken::returnWrongArguments_MinusOne(args, "__init__", errInfo, SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_IDX]);
            }
        }
    }

    // PyMI support
    Shiboken::callInheritedInit(self, args, errInfo.isNull() ? kwds : errInfo.object(), SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_IDX]);
    if (Shiboken::Errors::occurred() != nullptr)
        return -1;

    // Call function/method
    {
        ::KCalendarCore::Exception::ErrorCode cppArg0{KCalendarCore::Exception::LoadError};
        pythonToCpp[0](pyArgs[0], &cppArg0);
        ::QStringList cppArg1 = QStringList();
        if (pythonToCpp[1])
            pythonToCpp[1](pyArgs[1], &cppArg1);

        if (Shiboken::Errors::occurred() == nullptr) {
            // Exception::Exception(const KCalendarCore::Exception::ErrorCode,const QStringList&=)
            cptr = new ExceptionWrapper(cppArg0, cppArg1);
        }
    }

    if (Shiboken::Errors::occurred() != nullptr || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< KCalendarCore::Exception >(), cptr)) {
        delete cptr;
        return -1;
    }
    if (cptr == nullptr)
        return Shiboken::returnWrongArguments_MinusOne(args, "__init__", SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_IDX]);

    Shiboken::Object::setValidCpp(sbkSelf, true);
    Shiboken::Object::setHasCppWrapper(sbkSelf, true);
    Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);


    return 1;
}

static PyObject *Sbk_KCalendarCore_ExceptionFunc_arguments(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::Exception *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // Exception::arguments()const->QStringList
        QStringList cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
            ? const_cast<const ::KCalendarCore::Exception *>(cppSelf)->::KCalendarCore::Exception::arguments()
            : const_cast<const ::KCalendarCore::Exception *>(cppSelf)->arguments();
        pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QStringList_IDX], &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCalendarCore_ExceptionFunc_code(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::KCalendarCore::Exception *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // Exception::code()const->KCalendarCore::Exception::ErrorCode
        KCalendarCore::Exception::ErrorCode cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
            ? const_cast<const ::KCalendarCore::Exception *>(cppSelf)->::KCalendarCore::Exception::code()
            : const_cast<const ::KCalendarCore::Exception *>(cppSelf)->code();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Enum::getConverter(reinterpret_cast<SbkEnumType *>(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_ErrorCode_IDX]))), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}


static const char *Sbk_KCalendarCore_Exception_PropertyStrings[] = {
    nullptr // Sentinel
};

static const char *Sbk_KCalendarCore_Exception_EnumFlagInfo[] = {
    "ErrorCode:IntEnum",
    nullptr // Sentinel
};

static PyMethodDef Sbk_KCalendarCore_Exception_methods[] = {
    {"arguments", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_ExceptionFunc_arguments), METH_NOARGS, nullptr},
    {"code", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_ExceptionFunc_code), METH_NOARGS, nullptr},
    {nullptr, nullptr, 0, nullptr} // Sentinel
};

static int Sbk_KCalendarCore_Exception_setattro(PyObject *self, PyObject *name, PyObject *value)
{
    PySide::Feature::Select(self);
    if (value != nullptr && PyCallable_Check(value) != 0) {
        auto plain_inst = reinterpret_cast< ::KCalendarCore::Exception *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_IDX]), reinterpret_cast<SbkObject *>(self)));
        auto *inst = dynamic_cast<ExceptionWrapper *>(plain_inst);
        if (inst != nullptr)
            inst->resetPyMethodCache();
    }
    return PyObject_GenericSetAttr(self, name, value);
}

} // extern "C"

static int Sbk_KCalendarCore_Exception_traverse(PyObject *self, visitproc visit, void *arg)
{
    auto traverseProc = reinterpret_cast<traverseproc>(PyType_GetSlot(SbkObject_TypeF(), Py_tp_traverse));
    ;
    return traverseProc(self, visit, arg);
}
static int Sbk_KCalendarCore_Exception_clear(PyObject *self)
{
    auto clearProc = reinterpret_cast<inquiry>(PyType_GetSlot(SbkObject_TypeF(), Py_tp_clear));
    ;
    return clearProc(self);
}

// Class Definition -----------------------------------------------
extern "C" {

static PyType_Slot Sbk_KCalendarCore_Exception_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_setattro,    reinterpret_cast<void *>(Sbk_KCalendarCore_Exception_setattro)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_KCalendarCore_Exception_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_KCalendarCore_Exception_clear)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_KCalendarCore_Exception_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_KCalendarCore_Exception_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObject_tp_new)},
    {0, nullptr}
};
static PyType_Spec Sbk_KCalendarCore_Exception_spec = {
    "1:KCalendarCore.KCalendarCore.Exception",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_KCalendarCore_Exception_slots
};

} //extern "C"

// Type conversion functions.

// Python to C++ enum conversion.
static void Enum_PythonToCpp_KCalendarCore_Exception_ErrorCode(PyObject *pyIn, void *cppOut)
{
    const auto value = static_cast<::KCalendarCore::Exception::ErrorCode>(Shiboken::Enum::getValue(pyIn));
    *reinterpret_cast<::KCalendarCore::Exception::ErrorCode *>(cppOut) = value;

}
static PythonToCppFunc is_Enum_PythonToCpp_KCalendarCore_Exception_ErrorCode_Convertible(PyObject *pyIn)
{
    if (PyObject_TypeCheck(pyIn, Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_ErrorCode_IDX])))
        return Enum_PythonToCpp_KCalendarCore_Exception_ErrorCode;
    return {};
}

static PyObject *KCalendarCore_Exception_ErrorCode_CppToPython_Enum(PyTypeObject *pyType, const void *cppIn)
{
    using IntType = std::underlying_type_t<::KCalendarCore::Exception::ErrorCode>;
    const auto castCppIn = IntType(*reinterpret_cast<const ::KCalendarCore::Exception::ErrorCode *>(cppIn));
    return Shiboken::Enum::newItem(pyType, castCppIn);

}

// Python to C++ pointer conversion - returns the C++ object of the Python wrapper (keeps object identity).
static void Exception_PythonToCpp_Exception_PTR(PyObject *pyIn, void *cppOut)
{
    Shiboken::Conversions::pythonToCppPointer(Sbk_KCalendarCore_Exception_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_Exception_PythonToCpp_Exception_PTR_Convertible(PyObject *pyIn)
{
    if (pyIn == Py_None)
        return Shiboken::Conversions::nonePythonToCppNullPtr;
    if (PyObject_TypeCheck(pyIn, Sbk_KCalendarCore_Exception_TypeF()))
        return Exception_PythonToCpp_Exception_PTR;
    return {};
}

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *Exception_PTR_CppToPython_Exception(const void *cppIn)
{
    auto *pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppIn, Sbk_KCalendarCore_Exception_TypeF()));
    if (pyOut) {
        Py_INCREF(pyOut);
        return pyOut;
    }
    auto *tCppIn = reinterpret_cast<const ::KCalendarCore::Exception *>(cppIn);
    const char *typeName = typeid(*tCppIn).name();
    return Shiboken::Object::newObjectForPointer(Sbk_KCalendarCore_Exception_TypeF(), const_cast<void *>(cppIn), false, typeName);

}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
#if PYSIDE6_COMOPT_COMPRESS == 0
static const char *KCalendarCore_Exception_SignatureStrings[] = {
    "KCalendarCore.KCalendarCore.Exception(self,code:KCalendarCore.KCalendarCore.Exception.ErrorCode,arguments:QStringList=QStringList())",
    "KCalendarCore.KCalendarCore.Exception.arguments(self)->QStringList",
    "KCalendarCore.KCalendarCore.Exception.code(self)->KCalendarCore.KCalendarCore.Exception.ErrorCode",
    nullptr}; // Sentinel
#else
static constexpr size_t KCalendarCore_Exception_SignatureByteSize = 108;
static constexpr uint8_t KCalendarCore_Exception_SignatureBytes[108] = {
    0x78, 0xda, 0xf3, 0x76, 0x4e, 0xcc, 0x49, 0xcd, 0x4b, 0x49, 0x2c, 0x72, 0xce, 0x2f, 0x4a, 0xd5,
    0xf3, 0x46, 0xe1, 0xb9, 0x56, 0x24, 0xa7, 0x16, 0x94, 0x64, 0xe6, 0xe7, 0x69, 0x14, 0xa7, 0xe6,
    0xa4, 0xe9, 0x24, 0xe7, 0xa7, 0xa4, 0x5a, 0x79, 0x13, 0xa3, 0x5e, 0xcf, 0xb5, 0xa8, 0x28, 0x1f,
    0x28, 0x96, 0x92, 0xaa, 0x93, 0x58, 0x94, 0x5e, 0x9a, 0x9b, 0x9a, 0x57, 0x52, 0x6c, 0x15, 0x18,
    0x5c, 0x52, 0x94, 0x99, 0x97, 0xee, 0x93, 0x59, 0x5c, 0x62, 0x8b, 0xc4, 0xd6, 0xd0, 0xd4, 0xe4,
    0x22, 0xce, 0x50, 0xb8, 0x51, 0x60, 0xe7, 0x68, 0xea, 0xda, 0x21, 0x99, 0x42, 0xa4, 0x11, 0x20,
    0x2f, 0xc0, 0x74, 0x93, 0xe8, 0x13, 0x2e, 0x00, 0x49, 0x89, 0x6d, 0x93
};
#endif

PyTypeObject *init_KCalendarCore_Exception(PyObject *enclosingClass)
{
    auto &typeStruct = SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_IDX];
    if (typeStruct.type != nullptr)
        return typeStruct.type;

    auto *base1 = SbkObject_TypeF();
    Shiboken::AutoDecRef Sbk_KCalendarCore_Exception_Type_bases(PyTuple_Pack(1, base1));

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        enclosingClass,
        "Exception",
        "KCalendarCore::Exception*",
        &Sbk_KCalendarCore_Exception_spec,
        &Shiboken::callCppDestructor< KCalendarCore::Exception >,
        Sbk_KCalendarCore_Exception_Type_bases.object(),
        Shiboken::ObjectType::WrapperFlags::InnerClass);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, KCalendarCore_Exception_SignatureStrings);
#else
    InitSignatureBytes(pyType, KCalendarCore_Exception_SignatureBytes, KCalendarCore_Exception_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_KCalendarCore_Exception_PropertyStrings);
    typeStruct.type = pyType;

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(pyType,
        Exception_PythonToCpp_Exception_PTR,
        is_Exception_PythonToCpp_Exception_PTR_Convertible,
        Exception_PTR_CppToPython_Exception);

    Shiboken::Conversions::registerConverterName(converter, "KCalendarCore::Exception");
    Shiboken::Conversions::registerConverterName(converter, "KCalendarCore::Exception*");
    Shiboken::Conversions::registerConverterName(converter, "KCalendarCore::Exception&");
    Shiboken::Conversions::registerConverterAlias(converter, "Exception");
    Shiboken::Conversions::registerConverterAlias(converter, "Exception*");
    Shiboken::Conversions::registerConverterAlias(converter, "Exception&");
    Shiboken::Conversions::registerConverterName(converter, typeid(::KCalendarCore::Exception).name());
    Shiboken::Conversions::registerConverterName(converter, typeid(ExceptionWrapper).name());

    // Pass the ..._EnumFlagInfo to the class.
    SbkObjectType_SetEnumFlagInfo(pyType, Sbk_KCalendarCore_Exception_EnumFlagInfo);

    // Initialization of enums.
    Shiboken::AutoDecRef tpDict{};
    [[maybe_unused]] PyTypeObject *EType{};

    // Initialization of enum 'ErrorCode'.
    const char *ErrorCode_Initializer[] = {
        "LoadError",
        "SaveError",
        "ParseErrorIcal",
        "ParseErrorKcal",
        "NoCalendar",
        "CalVersion1",
        "CalVersion2",
        "CalVersionUnknown",
        "Restriction",
        "UserCancel",
        "NoWritableFound",
        "SaveErrorOpenFile",
        "SaveErrorSaveFile",
        "LibICalError",
        "VersionPropertyMissing",
        "ExpectedCalVersion2",
        "ExpectedCalVersion2Unknown",
        "ParseErrorNotIncidence",
        "ParseErrorEmptyMessage",
        "ParseErrorUnableToParse",
        "ParseErrorMethodProperty",
        nullptr};
    // "uint8_t" used instead of "unsigned int"
    constexpr uint8_t ErrorCode_InitializerValues[] = {
        uint8_t(KCalendarCore::Exception::ErrorCode::LoadError),                  //  0x00  0
        uint8_t(KCalendarCore::Exception::ErrorCode::SaveError),                  //  0x01  1
        uint8_t(KCalendarCore::Exception::ErrorCode::ParseErrorIcal),             //  0x02  2
        uint8_t(KCalendarCore::Exception::ErrorCode::ParseErrorKcal),             //  0x03  3
        uint8_t(KCalendarCore::Exception::ErrorCode::NoCalendar),                 //  0x04  4
        uint8_t(KCalendarCore::Exception::ErrorCode::CalVersion1),                //  0x05  5
        uint8_t(KCalendarCore::Exception::ErrorCode::CalVersion2),                //  0x06  6
        uint8_t(KCalendarCore::Exception::ErrorCode::CalVersionUnknown),          //  0x07  7
        uint8_t(KCalendarCore::Exception::ErrorCode::Restriction),                //  0x08  8
        uint8_t(KCalendarCore::Exception::ErrorCode::UserCancel),                 //  0x09  9
        uint8_t(KCalendarCore::Exception::ErrorCode::NoWritableFound),            //  0x0a  10
        uint8_t(KCalendarCore::Exception::ErrorCode::SaveErrorOpenFile),          //  0x0b  11
        uint8_t(KCalendarCore::Exception::ErrorCode::SaveErrorSaveFile),          //  0x0c  12
        uint8_t(KCalendarCore::Exception::ErrorCode::LibICalError),               //  0x0d  13
        uint8_t(KCalendarCore::Exception::ErrorCode::VersionPropertyMissing),     //  0x0e  14
        uint8_t(KCalendarCore::Exception::ErrorCode::ExpectedCalVersion2),        //  0x0f  15
        uint8_t(KCalendarCore::Exception::ErrorCode::ExpectedCalVersion2Unknown), //  0x10  16
        uint8_t(KCalendarCore::Exception::ErrorCode::ParseErrorNotIncidence),     //  0x11  17
        uint8_t(KCalendarCore::Exception::ErrorCode::ParseErrorEmptyMessage),     //  0x12  18
        uint8_t(KCalendarCore::Exception::ErrorCode::ParseErrorUnableToParse),    //  0x13  19
        uint8_t(KCalendarCore::Exception::ErrorCode::ParseErrorMethodProperty)    //  0x14  20
        };
    EType = Shiboken::Enum::createPythonEnum(pyType,
        "1:KCalendarCore.KCalendarCore.Exception.ErrorCode",
        ErrorCode_Initializer, ErrorCode_InitializerValues);
    SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_Exception_ErrorCode_IDX].type = EType;
    // Register converter for enum 'KCalendarCore::Exception::ErrorCode'.
    {
        SbkConverter *converter = Shiboken::Conversions::createConverter(EType,
            KCalendarCore_Exception_ErrorCode_CppToPython_Enum);
        Shiboken::Conversions::addPythonToCppValueConversion(converter,
            Enum_PythonToCpp_KCalendarCore_Exception_ErrorCode,
            is_Enum_PythonToCpp_KCalendarCore_Exception_ErrorCode_Convertible);
        Shiboken::Conversions::registerConverterName(converter, "KCalendarCore::Exception::ErrorCode");
        Shiboken::Conversions::registerConverterAlias(converter, "Exception::ErrorCode");
        Shiboken::Conversions::registerConverterAlias(converter, "ErrorCode");
        Shiboken::Enum::setTypeConverter(EType, converter, nullptr);
    }
    // End of 'ErrorCode' enum.

    qRegisterMetaType< ::KCalendarCore::Exception *>();
    qRegisterMetaType< ::KCalendarCore::Exception::ErrorCode >("Exception::ErrorCode");
    qRegisterMetaType< ::KCalendarCore::Exception::ErrorCode >("KCalendarCore::Exception::ErrorCode");

    return pyType;
}
