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

A string field edited as a multi-line text area. More...

#include <widget_hints.hpp>

Public Member Functions

constexpr Multiline () noexcept=default
 Constructs the empty string.
 Multiline (std::string text) noexcept(std::is_nothrow_move_constructible_v< std::string >)
 Engages with text.
constexpr bool operator== (const Multiline &other) const =default
 Equality on the text content.

Static Public Member Functions

static constexpr std::string_view widget () noexcept
 The preferred control id for this field.

Public Attributes

std::string value
 The text content.

Detailed Description

A string field edited as a multi-line text area.

Wire form: a plain JSON string (via the glz::meta specialisation below), exactly like an unwrapped std::string member — Multiline changes only the rendering intent, never what travels. Because the payload is a bare std::string (not a std::optional), Multiline does not define hasValue(): like a plain std::string member, it is always considered engaged by allRequiredEngaged (see docs/spec/forms/forms.md, "Empty state").

Definition at line 42 of file widget_hints.hpp.

Constructor & Destructor Documentation

◆ Multiline()

morph::forms::Multiline::Multiline ( std::string text)
inlinenoexcept

Engages with text.

Parameters
textThe initial text content.

Definition at line 51 of file widget_hints.hpp.

Member Function Documentation

◆ widget()

constexpr std::string_view morph::forms::Multiline::widget ( )
inlinestaticnodiscardconstexprnoexcept

The preferred control id for this field.

Returns
"textarea".

Definition at line 55 of file widget_hints.hpp.

◆ operator==()

bool morph::forms::Multiline::operator== ( const Multiline & other) const
nodiscardconstexprdefault

Equality on the text content.

Parameters
otherMultiline to compare against.
Returns
true when both hold the same text.

Member Data Documentation

◆ value

std::string morph::forms::Multiline::value

The text content.

Definition at line 44 of file widget_hints.hpp.


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