.. index:: pair: class; EE::UI::UIValueValidationState .. _doxid-class_e_e_1_1_u_i_1_1_u_i_value_validation_state: class EE::UI::UIValueValidationState ==================================== .. toctree:: :hidden: Overview ~~~~~~~~ Observable current validation result shared by :ref:`UI ` value binding implementations. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class UIValueValidationState { public: // typedefs typedef std::function`&:ref:`result`)> :target:`Callback`; typedef :ref:`ObservableValue`<:ref:`UIValueValidationResult`>:::ref:`Connection` :target:`Connection`; // construction :target:`UIValueValidationState`(); :target:`UIValueValidationState`(const UIValueValidationState&); :target:`UIValueValidationState`(UIValueValidationState&&); // methods UIValueValidationState& :target:`operator=`(const UIValueValidationState&); UIValueValidationState& :target:`operator=`(UIValueValidationState&&); bool :target:`isValid`() const; const :ref:`UIValueValidationResult`& :target:`result`() const; const std::optional<:ref:`UIValueValidationResult::Code`>& :target:`code`() const; const std::optional& :target:`debugMessage`() const; :ref:`Connection` :ref:`observe`(:ref:`Callback` callback); void :ref:`set`(:ref:`UIValueValidationResult` result); void :target:`clear`(); }; .. _details-class_e_e_1_1_u_i_1_1_u_i_value_validation_state: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Observable current validation result shared by :ref:`UI ` value binding implementations. Reading validity never allocates. Observer storage is created lazily by :ref:`observe() `, keeping the ordinary unobserved binding path inexpensive. Notifications are synchronous and use the same snapshot semantics as :ref:`ObservableValue `. Methods ------- .. index:: pair: function; observe .. _doxid-class_e_e_1_1_u_i_1_1_u_i_value_validation_state_1a443076f6d2dd2bf841d6a409d63afd71: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Connection` observe(:ref:`Callback` callback) Observes later result changes. The current result is available through :ref:`result() `. .. index:: pair: function; set .. _doxid-class_e_e_1_1_u_i_1_1_u_i_value_validation_state_1ac8dadc5dd885176414320f29be90c12d: .. ref-code-block:: cpp :class: doxyrest-title-code-block void set(:ref:`UIValueValidationResult` result) Updates the current result and notifies observers only when it actually changed.