morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::forms::ReadonlyWhen< V, A, Cond > Struct Template Reference

Presentation rule: the listed field is editable only while Cond does not hold (the field is read-only while when holds). Never gates allRulesSatisfied, exactly like VisibleWhen. More...

#include <forms.hpp>

Public Member Functions

constexpr bool test (const A &action) const noexcept
 Always true: presentation rules never gate submission. A renderer inspects when directly (not this method) to decide the field's editability.
glz::generic_u64 emitNode () const
 Emits this rule's x-rules JSON node.

Public Attributes

V A::* field
 Pointer to the member whose editability this rule controls.
Cond when
 The condition that, when true, makes field read-only.

Static Public Attributes

static constexpr detail::RuleKind kind = detail::RuleKind::ReadonlyWhen
 The wire "kind" this rule emits: "readonlyWhen".
static constexpr bool isPresentation = true
 Presentation rule: never participates in the gate.

Detailed Description

template<typename V, typename A, typename Cond>
struct morph::forms::ReadonlyWhen< V, A, Cond >

Presentation rule: the listed field is editable only while Cond does not hold (the field is read-only while when holds). Never gates allRulesSatisfied, exactly like VisibleWhen.

Template Parameters
VField member type.
AAction type the field belongs to.
CondCondition node type.

Definition at line 1691 of file forms.hpp.

Member Function Documentation

◆ test()

template<typename V, typename A, typename Cond>
bool morph::forms::ReadonlyWhen< V, A, Cond >::test ( const A & action) const
inlinenodiscardconstexprnoexcept

Always true: presentation rules never gate submission. A renderer inspects when directly (not this method) to decide the field's editability.

Parameters
actionUnused (kept for interface uniformity with every other rule node).
Returns
true, unconditionally.

Definition at line 1707 of file forms.hpp.

◆ emitNode()

template<typename V, typename A, typename Cond>
glz::generic_u64 morph::forms::ReadonlyWhen< V, A, Cond >::emitNode ( ) const
inlinenodiscard

Emits this rule's x-rules JSON node.

Returns
{"kind":"readonlyWhen","fields":["<wire name>"],"when":{...}}.

Definition at line 1714 of file forms.hpp.

Member Data Documentation

◆ field

template<typename V, typename A, typename Cond>
V A::* morph::forms::ReadonlyWhen< V, A, Cond >::field

Pointer to the member whose editability this rule controls.

Definition at line 1693 of file forms.hpp.

◆ when

template<typename V, typename A, typename Cond>
Cond morph::forms::ReadonlyWhen< V, A, Cond >::when

The condition that, when true, makes field read-only.

Definition at line 1695 of file forms.hpp.

◆ kind

template<typename V, typename A, typename Cond>
detail::RuleKind morph::forms::ReadonlyWhen< V, A, Cond >::kind = detail::RuleKind::ReadonlyWhen
staticconstexpr

The wire "kind" this rule emits: "readonlyWhen".

Definition at line 1697 of file forms.hpp.

◆ isPresentation

template<typename V, typename A, typename Cond>
bool morph::forms::ReadonlyWhen< V, A, Cond >::isPresentation = true
staticconstexpr

Presentation rule: never participates in the gate.

Definition at line 1699 of file forms.hpp.


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