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

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

using namespace KCalendarCore;

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


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

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


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

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

static int Sbk_KCalendarCore_FreeBusyCache_setattro(PyObject *self, PyObject *name, PyObject *value)
{
    PySide::Feature::Select(self);
    return PyObject_GenericSetAttr(self, name, value);
}

} // extern "C"

static int Sbk_KCalendarCore_FreeBusyCache_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_FreeBusyCache_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_FreeBusyCache_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_setattro,    reinterpret_cast<void *>(Sbk_KCalendarCore_FreeBusyCache_setattro)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_KCalendarCore_FreeBusyCache_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_KCalendarCore_FreeBusyCache_clear)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_KCalendarCore_FreeBusyCache_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_KCalendarCore_FreeBusyCache_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkObject_tp_new)},
    {0, nullptr}
};
static PyType_Spec Sbk_KCalendarCore_FreeBusyCache_spec = {
    "1:KCalendarCore.KCalendarCore.FreeBusyCache",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_KCalendarCore_FreeBusyCache_slots
};

} //extern "C"

// Type conversion functions.

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

// C++ to Python pointer conversion - tries to find the Python wrapper for the C++ object (keeps object identity).
static PyObject *FreeBusyCache_PTR_CppToPython_FreeBusyCache(const void *cppIn)
{
    auto *pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppIn, Sbk_KCalendarCore_FreeBusyCache_TypeF()));
    if (pyOut) {
        Py_INCREF(pyOut);
        return pyOut;
    }
    auto *tCppIn = reinterpret_cast<const ::KCalendarCore::FreeBusyCache *>(cppIn);
    const char *typeName = typeid(*tCppIn).name();
    return Shiboken::Object::newObjectForPointer(Sbk_KCalendarCore_FreeBusyCache_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_FreeBusyCache_SignatureStrings[] = {
    "KCalendarCore.KCalendarCore.FreeBusyCache(self)",
    nullptr}; // Sentinel
#else
static constexpr size_t KCalendarCore_FreeBusyCache_SignatureByteSize = 45;
static constexpr uint8_t KCalendarCore_FreeBusyCache_SignatureBytes[45] = {
    0x78, 0xda, 0xf3, 0x76, 0x4e, 0xcc, 0x49, 0xcd, 0x4b, 0x49, 0x2c, 0x72, 0xce, 0x2f, 0x4a, 0xd5,
    0xf3, 0x46, 0xe1, 0xb9, 0x15, 0xa5, 0xa6, 0x3a, 0x95, 0x16, 0x57, 0x3a, 0x27, 0x26, 0x67, 0xa4,
    0x6a, 0x14, 0xa7, 0xe6, 0xa4, 0x69, 0x72, 0x01, 0x00, 0xae, 0xe6, 0x11, 0x37
};
#endif

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

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

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        enclosingClass,
        "FreeBusyCache",
        "KCalendarCore::FreeBusyCache*",
        &Sbk_KCalendarCore_FreeBusyCache_spec,
        &Shiboken::callCppDestructor< ::KCalendarCore::FreeBusyCache >,
        Sbk_KCalendarCore_FreeBusyCache_Type_bases.object(),
        Shiboken::ObjectType::WrapperFlags::InnerClass);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, KCalendarCore_FreeBusyCache_SignatureStrings);
#else
    InitSignatureBytes(pyType, KCalendarCore_FreeBusyCache_SignatureBytes, KCalendarCore_FreeBusyCache_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_KCalendarCore_FreeBusyCache_PropertyStrings);
    typeStruct.type = pyType;

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(pyType,
        FreeBusyCache_PythonToCpp_FreeBusyCache_PTR,
        is_FreeBusyCache_PythonToCpp_FreeBusyCache_PTR_Convertible,
        FreeBusyCache_PTR_CppToPython_FreeBusyCache);

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

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

    return pyType;
}
