#ifndef SBK_RULEOBSERVERWRAPPER_H
#define SBK_RULEOBSERVERWRAPPER_H

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

#include <recurrencerule.h>

#include <sbkpython.h>

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

class RuleObserverWrapper : public KCalendarCore::RecurrenceRule::RuleObserver
{
public:
    RuleObserverWrapper();
    RuleObserverWrapper(const RuleObserverWrapper &) = delete;
    RuleObserverWrapper& operator=(const RuleObserverWrapper &) = delete;
    RuleObserverWrapper(RuleObserverWrapper &&) = delete;
    RuleObserverWrapper& operator=(RuleObserverWrapper &&) = delete;
    ~RuleObserverWrapper() override;

    void recurrenceChanged(::KCalendarCore::RecurrenceRule * arg__1) override;
    static void sbk_o_recurrenceChanged([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] ::KCalendarCore::RecurrenceRule * arg__1);
    static void pysideInitQtMetaTypes();

    void resetPyMethodCache();

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

#endif // SBK_RULEOBSERVERWRAPPER_H
