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

Weak UI-affine command observation; destruction never unregisters the command. More...

#include <key_binding.hpp>

Public Member Functions

 KeyBinding ()=default
 Construct an empty, allocation-free observation.
KeyBindingId id () const noexcept
std::expected< void, ManagedError > setEnabled (bool value) const
std::expected< void, ManagedError > setVisible (bool value) const
std::expected< void, ManagedError > setText (TextValue label, TextValue description, KeyTextResolver resolver={}) const
std::expected< void, ManagedError > rebind (const KeySelection &selection) const
std::expected< void, ManagedError > unbind () const
std::expected< void, ManagedError > remove () const

Friends

class ManagedScene
class ui::KeyBindingRef

Detailed Description

Weak UI-affine command observation; destruction never unregisters the command.

Member Function Documentation

◆ id()

KeyBindingId portals::KeyBinding::id ( ) const
inlinenoexcept
Returns
Immutable identity without reading the scene.

◆ rebind()

std::expected< void, ManagedError > portals::KeyBinding::rebind ( const KeySelection & selection) const
Parameters
selectionOwning checked alternatives/phases.
Returns
Atomic rebind or exact typed failure.

◆ remove()

std::expected< void, ManagedError > portals::KeyBinding::remove ( ) const
Returns
Success once; subsequent mutations return STALE_NODE.

◆ setEnabled()

std::expected< void, ManagedError > portals::KeyBinding::setEnabled ( bool value) const
Parameters
valueNew admission state.
Returns
Pure checked result; equal state is a no-op.

◆ setText()

std::expected< void, ManagedError > portals::KeyBinding::setText ( TextValue label,
TextValue description,
KeyTextResolver resolver = {} ) const
Parameters
labelRequired label.
descriptionOptional explanation.
resolverLocal resource resolver.
Returns
Atomic normalized text publication; active prefix is preserved.

◆ setVisible()

std::expected< void, ManagedError > portals::KeyBinding::setVisible ( bool value) const
Parameters
valueVisibility and admission state.
Returns
Pure checked result.

◆ unbind()

std::expected< void, ManagedError > portals::KeyBinding::unbind ( ) const
Returns
Success after clearing alternatives, keeping identity and explanation.

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