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

Everything the engine knows about one field, from its schema property. More...

#include <field_model.hpp>

Public Attributes

std::string name
 The wire name.
std::string path
 The path from the action: name, parent.name, or rows[].name for a collection's member.
FieldKind kind = FieldKind::Text
 The control and encoder.
std::string jsonType
 The first declared JSON type ("integer", …), empty when the property declares none.
std::string title
 The schema's title, or the wire name.
std::string help
 The schema's description.
std::string placeholder
 x-placeholder.
std::string i18nKey
 x-i18nKey: the explicit message-key stem, empty when none is declared.
bool required = false
 Named in the containing object's required.
BlankAs blankAs = BlankAs::Omit
 x-blankAs (Text and Multiline only): whether a cleared field submits "".
bool readOnly = false
 x-readonly.
bool hidden = false
 x-hidden.
std::vector< std::string > computedInputs
 x-computed.inputs: the members a computed field derives from.
std::optional< std::string > minimum
 minimum, as canonical decimal text.
std::optional< std::string > maximum
 maximum, as canonical decimal text.
std::optional< std::string > multipleOf
 A positive multipleOf, as canonical decimal text.
std::optional< std::string > exactMinimum
 x-exactMinimum: an integer bound's exact digits.
std::optional< std::string > exactMaximum
 x-exactMaximum: an integer bound's exact digits.
std::optional< math::Rational > instanceMinimum
 x-minimum: a per-instance lower bound (InstanceConstraints::decorate).
std::optional< math::Rational > instanceMaximum
 x-maximum: a per-instance upper bound.
std::optional< std::uint32_t > decimalPlaces
 x-decimalPlaces: the declared precision of a Decimal or Quantity.
std::optional< std::uint32_t > displayDecimals
 x-displayDecimals: a plain Number's entry and display precision.
std::string unit
 The display unit (ExtUnits.unitUnicode, else unitAscii), empty when none.
std::string unitAscii
 ExtUnits.unitAscii.
std::vector< UnitOption > units
 A Decimal's or Quantity's entry units: the canonical one first, then x-unitAlternatives.
std::size_t entryUnit = 0
 The index into units a draft starts in (and returns to on prefill and reset): 0, the canonical unit, unless a field overlay's unit names another.
std::vector< ChoiceOption > enumOptions
 An Enum's options, in schema order.
std::optional< ChoiceSpec > choice
 A Choice's options source.
std::optional< std::size_t > group
 x-section: the index of the x-layout group the field sits in.
int colspan = 1
 x-colspan: grid columns the field spans (at least 1).
std::string widget
 x-widget, empty when none.
std::int64_t sliderMin = 0
 A Slider's track minimum (x-min).
std::int64_t sliderMax = 100
 A Slider's track maximum (x-max).
std::int64_t sliderStep = 1
 A Slider's increment (x-step, at least 1).
std::string itemType
 An Array's item JSON type ("string" when undeclared).
std::vector< FieldSpec > children
 An Object's members, or an ObjectArray's element members, in x-order.
bool truncated = false
 An Object or ObjectArray whose members are not described: its $ref is already on the path, it is deeper than kMaxNestingDepth, or its schema states no members.
bool bytes = false
 A string member whose schema says contentEncoding: base64: its wire value is a file's bytes, which a document moves inline only under the session's inline cap.

Detailed Description

Everything the engine knows about one field, from its schema property.

Definition at line 160 of file field_model.hpp.

Member Data Documentation

◆ name

std::string morph::forms::FieldSpec::name

The wire name.

Definition at line 162 of file field_model.hpp.

◆ path

std::string morph::forms::FieldSpec::path

The path from the action: name, parent.name, or rows[].name for a collection's member.

Definition at line 164 of file field_model.hpp.

◆ kind

FieldKind morph::forms::FieldSpec::kind = FieldKind::Text

The control and encoder.

Definition at line 166 of file field_model.hpp.

◆ jsonType

std::string morph::forms::FieldSpec::jsonType

The first declared JSON type ("integer", …), empty when the property declares none.

Definition at line 168 of file field_model.hpp.

◆ title

std::string morph::forms::FieldSpec::title

The schema's title, or the wire name.

Definition at line 170 of file field_model.hpp.

◆ help

std::string morph::forms::FieldSpec::help

The schema's description.

Definition at line 172 of file field_model.hpp.

◆ placeholder

std::string morph::forms::FieldSpec::placeholder

x-placeholder.

Definition at line 174 of file field_model.hpp.

◆ i18nKey

std::string morph::forms::FieldSpec::i18nKey

x-i18nKey: the explicit message-key stem, empty when none is declared.

Definition at line 176 of file field_model.hpp.

◆ required

bool morph::forms::FieldSpec::required = false

Named in the containing object's required.

Definition at line 178 of file field_model.hpp.

◆ blankAs

BlankAs morph::forms::FieldSpec::blankAs = BlankAs::Omit

x-blankAs (Text and Multiline only): whether a cleared field submits "".

Definition at line 180 of file field_model.hpp.

◆ readOnly

bool morph::forms::FieldSpec::readOnly = false

x-readonly.

Definition at line 182 of file field_model.hpp.

◆ hidden

bool morph::forms::FieldSpec::hidden = false

x-hidden.

Definition at line 184 of file field_model.hpp.

◆ computedInputs

std::vector<std::string> morph::forms::FieldSpec::computedInputs

x-computed.inputs: the members a computed field derives from.

Definition at line 186 of file field_model.hpp.

◆ minimum

std::optional<std::string> morph::forms::FieldSpec::minimum

minimum, as canonical decimal text.

Definition at line 188 of file field_model.hpp.

◆ maximum

std::optional<std::string> morph::forms::FieldSpec::maximum

maximum, as canonical decimal text.

Definition at line 190 of file field_model.hpp.

◆ multipleOf

std::optional<std::string> morph::forms::FieldSpec::multipleOf

A positive multipleOf, as canonical decimal text.

Definition at line 192 of file field_model.hpp.

◆ exactMinimum

std::optional<std::string> morph::forms::FieldSpec::exactMinimum

x-exactMinimum: an integer bound's exact digits.

Definition at line 194 of file field_model.hpp.

◆ exactMaximum

std::optional<std::string> morph::forms::FieldSpec::exactMaximum

x-exactMaximum: an integer bound's exact digits.

Definition at line 196 of file field_model.hpp.

◆ instanceMinimum

std::optional<math::Rational> morph::forms::FieldSpec::instanceMinimum

x-minimum: a per-instance lower bound (InstanceConstraints::decorate).

Definition at line 198 of file field_model.hpp.

◆ instanceMaximum

std::optional<math::Rational> morph::forms::FieldSpec::instanceMaximum

x-maximum: a per-instance upper bound.

Definition at line 200 of file field_model.hpp.

◆ decimalPlaces

std::optional<std::uint32_t> morph::forms::FieldSpec::decimalPlaces

x-decimalPlaces: the declared precision of a Decimal or Quantity.

Definition at line 202 of file field_model.hpp.

◆ displayDecimals

std::optional<std::uint32_t> morph::forms::FieldSpec::displayDecimals

x-displayDecimals: a plain Number's entry and display precision.

Definition at line 204 of file field_model.hpp.

◆ unit

std::string morph::forms::FieldSpec::unit

The display unit (ExtUnits.unitUnicode, else unitAscii), empty when none.

Definition at line 206 of file field_model.hpp.

◆ unitAscii

std::string morph::forms::FieldSpec::unitAscii

ExtUnits.unitAscii.

Definition at line 208 of file field_model.hpp.

◆ units

std::vector<UnitOption> morph::forms::FieldSpec::units

A Decimal's or Quantity's entry units: the canonical one first, then x-unitAlternatives.

Definition at line 210 of file field_model.hpp.

◆ entryUnit

std::size_t morph::forms::FieldSpec::entryUnit = 0

The index into units a draft starts in (and returns to on prefill and reset): 0, the canonical unit, unless a field overlay's unit names another.

Definition at line 213 of file field_model.hpp.

◆ enumOptions

std::vector<ChoiceOption> morph::forms::FieldSpec::enumOptions

An Enum's options, in schema order.

Definition at line 215 of file field_model.hpp.

◆ choice

std::optional<ChoiceSpec> morph::forms::FieldSpec::choice

A Choice's options source.

Definition at line 217 of file field_model.hpp.

◆ group

std::optional<std::size_t> morph::forms::FieldSpec::group

x-section: the index of the x-layout group the field sits in.

Definition at line 219 of file field_model.hpp.

◆ colspan

int morph::forms::FieldSpec::colspan = 1

x-colspan: grid columns the field spans (at least 1).

Definition at line 221 of file field_model.hpp.

◆ widget

std::string morph::forms::FieldSpec::widget

x-widget, empty when none.

Definition at line 223 of file field_model.hpp.

◆ sliderMin

std::int64_t morph::forms::FieldSpec::sliderMin = 0

A Slider's track minimum (x-min).

Definition at line 225 of file field_model.hpp.

◆ sliderMax

std::int64_t morph::forms::FieldSpec::sliderMax = 100

A Slider's track maximum (x-max).

Definition at line 227 of file field_model.hpp.

◆ sliderStep

std::int64_t morph::forms::FieldSpec::sliderStep = 1

A Slider's increment (x-step, at least 1).

Definition at line 229 of file field_model.hpp.

◆ itemType

std::string morph::forms::FieldSpec::itemType

An Array's item JSON type ("string" when undeclared).

Definition at line 231 of file field_model.hpp.

◆ children

std::vector<FieldSpec> morph::forms::FieldSpec::children

An Object's members, or an ObjectArray's element members, in x-order.

Definition at line 233 of file field_model.hpp.

◆ truncated

bool morph::forms::FieldSpec::truncated = false

An Object or ObjectArray whose members are not described: its $ref is already on the path, it is deeper than kMaxNestingDepth, or its schema states no members.

Definition at line 236 of file field_model.hpp.

◆ bytes

bool morph::forms::FieldSpec::bytes = false

A string member whose schema says contentEncoding: base64: its wire value is a file's bytes, which a document moves inline only under the session's inline cap.

Definition at line 239 of file field_model.hpp.


The documentation for this struct was generated from the following file: