#pragma once #include #include #include class GWidget; class VBWidget; class VBProperty { friend class VBWidget; public: VBProperty(VBWidget&, const String& name, const GVariant& value); VBProperty(VBWidget&, const String& name, Function&& getter, Function&& setter); ~VBProperty(); String name() const { return m_name; } const GVariant& value() const { return m_value; } void set_value(const GVariant&); bool is_readonly() const { return m_readonly; } void set_readonly(bool b) { m_readonly = b; } void sync(); private: VBWidget& m_widget; String m_name; GVariant m_value; Function m_getter; Function m_setter; bool m_readonly { false }; };