#ifndef SBK_TODOMODELWRAPPER_H
#define SBK_TODOMODELWRAPPER_H

// Workaround to access protected functions
#ifndef protected
#  define protected public
#endif

#include <todomodel.h>

#include <sbkpython.h>

#include <array>
namespace Shiboken { struct AutoDecRef; class GilState; }

class TodoModelWrapper : public Akonadi::TodoModel
{
public:
    TodoModelWrapper(::QObject * parent = nullptr);
    TodoModelWrapper(const TodoModelWrapper &) = delete;
    TodoModelWrapper& operator=(const TodoModelWrapper &) = delete;
    TodoModelWrapper(TodoModelWrapper &&) = delete;
    TodoModelWrapper& operator=(TodoModelWrapper &&) = delete;
    ~TodoModelWrapper() override;

    int columnCount(const ::QModelIndex & parent = QModelIndex()) const override;
    static int sbk_o_columnCount([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QModelIndex & parent = QModelIndex());
    ::QVariant data(const ::QModelIndex & index, int role) const override;
    static ::QVariant sbk_o_data([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QModelIndex & index, [[maybe_unused]] int role);
    bool dropMimeData(const ::QMimeData * data, ::Qt::DropAction action, int row, int column, const ::QModelIndex & parent) override;
    static bool sbk_o_dropMimeData([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QMimeData * data, [[maybe_unused]] ::Qt::DropAction action, [[maybe_unused]] int row, [[maybe_unused]] int column, [[maybe_unused]] const ::QModelIndex & parent);
    ::QVariant extraColumnData(const ::QModelIndex & parent, int row, int extraColumn, int role = Qt::DisplayRole) const override;
    static ::QVariant sbk_o_extraColumnData([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QModelIndex & parent, [[maybe_unused]] int row, [[maybe_unused]] int extraColumn, [[maybe_unused]] int role = Qt::DisplayRole);
    ::QFlags<Qt::ItemFlag> flags(const ::QModelIndex & index) const override;
    static ::QFlags<Qt::ItemFlag> sbk_o_flags([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QModelIndex & index);
    ::QVariant headerData(int column, ::Qt::Orientation orientation, int role) const override;
    static ::QVariant sbk_o_headerData([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] int column, [[maybe_unused]] ::Qt::Orientation orientation, [[maybe_unused]] int role);
    ::QMimeData * mimeData(const ::QList<QModelIndex> & indexes) const override;
    static ::QMimeData * sbk_o_mimeData([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QList<QModelIndex> & indexes);
    ::QStringList mimeTypes() const override;
    static ::QStringList sbk_o_mimeTypes([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride);
    ::QHash<int,QByteArray> roleNames() const override;
    static ::QHash<int,QByteArray> sbk_o_roleNames([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride);
    bool setData(const ::QModelIndex & index, const ::QVariant & value, int role) override;
    static bool sbk_o_setData([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QModelIndex & index, [[maybe_unused]] const ::QVariant & value, [[maybe_unused]] int role);
    void setSourceModel(::QAbstractItemModel * sourceModel) override;
    static void sbk_o_setSourceModel([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] ::QAbstractItemModel * sourceModel);
    ::QFlags<Qt::DropAction> supportedDropActions() const override;
    static ::QFlags<Qt::DropAction> sbk_o_supportedDropActions([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride);
    static void pysideInitQtMetaTypes();

    void resetPyMethodCache();

private:
    mutable std::array<PyObject *, 12> m_PyMethodCache = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
};

#endif // SBK_TODOMODELWRAPPER_H
