
// 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_calendarpluginloader_wrapper.h"

// Argument includes
#include <calendarplugin.h>
#include <qobject.h>
#include <qobjectdefs.h>

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

using namespace KCalendarCore;

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


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

extern "C" {
static int
Sbk_KCalendarCore_CalendarPluginLoader_Init(PyObject *self, [[maybe_unused]] 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::CalendarPluginLoader >()))
        return -1;

    ::KCalendarCore::CalendarPluginLoader *cptr{};
    Shiboken::PythonContextMarker pcm;


    // PyMI support
    Shiboken::callInheritedInit(self, args, kwds, SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_CalendarPluginLoader_IDX]);
    if (Shiboken::Errors::occurred() != nullptr)
        return -1;

    // Call function/method
    {

        // CalendarPluginLoader::CalendarPluginLoader()
        cptr = new ::KCalendarCore::CalendarPluginLoader();
    }

    if (Shiboken::Errors::occurred() != nullptr || !Shiboken::Object::setCppPointer(sbkSelf, Shiboken::SbkType< ::KCalendarCore::CalendarPluginLoader >(), cptr)) {
        delete cptr;
        return -1;
    }
    Shiboken::Object::setValidCpp(sbkSelf, true);
    Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);


    return 1;
}

static PyObject *Sbk_KCalendarCore_CalendarPluginLoaderFunc_hasPlugin([[maybe_unused]] PyObject *self)
{
    PyObject *pyResult{};
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // static CalendarPluginLoader::hasPlugin()->bool
        bool cppResult = ::KCalendarCore::CalendarPluginLoader::hasPlugin();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_KCalendarCore_CalendarPluginLoaderFunc_plugin([[maybe_unused]] PyObject *self)
{
    PyObject *pyResult{};
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // static CalendarPluginLoader::plugin()->KCalendarCore::CalendarPlugin*
        KCalendarCore::CalendarPlugin * cppResult = ::KCalendarCore::CalendarPluginLoader::plugin();
        pyResult = Shiboken::Conversions::pointerToPython(Shiboken::Module::get(SbkKCalendarCoreTypeStructs[SBK_KCalendarCore_CalendarPlugin_IDX]), cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}


static const char *Sbk_KCalendarCore_CalendarPluginLoader_PropertyStrings[] = {
    "hasPlugin:",
    "plugin:",
    nullptr // Sentinel
};

static PyMethodDef Sbk_KCalendarCore_CalendarPluginLoader_methods[] = {
    {"hasPlugin", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_CalendarPluginLoaderFunc_hasPlugin), METH_NOARGS|METH_STATIC, nullptr},
    {"plugin", reinterpret_cast<PyCFunction>(Sbk_KCalendarCore_CalendarPluginLoaderFunc_plugin), METH_NOARGS|METH_STATIC, nullptr},
    {nullptr, nullptr, 0, nullptr} // Sentinel
};

} // extern "C"

static int Sbk_KCalendarCore_CalendarPluginLoader_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_CalendarPluginLoader_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_CalendarPluginLoader_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_KCalendarCore_CalendarPluginLoader_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_KCalendarCore_CalendarPluginLoader_clear)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_KCalendarCore_CalendarPluginLoader_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_KCalendarCore_CalendarPluginLoader_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObject_tp_new)},
    {0, nullptr}
};
static PyType_Spec Sbk_KCalendarCore_CalendarPluginLoader_spec = {
    "1:KCalendarCore.KCalendarCore.CalendarPluginLoader",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_KCalendarCore_CalendarPluginLoader_slots
};

} //extern "C"

// Type conversion functions.

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

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *CalendarPluginLoader_PTR_CppToPython_CalendarPluginLoader(const void *cppIn)
{
    auto *pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppIn, Sbk_KCalendarCore_CalendarPluginLoader_TypeF()));
    if (pyOut) {
        Py_INCREF(pyOut);
        return pyOut;
    }
    return Shiboken::Object::newObjectWithHeuristics(Sbk_KCalendarCore_CalendarPluginLoader_TypeF(), const_cast<void *>(cppIn), false);

}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
#if PYSIDE6_COMOPT_COMPRESS == 0
static const char *KCalendarCore_CalendarPluginLoader_SignatureStrings[] = {
    "KCalendarCore.KCalendarCore.CalendarPluginLoader(self,*:KeywordOnly=None,hasPlugin:bool=None,plugin:KCalendarCore.CalendarPlugin=None)",
    "KCalendarCore.KCalendarCore.CalendarPluginLoader.hasPlugin()->bool",
    "KCalendarCore.KCalendarCore.CalendarPluginLoader.plugin()->KCalendarCore.KCalendarCore.CalendarPlugin",
    nullptr}; // Sentinel
#else
static constexpr size_t KCalendarCore_CalendarPluginLoader_SignatureByteSize = 106;
static constexpr uint8_t KCalendarCore_CalendarPluginLoader_SignatureBytes[106] = {
    0x78, 0xda, 0xf3, 0x76, 0x4e, 0xcc, 0x49, 0xcd, 0x4b, 0x49, 0x2c, 0x72, 0xce, 0x2f, 0x4a, 0xd5,
    0xf3, 0x46, 0xe1, 0xc1, 0x38, 0x01, 0x39, 0xa5, 0xe9, 0x99, 0x79, 0x3e, 0xf9, 0x89, 0x29, 0xa9,
    0x45, 0x1a, 0xc5, 0xa9, 0x39, 0x69, 0x3a, 0x5a, 0x56, 0xde, 0xa9, 0x95, 0xe5, 0xf9, 0x45, 0x29,
    0xfe, 0x79, 0x39, 0x95, 0xb6, 0x7e, 0xf9, 0x79, 0xa9, 0x3a, 0x19, 0x89, 0xc5, 0x10, 0x75, 0x56,
    0x49, 0xf9, 0xf9, 0x39, 0x10, 0xb1, 0x02, 0x88, 0x00, 0x3e, 0x53, 0xc1, 0x0a, 0x35, 0xb9, 0xbc,
    0x49, 0x74, 0x86, 0x1e, 0xdc, 0x3a, 0x0d, 0x4d, 0x5d, 0x3b, 0x90, 0x8d, 0xa4, 0x1b, 0x51, 0x00,
    0xd7, 0x4f, 0xbc, 0x56, 0x2e, 0x00, 0xdf, 0xdc, 0x6f, 0xb2
};
#endif

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

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

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        enclosingClass,
        "CalendarPluginLoader",
        "KCalendarCore::CalendarPluginLoader*",
        &Sbk_KCalendarCore_CalendarPluginLoader_spec,
        &Shiboken::callCppDestructor< ::KCalendarCore::CalendarPluginLoader >,
        Sbk_KCalendarCore_CalendarPluginLoader_Type_bases.object(),
        Shiboken::ObjectType::WrapperFlags::InnerClass);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, KCalendarCore_CalendarPluginLoader_SignatureStrings);
#else
    InitSignatureBytes(pyType, KCalendarCore_CalendarPluginLoader_SignatureBytes, KCalendarCore_CalendarPluginLoader_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_KCalendarCore_CalendarPluginLoader_PropertyStrings);
    typeStruct.type = pyType;

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(pyType,
        CalendarPluginLoader_PythonToCpp_CalendarPluginLoader_PTR,
        is_CalendarPluginLoader_PythonToCpp_CalendarPluginLoader_PTR_Convertible,
        CalendarPluginLoader_PTR_CppToPython_CalendarPluginLoader);

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

    qRegisterMetaType< ::KCalendarCore::CalendarPluginLoader *>();

    return pyType;
}
