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

// main header
#include "akonadi_agentconfigurationbase_wrapper.h"

// Wrappers providing overrides
#include "akonadi_trashfilterproxymodel_wrapper.h"

// Argument includes
#include <QString>
#include <qmetaobject.h>
#include <qobject.h>
#include <qobjectdefs.h>

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

using namespace Akonadi;

extern "C" {
static PyTypeObject *Sbk_Akonadi_AgentConfigurationBase_TypeF(void)
{
    return SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentConfigurationBase_IDX].type;
}
} // extern "C"

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

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

void AgentConfigurationBaseWrapper::childEvent(::QChildEvent * event)
{
    static const char *funcName = "childEvent";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentConfigurationBase_TypeF(), gil, funcName, m_PyMethodCache[0], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::childEvent(event);
    }
    TrashFilterProxyModelWrapper::sbk_o_childEvent("AgentConfigurationBase", funcName, gil, pyOverride, event);
}

void AgentConfigurationBaseWrapper::connectNotify(const ::QMetaMethod & signal)
{
    static const char *funcName = "connectNotify";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentConfigurationBase_TypeF(), gil, funcName, m_PyMethodCache[1], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::connectNotify(signal);
    }
    TrashFilterProxyModelWrapper::sbk_o_connectNotify("AgentConfigurationBase", funcName, gil, pyOverride, signal);
}

void AgentConfigurationBaseWrapper::customEvent(::QEvent * event)
{
    static const char *funcName = "customEvent";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentConfigurationBase_TypeF(), gil, funcName, m_PyMethodCache[2], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::customEvent(event);
    }
    TrashFilterProxyModelWrapper::sbk_o_customEvent("AgentConfigurationBase", funcName, gil, pyOverride, event);
}

void AgentConfigurationBaseWrapper::disconnectNotify(const ::QMetaMethod & signal)
{
    static const char *funcName = "disconnectNotify";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentConfigurationBase_TypeF(), gil, funcName, m_PyMethodCache[3], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::disconnectNotify(signal);
    }
    TrashFilterProxyModelWrapper::sbk_o_connectNotify("AgentConfigurationBase", funcName, gil, pyOverride, signal);
}

bool AgentConfigurationBaseWrapper::event(::QEvent * event)
{
    static const char *funcName = "event";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentConfigurationBase_TypeF(), gil, funcName, m_PyMethodCache[4], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::event(event);
    }
    return TrashFilterProxyModelWrapper::sbk_o_event("AgentConfigurationBase", funcName, gil, pyOverride, event);
}

bool AgentConfigurationBaseWrapper::eventFilter(::QObject * watched, ::QEvent * event)
{
    static const char *funcName = "eventFilter";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentConfigurationBase_TypeF(), gil, funcName, m_PyMethodCache[5], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::eventFilter(watched, event);
    }
    return TrashFilterProxyModelWrapper::sbk_o_eventFilter("AgentConfigurationBase", funcName, gil, pyOverride, watched, event);
}

void AgentConfigurationBaseWrapper::load()
{
    static const char *funcName = "load";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentConfigurationBase_TypeF(), gil, funcName, m_PyMethodCache[6], nameCache));
    if (pyOverride.isNull()) {
        return this->::Akonadi::AgentConfigurationBase::load();
    }
    TrashFilterProxyModelWrapper::sbk_o_resetInternalData("AgentConfigurationBase", funcName, gil, pyOverride);
}

bool AgentConfigurationBaseWrapper::save() const
{
    static const char *funcName = "save";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentConfigurationBase_TypeF(), gil, funcName, m_PyMethodCache[7], nameCache));
    if (pyOverride.isNull()) {
        return this->::Akonadi::AgentConfigurationBase::save();
    }
    return TrashFilterProxyModelWrapper::sbk_o_submit("AgentConfigurationBase", funcName, gil, pyOverride);
}

void AgentConfigurationBaseWrapper::timerEvent(::QTimerEvent * event)
{
    static const char *funcName = "timerEvent";
    static PyObject *nameCache[2] = {};
    Shiboken::GilState gil(false);
    Shiboken::AutoDecRef pyOverride(Sbk_GetPyOverride(this, Sbk_Akonadi_AgentConfigurationBase_TypeF(), gil, funcName, m_PyMethodCache[8], nameCache));
    if (pyOverride.isNull()) {
        return this->::QObject::timerEvent(event);
    }
    TrashFilterProxyModelWrapper::sbk_o_timerEvent("AgentConfigurationBase", funcName, gil, pyOverride, event);
}

const QMetaObject *AgentConfigurationBaseWrapper::metaObject() const
{
    if (QObject::d_ptr->metaObject != nullptr)
        return QObject::d_ptr->dynamicMetaObject();
    SbkObject *pySelf = Shiboken::BindingManager::instance().retrieveWrapper(this);
    if (pySelf == nullptr)
        return Akonadi::AgentConfigurationBase::metaObject();
    return PySide::SignalManager::retrieveMetaObject(reinterpret_cast<PyObject *>(pySelf));
}

int AgentConfigurationBaseWrapper::qt_metacall(QMetaObject::Call call, int id, void **args)
{
    int result = Akonadi::AgentConfigurationBase::qt_metacall(call, id, args);
    return result < 0 ? result : PySide::SignalManager::qt_metacall(this, call, id, args);
}

void *AgentConfigurationBaseWrapper::qt_metacast(const char *_clname)
{
    if (_clname == nullptr)
        return {};
    if (SbkObject *pySelf = Shiboken::BindingManager::instance().retrieveWrapper(this)) {
        auto *obSelf = reinterpret_cast<PyObject *>(pySelf);
        if (PySide::inherits(Py_TYPE(obSelf), _clname))
            return static_cast<void *>(const_cast< AgentConfigurationBaseWrapper *>(this));
    }
    return Akonadi::AgentConfigurationBase::qt_metacast(_clname);
}

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

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

extern "C" {
static int Sbk_Akonadi_AgentConfigurationBase_Init(PyObject *, PyObject *, PyObject *)
{
    Shiboken::Errors::setInstantiateNonConstructible("AgentConfigurationBase");
    return -1;
}

static PyObject *Sbk_Akonadi_AgentConfigurationBaseFunc_identifier(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::AgentConfigurationBase *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentConfigurationBase_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // AgentConfigurationBase::identifier()const->QString
        QString cppResult = const_cast<const ::Akonadi::AgentConfigurationBase *>(cppSelf)->identifier();
        pyResult = Shiboken::Conversions::copyToPython(SbkPySide6_QtCoreTypeConverters[SBK_QString_IDX], &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_Akonadi_AgentConfigurationBaseFunc_load(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::AgentConfigurationBase *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentConfigurationBase_IDX]), reinterpret_cast<SbkObject *>(self)));
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // AgentConfigurationBase::load()
        Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
            ? cppSelf->::Akonadi::AgentConfigurationBase::load()
            : cppSelf->load();
    }

     return Sbk_ReturnFromPython_None();
}

static PyObject *Sbk_Akonadi_AgentConfigurationBaseFunc_save(PyObject *self)
{
    if (!Shiboken::Object::isValid(self))
        return {};
    [[maybe_unused]] auto *cppSelf = reinterpret_cast< ::Akonadi::AgentConfigurationBase *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentConfigurationBase_IDX]), reinterpret_cast<SbkObject *>(self)));
    PyObject *pyResult{};
    Shiboken::PythonContextMarker pcm;

    // Call function/method
    {

        // AgentConfigurationBase::save()const->bool
        bool cppResult = Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))
            ? const_cast<const ::Akonadi::AgentConfigurationBase *>(cppSelf)->::Akonadi::AgentConfigurationBase::save()
            : const_cast<const ::Akonadi::AgentConfigurationBase *>(cppSelf)->save();
        pyResult = Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<bool>(), &cppResult);
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}


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

static PyMethodDef Sbk_Akonadi_AgentConfigurationBase_methods[] = {
    {"identifier", reinterpret_cast<PyCFunction>(Sbk_Akonadi_AgentConfigurationBaseFunc_identifier), METH_NOARGS, nullptr},
    {"load", reinterpret_cast<PyCFunction>(Sbk_Akonadi_AgentConfigurationBaseFunc_load), METH_NOARGS, nullptr},
    {"save", reinterpret_cast<PyCFunction>(Sbk_Akonadi_AgentConfigurationBaseFunc_save), METH_NOARGS, nullptr},
    {nullptr, nullptr, 0, nullptr} // Sentinel
};

static int Sbk_Akonadi_AgentConfigurationBase_setattro(PyObject *self, PyObject *name, PyObject *value)
{
    PySide::Feature::Select(self);
    if (value != nullptr && PyCallable_Check(value) != 0) {
        auto plain_inst = reinterpret_cast< ::Akonadi::AgentConfigurationBase *>(Shiboken::Conversions::cppPointer(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentConfigurationBase_IDX]), reinterpret_cast<SbkObject *>(self)));
        auto *inst = dynamic_cast<AgentConfigurationBaseWrapper *>(plain_inst);
        if (inst != nullptr)
            inst->resetPyMethodCache();
    }
    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_Akonadi_AgentConfigurationBase_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_Akonadi_AgentConfigurationBase_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_Akonadi_AgentConfigurationBase_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(&SbkDeallocWrapper)},
    {Py_tp_setattro,    reinterpret_cast<void *>(Sbk_Akonadi_AgentConfigurationBase_setattro)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_Akonadi_AgentConfigurationBase_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_Akonadi_AgentConfigurationBase_clear)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_Akonadi_AgentConfigurationBase_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_Akonadi_AgentConfigurationBase_Init)},
    {Py_tp_new,         reinterpret_cast<void *>(SbkDummyNew /* PYSIDE-595: Prevent replacement of "0" with base->tp_new. */)},
    {0, nullptr}
};
static PyType_Spec Sbk_Akonadi_AgentConfigurationBase_spec = {
    "1:AkonadiCore.Akonadi.AgentConfigurationBase",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_Akonadi_AgentConfigurationBase_slots
};

} //extern "C"

static void *Sbk_Akonadi_AgentConfigurationBase_typeDiscovery([[maybe_unused]] void *cptr, [[maybe_unused]] PyTypeObject *instanceType)
{
    if (instanceType == Shiboken::SbkType< ::QObject >())
        return dynamic_cast< ::Akonadi::AgentConfigurationBase *>(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 AgentConfigurationBase_PythonToCpp_AgentConfigurationBase_PTR(PyObject *pyIn, void *cppOut)
{
    Shiboken::Conversions::pythonToCppPointer(Sbk_Akonadi_AgentConfigurationBase_TypeF(), pyIn, cppOut);
}
static PythonToCppFunc is_AgentConfigurationBase_PythonToCpp_AgentConfigurationBase_PTR_Convertible(PyObject *pyIn)
{
    if (pyIn == Py_None)
        return Shiboken::Conversions::nonePythonToCppNullPtr;
    if (PyObject_TypeCheck(pyIn, Sbk_Akonadi_AgentConfigurationBase_TypeF()))
        return AgentConfigurationBase_PythonToCpp_AgentConfigurationBase_PTR;
    return {};
}

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

}

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
#if PYSIDE6_COMOPT_COMPRESS == 0
static const char *Akonadi_AgentConfigurationBase_SignatureStrings[] = {
    "AkonadiCore.Akonadi.AgentConfigurationBase.identifier(self)->QString",
    "AkonadiCore.Akonadi.AgentConfigurationBase.load(self)",
    "AkonadiCore.Akonadi.AgentConfigurationBase.save(self)->bool",
    nullptr}; // Sentinel
#else
static constexpr size_t Akonadi_AgentConfigurationBase_SignatureByteSize = 94;
static constexpr uint8_t Akonadi_AgentConfigurationBase_SignatureBytes[94] = {
    0x78, 0xda, 0x73, 0xcc, 0xce, 0xcf, 0x4b, 0x4c, 0xc9, 0x74, 0xce, 0x2f, 0x4a, 0xd5, 0x73, 0x84,
    0xb0, 0xf5, 0x1c, 0xd3, 0x53, 0xf3, 0x4a, 0x9c, 0xf3, 0xf3, 0xd2, 0x32, 0xd3, 0x4b, 0x8b, 0x12,
    0x4b, 0x32, 0xf3, 0xf3, 0x9c, 0x12, 0x8b, 0x53, 0xf5, 0x32, 0x53, 0x80, 0xc2, 0x99, 0x69, 0x99,
    0xa9, 0x45, 0x1a, 0xc5, 0xa9, 0x39, 0x69, 0x9a, 0xba, 0x76, 0x81, 0xc1, 0x25, 0x45, 0x99, 0x79,
    0xe9, 0x5c, 0x8e, 0xc4, 0x1b, 0x92, 0x93, 0x9f, 0x98, 0x02, 0xd1, 0x4e, 0x8a, 0xae, 0xe2, 0xc4,
    0xb2, 0x54, 0x98, 0xa5, 0x49, 0xf9, 0xf9, 0x39, 0x5c, 0x00, 0x81, 0x3c, 0x43, 0x95
};
#endif

PyTypeObject *init_Akonadi_AgentConfigurationBase(PyObject *enclosingClass)
{
    auto &typeStruct = SbkAkonadiCoreTypeStructs[SBK_Akonadi_AgentConfigurationBase_IDX];
    if (typeStruct.type != nullptr)
        return typeStruct.type;

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

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        enclosingClass,
        "AgentConfigurationBase",
        "Akonadi::AgentConfigurationBase*",
        &Sbk_Akonadi_AgentConfigurationBase_spec,
        &Shiboken::callCppDestructor< Akonadi::AgentConfigurationBase >,
        Sbk_Akonadi_AgentConfigurationBase_Type_bases.object(),
        Shiboken::ObjectType::WrapperFlags::InnerClass);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, Akonadi_AgentConfigurationBase_SignatureStrings);
#else
    InitSignatureBytes(pyType, Akonadi_AgentConfigurationBase_SignatureBytes, Akonadi_AgentConfigurationBase_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_Akonadi_AgentConfigurationBase_PropertyStrings);
    typeStruct.type = pyType;

    // Register Converter
    SbkConverter *converter = Shiboken::Conversions::createConverter(pyType,
        AgentConfigurationBase_PythonToCpp_AgentConfigurationBase_PTR,
        is_AgentConfigurationBase_PythonToCpp_AgentConfigurationBase_PTR_Convertible,
        AgentConfigurationBase_PTR_CppToPython_AgentConfigurationBase);

    Shiboken::Conversions::registerConverterName(converter, "Akonadi::AgentConfigurationBase");
    Shiboken::Conversions::registerConverterName(converter, "Akonadi::AgentConfigurationBase*");
    Shiboken::Conversions::registerConverterName(converter, "Akonadi::AgentConfigurationBase&");
    Shiboken::Conversions::registerConverterAlias(converter, "AgentConfigurationBase");
    Shiboken::Conversions::registerConverterAlias(converter, "AgentConfigurationBase*");
    Shiboken::Conversions::registerConverterAlias(converter, "AgentConfigurationBase&");
    Shiboken::Conversions::registerConverterName(converter, typeid(::Akonadi::AgentConfigurationBase).name());
    Shiboken::Conversions::registerConverterName(converter, typeid(AgentConfigurationBaseWrapper).name());

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

    PySide::Signal::registerSignals(pyType, &::Akonadi::AgentConfigurationBase::staticMetaObject);
    Shiboken::ObjectType::setSubTypeInitHook(pyType, &PySide::initQObjectSubType);
    PySide::initDynamicMetaObject(pyType, &::Akonadi::AgentConfigurationBase::staticMetaObject, sizeof(AgentConfigurationBaseWrapper));

    return pyType;
}
