morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::forms::FieldView Class Reference

A field's spec and state, handed to an override: what it shows (the value, the draft, the errors, the options) and what it writes (the draft). Copyable; valid while the session lives. More...

#include <overrides.hpp>

Public Member Functions

 FieldView (FormSession &session, FieldState &state, std::shared_ptr< FormViewOptions const > options) noexcept
FieldSpec const & spec () const noexcept
 The field's spec.
FieldState & state () const noexcept
 The field's state: draft, encoding, error, visibility, options. Writing its text() is a user edit.
FormSession & session () const noexcept
 The session the field belongs to.
ui::Node defaultControl () const
 The control formView draws for this field without overrides, for an override to wrap.

Detailed Description

A field's spec and state, handed to an override: what it shows (the value, the draft, the errors, the options) and what it writes (the draft). Copyable; valid while the session lives.

Definition at line 28 of file overrides.hpp.

Constructor & Destructor Documentation

◆ FieldView()

morph::forms::FieldView::FieldView ( FormSession & session,
FieldState & state,
std::shared_ptr< FormViewOptions const > options )
inlinenoexcept
Parameters
sessionThe session. Borrowed.
stateThe field. Borrowed.
optionsThe view options the form is drawn with.

Definition at line 33 of file overrides.hpp.

Member Function Documentation

◆ spec()

FieldSpec const & morph::forms::FieldView::spec ( ) const
inlinenodiscardnoexcept

The field's spec.

Returns
The spec.

Definition at line 38 of file overrides.hpp.

◆ state()

FieldState & morph::forms::FieldView::state ( ) const
inlinenodiscardnoexcept

The field's state: draft, encoding, error, visibility, options. Writing its text() is a user edit.

Returns
The state.

Definition at line 42 of file overrides.hpp.

◆ session()

FormSession & morph::forms::FieldView::session ( ) const
inlinenodiscardnoexcept

The session the field belongs to.

Returns
The session.

Definition at line 46 of file overrides.hpp.

◆ defaultControl()

ui::Node morph::forms::FieldView::defaultControl ( ) const
inlinenodiscard

The control formView draws for this field without overrides, for an override to wrap.

Returns
The control.

Definition at line 498 of file form_view.hpp.


The documentation for this class was generated from the following files: