#ifndef SBK_PERSISTENTSEARCHATTRIBUTEWRAPPER_H
#define SBK_PERSISTENTSEARCHATTRIBUTEWRAPPER_H

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

#include <persistentsearchattribute.h>

#include <sbkpython.h>

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

class PersistentSearchAttributeWrapper : public Akonadi::PersistentSearchAttribute
{
public:
    PersistentSearchAttributeWrapper();
    PersistentSearchAttributeWrapper(const PersistentSearchAttributeWrapper &) = delete;
    PersistentSearchAttributeWrapper& operator=(const PersistentSearchAttributeWrapper &) = delete;
    PersistentSearchAttributeWrapper(PersistentSearchAttributeWrapper &&) = delete;
    PersistentSearchAttributeWrapper& operator=(PersistentSearchAttributeWrapper &&) = delete;
    ~PersistentSearchAttributeWrapper() override;

    ::Akonadi::Attribute * clone() const override;
    void deserialize(const ::QByteArray & data) override;
    ::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_PERSISTENTSEARCHATTRIBUTEWRAPPER_H
