#ifndef SBK_ALARMWRAPPER_H
#define SBK_ALARMWRAPPER_H

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

#include <alarm.h>

#include <sbkpython.h>

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

class AlarmWrapper : public KCalendarCore::Alarm
{
public:
    AlarmWrapper(::KCalendarCore::Incidence * parent);
    AlarmWrapper(const AlarmWrapper &) = delete;
    AlarmWrapper(const KCalendarCore::Alarm& self) : KCalendarCore::Alarm(self)
    {
    }
    AlarmWrapper& operator=(const AlarmWrapper &) = delete;
    AlarmWrapper(AlarmWrapper &&) = delete;
    AlarmWrapper& operator=(AlarmWrapper &&) = delete;
    ~AlarmWrapper() override;

    void customPropertyUpdate() override;
    void customPropertyUpdated() override;
    void virtual_hook(int id, void * data) override;
    static void pysideInitQtMetaTypes();

    void resetPyMethodCache();

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

#endif // SBK_ALARMWRAPPER_H
