#ifndef SBK_INCIDENCEWRAPPER_H
#define SBK_INCIDENCEWRAPPER_H

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

#include <incidence.h>

#include <sbkpython.h>

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

class IncidenceWrapper : public KCalendarCore::Incidence
{
public:
    IncidenceWrapper(const IncidenceWrapper &) = delete;
    IncidenceWrapper& operator=(const IncidenceWrapper &) = delete;
    IncidenceWrapper(IncidenceWrapper &&) = delete;
    IncidenceWrapper& operator=(IncidenceWrapper &&) = delete;
    ~IncidenceWrapper() override;

    ::KCalendarCore::Incidence * clone() const override;
    static ::KCalendarCore::Incidence * sbk_o_clone([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride);
    void customPropertyUpdate() override;
    void customPropertyUpdated() override;
    ::QDateTime dateTime(::KCalendarCore::IncidenceBase::DateTimeRole role) const override;
    void deserialize(::QDataStream & in) override;
    ::QDateTime dtStart() const override;
    ::QDateTime endDateForStart(const ::QDateTime & startDt) const override;
    static ::QDateTime sbk_o_endDateForStart([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QDateTime & startDt);
    bool equals(const ::KCalendarCore::IncidenceBase & incidence) const override;
    ::QLatin1String iconName(const ::QDateTime & recurrenceId = {}) const override;
    static ::QLatin1String sbk_o_iconName([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QDateTime & recurrenceId = {});
    ::QLatin1String mimeType() const override;
    ::QDateTime recurrenceId() const override;
    void recurrenceUpdated(::KCalendarCore::Recurrence * recurrence) override;
    bool recursOn(const ::QDate & date, const ::QTimeZone & timeZone) const override;
    static bool sbk_o_recursOn([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QDate & date, [[maybe_unused]] const ::QTimeZone & timeZone);
    void serialize(::QDataStream & out) const override;
    void setAllDay(bool allDay) override;
    void setDateTime(const ::QDateTime & dateTime, ::KCalendarCore::IncidenceBase::DateTimeRole role) override;
    void setDtStart(const ::QDateTime & dt) override;
    void setDuration(const ::KCalendarCore::Duration & duration) override;
    void setLastModified(const ::QDateTime & lm) override;
    void setReadOnly(bool readonly) override;
    void shiftTimes(const ::QTimeZone & oldZone, const ::QTimeZone & newZone) override;
    ::QList<QDateTime> startDateTimesForDate(const ::QDate & date, const ::QTimeZone & timeZone) const override;
    static ::QList<QDateTime> sbk_o_startDateTimesForDate([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QDate & date, [[maybe_unused]] const ::QTimeZone & timeZone);
    ::QList<QDateTime> startDateTimesForDateTime(const ::QDateTime & datetime) const override;
    static ::QList<QDateTime> sbk_o_startDateTimesForDateTime([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QDateTime & datetime);
    bool supportsGroupwareCommunication() const override;
    static bool sbk_o_supportsGroupwareCommunication([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride);
    ::KCalendarCore::IncidenceBase::IncidenceType type() const override;
    ::QByteArray typeStr() const override;
    void virtual_hook(::KCalendarCore::IncidenceBase::VirtualHook id, void * data) override;
    static void pysideInitQtMetaTypes();

    void resetPyMethodCache();

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

#endif // SBK_INCIDENCEWRAPPER_H
