#ifndef SBK_ATTRIBUTEWRAPPER_H
#define SBK_ATTRIBUTEWRAPPER_H

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

#include <attribute.h>

#include <sbkpython.h>

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

class AttributeWrapper : public Akonadi::Attribute
{
public:
    AttributeWrapper();
    AttributeWrapper(const AttributeWrapper &) = delete;
    AttributeWrapper(const Akonadi::Attribute& self) : Akonadi::Attribute(self)
    {
    }
    AttributeWrapper& operator=(const AttributeWrapper &) = delete;
    AttributeWrapper(AttributeWrapper &&) = delete;
    AttributeWrapper& operator=(AttributeWrapper &&) = delete;
    ~AttributeWrapper() override;

    ::Akonadi::Attribute * clone() const override;
    static ::Akonadi::Attribute * 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 deserialize(const ::QByteArray & data) override;
    static void sbk_o_deserialize([[maybe_unused]] const char *ownerClassName, [[maybe_unused]] const char *funcName, [[maybe_unused]] Shiboken::GilState &gil, [[maybe_unused]] const Shiboken::AutoDecRef &pyOverride, [[maybe_unused]] const ::QByteArray & data);
    ::QByteArray serialized() const override;
    ::QByteArray type() const override;
    static void pysideInitQtMetaTypes();

    void resetPyMethodCache();

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

#endif // SBK_ATTRIBUTEWRAPPER_H
