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

// main header
#include "akonadi_trashsettings_wrapper.h"

// Argument includes
#include <QString>
#include <collection.h>

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

using namespace Akonadi;


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

extern "C" {
static int Sbk_Akonadi_TrashSettings_Init(PyObject *, PyObject *, PyObject *)
{
    Shiboken::Errors::setInstantiateNamespace("TrashSettings");
    return -1;
}

static PyObject *Sbk_Akonadi_TrashSettingsFunc_getTrashCollection([[maybe_unused]] PyObject *self, PyObject *pyArg)
{
    PyObject *pyResult{};
    Shiboken::AutoDecRef errInfo{};
    Shiboken::PythonContextMarker pcm;
    int overloadId = -1;
    [[maybe_unused]] Shiboken::Conversions::PythonToCppConversion pythonToCpp;

    // Overloaded function decisor
    // 0: static TrashSettings::getTrashCollection(const QString&)->Akonadi::Collection
    if ((pythonToCpp = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QString_IDX], (pyArg)))) {
        overloadId = 0; // static TrashSettings::getTrashCollection(const QString&)->Akonadi::Collection
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(pyArg, "getTrashCollection", SbkAkonadiCoreTypeStructs[SBK_AkonadiCoreAkonadi_TrashSettings_IDX]);

    // Call function/method
    {
        ::QString cppArg0;
        pythonToCpp(pyArg, &cppArg0);

        if (Shiboken::Errors::occurred() == nullptr) {
            // static TrashSettings::getTrashCollection(const QString&)->Akonadi::Collection
            Akonadi::Collection cppResult = ::Akonadi::TrashSettings::getTrashCollection(cppArg0);
            pyResult = Shiboken::Conversions::copyToPython(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_Collection_IDX]), &cppResult);
        }
    }

    return Sbk_ReturnFromPython_Result(pyResult);
}

static PyObject *Sbk_Akonadi_TrashSettingsFunc_setTrashCollection([[maybe_unused]] PyObject *self, PyObject *args)
{
    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

    if (PyArg_UnpackTuple(args, "setTrashCollection", 2, 2, &(pyArgs[0]), &(pyArgs[1])) == 0)
        return {};


    // Overloaded function decisor
    // 0: static TrashSettings::setTrashCollection(const QString&,const Akonadi::Collection&)
    if (numArgs == 2
        && (pythonToCpp[0] = Shiboken::Conversions::pythonToCppConversion(SbkPySide6_QtCoreTypeConverters[SBK_QString_IDX], (pyArgs[0])))
        && (pythonToCpp[1] = Shiboken::Conversions::pythonToCppReferenceConversion(Shiboken::Module::get(SbkAkonadiCoreTypeStructs[SBK_Akonadi_Collection_IDX]), (pyArgs[1])))) {
        overloadId = 0; // static TrashSettings::setTrashCollection(const QString&,const Akonadi::Collection&)
    }

    // Function signature not found.
    if (overloadId == -1)
        return Shiboken::returnWrongArguments(args, "setTrashCollection", SbkAkonadiCoreTypeStructs[SBK_AkonadiCoreAkonadi_TrashSettings_IDX]);

    // Call function/method
    {
        ::QString cppArg0;
        pythonToCpp[0](pyArgs[0], &cppArg0);
        if (!Shiboken::Object::isValid(pyArgs[1]))
            return {};
        ::Akonadi::Collection cppArg1_local;
        ::Akonadi::Collection *cppArg1 = &cppArg1_local;
        if (pythonToCpp[1].isValue())
            pythonToCpp[1](pyArgs[1], &cppArg1_local);
        else
            pythonToCpp[1](pyArgs[1], &cppArg1);


        if (Shiboken::Errors::occurred() == nullptr) {
            // static TrashSettings::setTrashCollection(const QString&,const Akonadi::Collection&)
            ::Akonadi::TrashSettings::setTrashCollection(cppArg0, *cppArg1);
        }
    }

     return Sbk_ReturnFromPython_None();
}


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

static PyMethodDef Sbk_Akonadi_TrashSettings_methods[] = {
    {"getTrashCollection", reinterpret_cast<PyCFunction>(Sbk_Akonadi_TrashSettingsFunc_getTrashCollection), METH_O|METH_STATIC, nullptr},
    {"setTrashCollection", reinterpret_cast<PyCFunction>(Sbk_Akonadi_TrashSettingsFunc_setTrashCollection), METH_VARARGS|METH_STATIC, nullptr},
    {nullptr, nullptr, 0, nullptr} // Sentinel
};

} // extern "C"

static int Sbk_Akonadi_TrashSettings_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_TrashSettings_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_TrashSettings_slots[] = {
    {Py_tp_base,        nullptr}, // inserted by introduceWrapperType
    {Py_tp_dealloc,     reinterpret_cast<void *>(Sbk_object_dealloc /* PYSIDE-832: Prevent replacement of "0" with subtype_dealloc. */)},
    {Py_tp_traverse,    reinterpret_cast<void *>(Sbk_Akonadi_TrashSettings_traverse)},
    {Py_tp_clear,       reinterpret_cast<void *>(Sbk_Akonadi_TrashSettings_clear)},
    {Py_tp_methods,     reinterpret_cast<void *>(Sbk_Akonadi_TrashSettings_methods)},
    {Py_tp_init,        reinterpret_cast<void *>(Sbk_Akonadi_TrashSettings_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_TrashSettings_spec = {
    "1:AkonadiCore.Akonadi.TrashSettings",
    sizeof(SbkObject),
    0,
    Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
    Sbk_Akonadi_TrashSettings_slots
};

} //extern "C"

// Type conversion functions.

// The signatures string for the functions.
// Multiple signatures have their index "n:" in front.
#if PYSIDE6_COMOPT_COMPRESS == 0
static const char *AkonadiCoreAkonadi_TrashSettings_SignatureStrings[] = {
    "AkonadiCore.Akonadi.TrashSettings.getTrashCollection(resource:QString)->AkonadiCore.Akonadi.Collection",
    "AkonadiCore.Akonadi.TrashSettings.setTrashCollection(resource:QString,collection:AkonadiCore.Akonadi.Collection)",
    nullptr}; // Sentinel
#else
static constexpr size_t AkonadiCoreAkonadi_TrashSettings_SignatureByteSize = 94;
static constexpr uint8_t AkonadiCoreAkonadi_TrashSettings_SignatureBytes[94] = {
    0x78, 0xda, 0x73, 0xcc, 0xce, 0xcf, 0x4b, 0x4c, 0xc9, 0x74, 0xce, 0x2f, 0x4a, 0xd5, 0x73, 0x84,
    0xb0, 0xf5, 0x42, 0x8a, 0x12, 0x8b, 0x33, 0x82, 0x53, 0x4b, 0x4a, 0x32, 0xf3, 0xd2, 0x8b, 0xf5,
    0xd2, 0x53, 0x4b, 0xc0, 0x02, 0xce, 0xf9, 0x39, 0x39, 0xa9, 0xc9, 0x25, 0x99, 0xf9, 0x79, 0x1a,
    0x45, 0xa9, 0xc5, 0xf9, 0xa5, 0x45, 0xc9, 0xa9, 0x56, 0x81, 0xc1, 0x25, 0x45, 0x40, 0x45, 0x9a,
    0xba, 0x76, 0x8e, 0x58, 0xcc, 0x41, 0xe8, 0xe0, 0x72, 0x24, 0x68, 0x4d, 0x31, 0x61, 0x6b, 0x74,
    0x92, 0xe1, 0x72, 0x56, 0xf8, 0xed, 0xd3, 0xe4, 0x02, 0x00, 0xb1, 0x64, 0x51, 0x96
};
#endif

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

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

    PyTypeObject *pyType = Shiboken::ObjectType::introduceWrapperType(
        enclosingClass,
        "TrashSettings",
        "Akonadi::TrashSettings",
        &Sbk_Akonadi_TrashSettings_spec,
        nullptr,
        Sbk_Akonadi_TrashSettings_Type_bases.object(),
        Shiboken::ObjectType::WrapperFlags::InnerClass);
#if PYSIDE6_COMOPT_COMPRESS == 0
    InitSignatureStrings(pyType, AkonadiCoreAkonadi_TrashSettings_SignatureStrings);
#else
    InitSignatureBytes(pyType, AkonadiCoreAkonadi_TrashSettings_SignatureBytes, AkonadiCoreAkonadi_TrashSettings_SignatureByteSize);
#endif
    SbkObjectType_SetPropertyStrings(pyType, Sbk_Akonadi_TrashSettings_PropertyStrings);
    typeStruct.type = pyType;



    return pyType;
}
