5#include <portals/collection.hpp>
6#include <portals/controls.hpp>
7#include <portals/text_value.hpp>
54 std::optional<RowId> selected = {});
56 std::expected<RadioGroupValue, TreeError>
withSelection(std::optional<RowId> selected)
const;
58 std::span<const ModelRow<RadioItem>>
rows() const noexcept;
70 friend class RadioGroup;
71 friend class ManagedScene;
72 friend class RadioGroupBinding;
74 std::shared_ptr<const Data> data_;
75 std::optional<
RowId> selected_;
124 friend class RadioGroupBinding;
133 std::optional<RowId> active_;
157 std::expected<void, TreeError>
sync();
159 std::expected<RadioGroupValue, TreeError>
value()
const;
169 std::shared_ptr<State> state_;
Move-only scoped disconnect token; never owns a tree or widget. Disconnect/destruction may run on any...
Definition action.hpp:96
An owning, invariant-preserving half-open cell rectangle.
Definition geometry.hpp:81
UI-owned focus and synchronous bubbling over an existing WidgetTree. Tree and Scheduler must outlive ...
Definition action.hpp:169
Owning validated UTF-8 and immutable extended grapheme measurements.
Definition text.hpp:145
Copyable typed observer; never owns or exposes an unchecked widget pointer.
Definition widget.hpp:92
Borrowed synchronous command sink supplied by the frame owner. submit must consume commands immediate...
Definition widget_types.hpp:66
UI-owned typed value with node-scoped observers and explicit partial delivery. WidgetTree and its Sch...
Definition property.hpp:62
RadioGroupBinding(RadioGroupBinding &&other) noexcept
~RadioGroupBinding()
Disconnect this registration on its creating UI thread.
RadioGroupBinding & operator=(const RadioGroupBinding &)=delete
Copying cannot duplicate a live input registration.
RadioGroupBinding(const RadioGroupBinding &)=delete
Registrations have one owner.
RadioGroupBinding & operator=(RadioGroupBinding &&other) noexcept
std::expected< RadioGroupValue, TreeError > value() const
friend std::expected< RadioGroupBinding, TreeError > bindRadioGroup(WidgetTree &, EventRouter &, Node< RadioGroup >, std::shared_ptr< Property< RadioGroupValue > >, std::function< void(RadioGroupResult)>)
RadioGroupResult select(std::optional< RowId > id)
std::expected< void, TreeError > sync()
Coherent immutable resident options and optional selection; copies share all row storage....
Definition radio_group.hpp:43
std::span< const ModelRow< RadioItem > > rows() const noexcept
~RadioGroupValue()=default
Release shared rows; rvalue transfers preserve a valid shared-owner source, like RowCollection.
std::optional< RowId > selectedId() const noexcept
static std::expected< RadioGroupValue, TreeError > from(RowCollection< RadioItem > rows, std::optional< RowId > selected={})
std::string_view selectedText() const noexcept
RadioGroupValue()=default
Construct an empty value without allocating rows or selecting an item.
std::expected< RadioGroupValue, TreeError > withSelection(std::optional< RowId > selected) const
std::optional< RowId > firstEligible() const noexcept
ComputedStyle styleDefaults() const override
RadioGroup(const RadioGroup &)=delete
Tree-owned widgets cannot copy their live geometry context.
bool styleReadOnly() const noexcept override
RadioGroup & operator=(RadioGroup &&)=delete
A bound widget cannot transfer its tree context.
friend std::expected< void, TreeError > syncRadioGroup(WidgetTree &, Node< RadioGroup >, Node< Widget >)
RadioGroup(ControlStyle style={}, SizePolicy policy=DEFAULT_CONTENT_POLICY, bool readOnly=false, WidthPolicy widthPolicy={}, RadioSelectionMode selectionMode=RadioSelectionMode::ON_ACTIVATION)
std::expected< void, TreeError > arrange(CellRect local) override
std::expected< CellSize, TreeError > measure(CellSize available) override
RadioGroup(RadioGroup &&)=delete
A bound widget's address and tree identity remain fixed.
RadioGroup & operator=(const RadioGroup &)=delete
Tree-owned widgets cannot be assigned.
std::expected< void, TreeError > paint(PaintContext &context) override
RadioGroupValue value() const
Immutable owning rows with explicit provider identity and bounded identity lookup.
Definition collection.hpp:19
UI-owned move-only cancellation token. Release before Scheduler. Disconnect is immediate logically; a...
Definition scheduler.hpp:121
Owning literal bytes or a resource key, measured only at resolution.
Definition text_value.hpp:42
Public Portals API.
Definition action.hpp:8
std::expected< RadioGroupBinding, TreeError > bindRadioGroup(WidgetTree &tree, EventRouter &router, Node< RadioGroup > node, std::shared_ptr< Property< RadioGroupValue > > model, std::function< void(RadioGroupResult)> changed)
RadioSelectionMode
User selection publication policy; active navigation remains local to the group.
Definition radio_group.hpp:80
@ ON_ACTIVATION
Arrows move active; Space/Enter selects.
Definition radio_group.hpp:81
std::expected< PropertyUpdate< RadioGroupValue >, TreeError > RadioGroupResult
Exact selection commit and observer-publication receipt, or a precommit TreeError.
Definition radio_group.hpp:141
constexpr SizePolicy DEFAULT_CONTENT_POLICY
Intrinsic content on both axes; explicit policies remain authoritative.
Definition layout.hpp:44
std::expected< void, TreeError > syncRadioGroup(WidgetTree &tree, Node< RadioGroup > node, Node< Widget > focused)
TreeError
Checked tree failures; rejected operations never start the requested callback.
Definition widget_types.hpp:26
@ IMMEDIATE
Publish each semantic-valid text change; invalid intermediate text remains visible.
Definition line_edit.hpp:28
An owning available extent in terminal columns/rows.
Definition geometry.hpp:44
Owning resolved presentation; no actions or model state are encoded.
Definition style_types.hpp:169
Owning paint values; no theme engine or behavior is encoded here.
Definition controls.hpp:24
Owning arranged geometry; invalid geometry must never be used for hit-testing.
Definition widget_types.hpp:48
One immutable, validated single-line radio caption and its input eligibility.
Definition radio_group.hpp:31
GraphemeText text
Owning text measured under the receiving scene's policy.
Definition radio_group.hpp:32
bool operator==(const RadioItem &) const =default
bool visible
Hidden items occupy no row and reject input.
Definition radio_group.hpp:34
bool enabled
Disabled items retain their selected value but reject input.
Definition radio_group.hpp:33
bool enabled
User input eligibility; selection is preserved when disabled.
Definition radio_group.hpp:13
RadioOption(TextValue caption, bool enabled=true, bool visible=true)
Definition radio_group.hpp:22
TextValue text
Literal or resource key, resolved with the receiving scene policy.
Definition radio_group.hpp:12
bool visible
Whether the option occupies a row.
Definition radio_group.hpp:14
RadioOption(std::string_view caption, bool enabled=true, bool visible=true)
Definition radio_group.hpp:17
~RadioOption()=default
Release the cold owning expression; copies retain ordinary fallible value semantics.
Provider-assigned row identity, independent of position; increment generation on reuse.
Definition row_id.hpp:9
Owning independent policies for width and height.
Definition layout.hpp:35
Owning deterministic width policy; no font or terminal matching promise.
Definition text.hpp:42