#ifndef SBK_STATISTICSPROXYMODELWRAPPER_H
#define SBK_STATISTICSPROXYMODELWRAPPER_H

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

#include <statisticsproxymodel.h>

#include <sbkpython.h>

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

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

    ::QVariant data(const ::QModelIndex & index, int role = Qt::DisplayRole) 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 = Qt::DisplayRole);
    ::QVariant extraColumnData(const ::QModelIndex & parent, int row, int extraColumn, int role) 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);
    ::QFlags<Qt::ItemFlag> flags(const ::QModelIndex & index) const override;
    ::QList<QModelIndex> match(const ::QModelIndex & start, int role, const ::QVariant & value, int hits = 1, ::QFlags<Qt::MatchFlag> flags = Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchWrap)) const override;
    void setSourceModel(::QAbstractItemModel * model) 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 * model);
    static void pysideInitQtMetaTypes();

    void resetPyMethodCache();

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

#endif // SBK_STATISTICSPROXYMODELWRAPPER_H
