Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::ui::TextProperty Class Reference

Copyable observing text property; copies own their resolver and last-operation result. Mutation is UI-affine, outside frames/preparation and nested text mutations. Caption changes use setControlText; editor changes accept a draft and apply its configured EditMode confirmation rules. Every rejected mutation preserves its target value and reports to the live scene collector on UI. WRONG_THREAD and an absent/destroyed scene are observable through result(), without unsafe reporting. Within an entered UI setup scope, even an unavailable target failure stops that setup after the callback returns. It never notifies a foreign owner; outside setup, existing runtime recovery remains unchanged. Each successful operation stands independently; a later failure does not roll back earlier changes. Methods return an owning proxy value so chains and saved results never borrow a temporary proxy. Resolver capture construction can throw before entry. Internally allocation/extension exceptions are translated to typed errors. Copy/move/assignment of this proxy may allocate in standard error storage. More...

#include <ui_ref.hpp>

Public Member Functions

TextSource source () const
 TextProperty (const TextProperty &other)=default
 TextProperty (TextProperty &&other)=default
TextProperty operator= (const TextProperty &value)
std::expected< std::string, ManagedError > get () const
 Copy validated UTF-8 text out of the live widget without retaining its storage.
std::expected< void, ManagedError > result () const
 Inspect the last mutation of this particular proxy; newly created proxies have success.
TextProperty set (std::string_view value, std::source_location origin=std::source_location::current())
TextProperty set (const TextValue &value, std::source_location origin=std::source_location::current())
TextProperty append (std::string_view value, std::source_location origin=std::source_location::current())
TextProperty append (const TextValue &value, std::source_location origin=std::source_location::current())
TextProperty operator= (std::string_view value)
TextProperty operator= (const TextValue &value)
TextProperty operator+= (std::string_view value)
TextProperty operator+= (const TextValue &value)
TextProperty operator= (const TextResult &value)
TextProperty operator+= (const TextResult &value)
TextResult operator+ (const TextProperty &value) const
TextResult operator+ (std::string_view value) const
TextResult operator+ (const TextValue &value) const
TextResult operator+ (const TextResult &value) const

Friends

template<class T>
class Ref
class DynamicRef
struct detail::RefAccess
class TextResult

Detailed Description

Copyable observing text property; copies own their resolver and last-operation result. Mutation is UI-affine, outside frames/preparation and nested text mutations. Caption changes use setControlText; editor changes accept a draft and apply its configured EditMode confirmation rules. Every rejected mutation preserves its target value and reports to the live scene collector on UI. WRONG_THREAD and an absent/destroyed scene are observable through result(), without unsafe reporting. Within an entered UI setup scope, even an unavailable target failure stops that setup after the callback returns. It never notifies a foreign owner; outside setup, existing runtime recovery remains unchanged. Each successful operation stands independently; a later failure does not roll back earlier changes. Methods return an owning proxy value so chains and saved results never borrow a temporary proxy. Resolver capture construction can throw before entry. Internally allocation/extension exceptions are translated to typed errors. Copy/move/assignment of this proxy may allocate in standard error storage.

Constructor & Destructor Documentation

◆ TextProperty() [1/2]

portals::ui::TextProperty::TextProperty ( const TextProperty & other)
default
Parameters
otherObserving proxy copied without reading or changing a widget; errors/resolver are copied too.

◆ TextProperty() [2/2]

portals::ui::TextProperty::TextProperty ( TextProperty && other)
default
Parameters
otherProxy transferred without reading or changing a widget; its source becomes empty.

Member Function Documentation

◆ append() [1/2]

TextProperty portals::ui::TextProperty::append ( const TextValue & value,
std::source_location origin = std::source_location::current() )
Parameters
valueOwning literal/format/key expression, resolved once synchronously when required.
originMutation call site retained in diagnostics.
Returns
Owning proxy with the exact result; failure preserves the complete old caption/draft.

◆ append() [2/2]

TextProperty portals::ui::TextProperty::append ( std::string_view value,
std::source_location origin = std::source_location::current() )
Parameters
valueBytes appended to the complete current caption/draft, without selection replacement.
originMutation call site retained in diagnostics.
Returns
Owning proxy; the entire candidate is resegmented and validated before mutation.

◆ get()

std::expected< std::string, ManagedError > portals::ui::TextProperty::get ( ) const

Copy validated UTF-8 text out of the live widget without retaining its storage.

Returns
Owning bytes, or typed affinity/liveness/reentry/allocation error; does not report errors.

◆ operator+() [1/4]

TextResult portals::ui::TextProperty::operator+ ( const TextProperty & value) const
Parameters
valueSecond property read synchronously without changing either source.
Returns
Owning result under this property's width policy and default TextLimits, or original typed error.

◆ operator+() [2/4]

TextResult portals::ui::TextProperty::operator+ ( const TextResult & value) const
Parameters
valueOwning concatenation, read only during this call.
Returns
Owning result under this property's policy, or the first unchanged typed error.

◆ operator+() [3/4]

TextResult portals::ui::TextProperty::operator+ ( const TextValue & value) const
Parameters
valueOwning expression resolved with this proxy's explicit resolver when required.
Returns
Owning result or typed failure; no source mutation occurs.

◆ operator+() [4/4]

TextResult portals::ui::TextProperty::operator+ ( std::string_view value) const
Parameters
valueLiteral suffix copied now, with full boundary resegmentation.
Returns
Owning result or typed failure; no mutation, invalidation or automatic reporting occurs.

◆ operator+=() [1/3]

TextProperty portals::ui::TextProperty::operator+= ( const TextResult & value)
Parameters
valueOwning concatenation, whose successful bytes are appended and revalidated by the receiver.
Returns
Owning proxy; source errors preserve the target and are reported with the concatenation origin.

◆ operator+=() [2/3]

TextProperty portals::ui::TextProperty::operator+= ( const TextValue & value)
Parameters
valueOwning suffix expression.
Returns
Owning proxy with the same contract as append; diagnostics use the text() call site.

◆ operator+=() [3/3]

TextProperty portals::ui::TextProperty::operator+= ( std::string_view value)
Parameters
valueLiteral suffix, copied only during this call.
Returns
Owning proxy with the same contract as append; diagnostics use the text() call site.

◆ operator=() [1/4]

TextProperty portals::ui::TextProperty::operator= ( const TextProperty & value)
Parameters
valueProperty read into an owning snapshot before replacing this proxy's target value.
Returns
Owning proxy after value assignment; copying observations uses the copy constructor instead.

◆ operator=() [2/4]

TextProperty portals::ui::TextProperty::operator= ( const TextResult & value)
Parameters
valueOwning concatenation; a failed source preserves its typed cause and original node identity.
Returns
Owning proxy after replacement; the receiver revalidates successful bytes with its own policy/limits.

◆ operator=() [3/4]

TextProperty portals::ui::TextProperty::operator= ( const TextValue & value)
Parameters
valueOwning replacement expression.
Returns
Owning proxy with the same contract as set; diagnostics use the text() call site.

◆ operator=() [4/4]

TextProperty portals::ui::TextProperty::operator= ( std::string_view value)
Parameters
valueLiteral replacement, copied only during this call.
Returns
Owning proxy with the same contract as set; diagnostics use the text() call site.

◆ result()

std::expected< void, ManagedError > portals::ui::TextProperty::result ( ) const

Inspect the last mutation of this particular proxy; newly created proxies have success.

Returns
Success or exact text-acceptance failure; no scene/widget access is performed. Copies preserve internal short-report provenance for same-collector configure/setup deduplication. Editor validation/publication outcomes use its LineEditResult callback, including accepted invalid drafts.

◆ set() [1/2]

TextProperty portals::ui::TextProperty::set ( const TextValue & value,
std::source_location origin = std::source_location::current() )
Parameters
valueOwning literal/format/key expression copied before invoking the optional resolver.
originMutation call site retained in diagnostics.
Returns
Owning proxy for chaining; missing resolver or invalid resolved text preserves the old value.

◆ set() [2/2]

TextProperty portals::ui::TextProperty::set ( std::string_view value,
std::source_location origin = std::source_location::current() )
Parameters
valueBytes copied during this call; validation uses the receiving widget's width policy/limits.
originMutation call site retained in diagnostics.
Returns
Owning proxy for chaining, with this operation's result. Equal text is a no-op.

◆ source()

TextSource portals::ui::TextProperty::source ( ) const
inline
Returns
Deferred visible-text identity for a caption factory; does not read or subscribe. Assignment between TextProperty values still copies once rather than creating a binding.

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