
// 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 <pysideqobject.h>
#include <pysidesignal.h>
#include <pysideproperty.h>
#include <signalmanager.h>
#include <pysidemetafunction.h>
#include <pysideqenum.h>
#include <pysideutils.h>
#include <feature_select.h>
QT_WARNING_DISABLE_DEPRECATED


// module include
#include "kcalendarcore_python.h"

// main header
#include "kcalendarcore_calendarplugin_wrapper.h"

// Argument includes
#include <QList>
#include <qobject.h>
#include <qobjectdefs.h>
#include <qvariant.h>

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

using namespace KCalendarCore;

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


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

extern "C" {
static int
Sbk_KCalendarCore_CalendarPlugin_Init([[maybe_unused]] PyObject *self, [[maybe_unused]] PyObject *args, [[maybe_unused]] PyObject *kwds)
{
    Shiboken::Errors::setInstantiateAbstractClassDisabledWrapper("KCalendarCore::CalendarPlugin");
    return -1;
}


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

static PyMethodDef Sbk_KCalendarCore_CalendarPlugin_methods[] = {
    {nullptr, nullptr, 0, nullptr} // Sentinel
};

static int Sbk_KCalendarCore_CalendarPlugin_setattro(PyObject *self, PyObject *name, PyObject *value)
{
    PySide::Feature::Select(self);
    Shiboken::AutoDecRef pp(reinterpret_cast<PyObject *>(PySide::Property::getObject(self, name)));
    if (!pp.isNull())
        return PySide::Property::setValue(reinterpret_cast<PySideProperty *>(pp.object()), self, value);
    return PyObject_GenericSetAttr(self, name, value);
}

} // extern "C"

static int Sbk_KCalendarCore_CalendarPlugin_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_CalendarPlugin_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_CalendarPlugin_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_setattro,    reinterpret_cast<void *>(Sbk_KCalendarCore_CalendarPlugin_setattro)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_KCalendarCore_CalendarPlugin_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_KCalendarCore_CalendarPlugin_clear)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_KCalendarCore_CalendarPlugin_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_KCalendarCore_CalendarPlugin_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObject_tp_new)},
    {0, nullptr}
};
static PyType_Spec Sbk_KCalendarCore_CalendarPlugin_spec = {
    "1:KCalendarCore.KCalendarCore.CalendarPlugin",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_KCalendarCore_CalendarPlugin_slots
};

} //extern "C"

static void *Sbk_KCalendarCore_CalendarPlugin_typeDiscovery([[maybe_unused]] void *cptr, [[maybe_unused]] PyTypeObject *instanceType)
{
    if (instanceType == Shiboken::SbkType< ::QObject >())
        return dynamic_cast< ::KCalendarCore::CalendarPlugin *>(reinterpret_cast< ::QObject *>(cptr));
    return {};
}


// Type conversion functions.

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

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *CalendarPlugin_PTR_CppToPython_CalendarPlugin(const void *cppIn)
{
    return PySide::getWrapperForQObject(reinterpret_cast<::KCalendarCore::CalendarPlugin *>(const_cast<void *>(cppIn)), Sbk_KCalendarCore_CalendarPlugin_TypeF());

}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
#if PYSIDE6_COMOPT_COMPRESS == 0
static const char *KCalendarCore_CalendarPlugin_SignatureStrings[] = {
    "KCalendarCore.KCalendarCore.CalendarPlugin(self,parent:PySide6.QtCore.QObject,args:QList[QVariant])",
    nullptr}; // Sentinel
#else
static constexpr size_t KCalendarCore_CalendarPlugin_SignatureByteSize = 87;
static constexpr uint8_t KCalendarCore_CalendarPlugin_SignatureBytes[87] = {
    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, 0x1a, 0xc5, 0xa9, 0x39, 0x69,
    0x3a, 0x05, 0x89, 0x45, 0xa9, 0x79, 0x25, 0x56, 0x01, 0x95, 0xc1, 0x99, 0x29, 0xa9, 0x66, 0x7a,
    0x81, 0x25, 0x60, 0x95, 0x81, 0xfe, 0x49, 0x59, 0xa9, 0xc9, 0x25, 0x3a, 0x89, 0x45, 0xe9, 0xc5,
    0x56, 0x81, 0x3e, 0x99, 0xc5, 0x25, 0xd1, 0x81, 0x61, 0x89, 0x45, 0x99, 0x89, 0x79, 0x25, 0xb1,
    0x9a, 0x5c, 0x00, 0x44, 0xc7, 0x24, 0x6b
};
#endif

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

    auto *base1 = reinterpret_cast<PyObject *>(Shiboken::Module::get(SbkPySide6_QtCoreTypeStructs[SBK_QObject_IDX]));
    Shiboken::AutoDecRef Sbk_KCalendarCore_CalendarPlugin_Type_bases(PyTuple_Pack(1, base1));

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        enclosingClass,
        "CalendarPlugin",
        "KCalendarCore::CalendarPlugin*",
        &Sbk_KCalendarCore_CalendarPlugin_spec,
        &Shiboken::callCppDestructor< ::KCalendarCore::CalendarPlugin >,
        Sbk_KCalendarCore_CalendarPlugin_Type_bases.object(),
        Shiboken::ObjectType::WrapperFlags::InnerClass);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, KCalendarCore_CalendarPlugin_SignatureStrings);
#else
    InitSignatureBytes(pyType, KCalendarCore_CalendarPlugin_SignatureBytes, KCalendarCore_CalendarPlugin_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_KCalendarCore_CalendarPlugin_PropertyStrings);
    typeStruct.type = pyType;

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(pyType,
        CalendarPlugin_PythonToCpp_CalendarPlugin_PTR,
        is_CalendarPlugin_PythonToCpp_CalendarPlugin_PTR_Convertible,
        CalendarPlugin_PTR_CppToPython_CalendarPlugin);

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

    Shiboken::ObjectType::setTypeDiscoveryFunctionV2(pyType, &Sbk_KCalendarCore_CalendarPlugin_typeDiscovery);

    PySide::Signal::registerSignals(pyType, &::KCalendarCore::CalendarPlugin::staticMetaObject);
    Shiboken::ObjectType::setSubTypeInitHook(pyType, &PySide::initQObjectSubType);
    PySide::initDynamicMetaObject(pyType, &::KCalendarCore::CalendarPlugin::staticMetaObject, sizeof(::KCalendarCore::CalendarPlugin));

    return pyType;
}
