Scoped model/action ownership; destroy and move on UI outside frames. Tree, router and scheduler outlive the binding. Call sync before each frame. Drafts survive external revisions; confirmation detects conflict and Escape adopts latest. EditMode selects immediate publication, confirmation on focus loss, or explicit confirmation only. Admitted callbacks retain state; removal suppresses future callbacks and observer delivery.
More...
#include <line_edit.hpp>
Scoped model/action ownership; destroy and move on UI outside frames. Tree, router and scheduler outlive the binding. Call sync before each frame. Drafts survive external revisions; confirmation detects conflict and Escape adopts latest. EditMode selects immediate publication, confirmation on focus loss, or explicit confirmation only. Admitted callbacks retain state; removal suppresses future callbacks and observer delivery.
◆ LineEditBinding()
| portals::LineEditBinding::LineEditBinding |
( |
LineEditBinding && | other | ) |
|
|
noexcept |
Transfer ownership on UI.
- Parameters
-
| other | Binding emptied by this transfer. |
◆ canRedo()
| bool portals::LineEditBinding::canRedo |
( |
| ) |
const |
- Returns
- Effective Redo availability; false on checked failure, with no error reporting.
◆ canUndo()
| bool portals::LineEditBinding::canUndo |
( |
| ) |
const |
- Returns
- Effective Undo availability; false on checked failure, with no error reporting.
◆ clear()
| std::expected< void, TreeError > portals::LineEditBinding::clear |
( |
| ) |
|
Clear a writable eligible editor as one separate user edit, applying its EditMode.
- Returns
- Success for an empty draft or semantic rejection; technical failures retain their exact TreeError. Pre-accept failures preserve draft/history; post-accept publication failure keeps a dirty undoable draft. Read-only and disabled editors return WOULD_BLOCK, including when already empty.
◆ historyAvailability()
- Returns
- Effective availability, or typed liveness/frame/reentry error; never adopts or reports.
◆ operator=()
Install replacement before retiring old captures, which may reenter UI.
- Parameters
-
| other | Binding emptied by transfer; self-move preserves all state. |
- Returns
- This binding; reentrant cleanup may have destroyed its containing owner.
◆ redo()
| std::expected< void, TreeError > portals::LineEditBinding::redo |
( |
| ) |
|
- Returns
- Success after restoring Redo and applying EditMode, or typed admission/publication failure.
◆ stopGrouping()
| std::expected< void, TreeError > portals::LineEditBinding::stopGrouping |
( |
| ) |
|
- Returns
- Success after closing grouping without redraw/notification, or typed liveness/reentry failure.
◆ sync()
Synchronize latest clean model and focus presentation between frames.
- Parameters
-
- Returns
- Success, INVALID_ARGUMENT for an empty binding, WOULD_BLOCK on frame/reentry, NO_MEMORY, INVALID_ARGUMENT for invalid model text, or delegated tree/model error. Rejected/old notifications never override a dirty draft. Invalid models preserve presentation.
◆ undo()
| std::expected< void, TreeError > portals::LineEditBinding::undo |
( |
| ) |
|
- Returns
- Success after restoring Undo and applying EditMode, or typed admission/publication failure. Empty history closes grouping without callbacks or invalidation. Semantic rejection remains a visible draft.
◆ bindLineEditWithEvents
Bind a one-line editor and adopt its initial model on UI outside frames.
- Parameters
-
| tree | Borrowed UI owner, outliving binding and model. |
| router | Borrowed router for this tree, outliving binding. |
| node | Observing editor handle; one action registration is allowed per node. |
| model | Required shared model owner. External values must satisfy editor text limits. |
| result | Required owning callback, invoked before typed events for editing/confirmation operations; may remove node/ancestors or destroy the binding. Successful commits stay committed if this callback throws. |
| clipboard | Optional shared UI service for Ctrl+C/X/V; absence reports CLIPBOARD_FAILED. |
| validate | Optional publication predicate borrowing an owned candidate only during its call. False preserves draft with VALIDATION_FAILED; exceptions report FAILED/CALLBACK_FAILED. |
- Returns
- Owning binding or delegated tree/router/property error; invalid initial text is INVALID_ARGUMENT. Internal allocations report NO_MEMORY; by-value argument construction may throw before entry. Publication uses options.editMode and requires the original revision, including after validator reentry. IMMEDIATE is the default; semantic rejection retains the accepted candidate without a model set. Invoke Action::ACTIVATE for the same programmatic confirmation as Enter, in every mode. History owns bounded text/selection snapshots; accepted edits and restorations precede validator callbacks. Default Ctrl+Z/Ctrl+Y/Ctrl+Shift+Z chords are configurable; reserved router keys and Undo/Redo overlap reject bind. Read-only accepts explicit programmatic text changes but blocks user typing/deletion/cut/paste and Undo/Redo. User clear is also blocked by read-only/disabled eligibility; programmatic text mutation remains unchanged. PASSWORD/NO_ECHO consume Ctrl+C/X without service access or outcomes. Ctrl+V and paste remain writable inputs. Escape adopts latest. Shift+arrows/Home/End select; Ctrl+A selects all. Cut changes draft only after a successful service write, then applies the same publication policy as input and fluent edits. Paste rejects invalid UTF-8, CR/LF/U+2028/U+2029 and whole over-limit edits. Other controls remain logical data displayed as safe renderer placeholders.
- Parameters
-
| events | Typed observations delivered after the legacy result; no borrowed widget text survives callbacks. |
The documentation for this class was generated from the following file: