7#include <portals/model_position.hpp>
26struct ManagedNavigationRecord;
27struct EditNavigationParticipant;
28struct ManagedNavigationRegistry;
57 std::optional<RowId>
row;
75 std::span<const RowId>
rows() const noexcept;
86 friend class ManagedNavigation;
87 friend class ManagedScene;
88 friend struct detail::ManagedNavigationRecord;
91 std::shared_ptr<const std::vector<RowId>> rows_;
157 std::expected<void, TreeError>
setSelection(std::span<const RowId> rows)
const;
172 std::expected<PositionRequest, TreeError>
beginResolve(std::uint64_t revision)
const;
178 std::expected<std::stop_token, TreeError>
stopToken()
const;
181 friend class ManagedScene;
183 friend struct ui::detail::EditAccess;
184 std::expected<std::shared_ptr<detail::ManagedNavigationRecord>,
TreeError> lock()
const;
185 std::weak_ptr<detail::ManagedNavigationRecord> record_;
186 std::thread::id owner_{};
Weak UI handle to a model owned by one ManagedScene. Handles may be copied and destroyed on any threa...
Definition managed_model.hpp:120
std::expected< ManagedSource< NavigationPosition >, TreeError > current() const
std::expected< void, TreeError > clearCurrent() const
bool model(ManagedModel< T > model, ModelRebindOptions options={}) const
Definition managed_navigation_views.hpp:872
std::expected< std::optional< ModelBookmark >, TreeError > bookmark() const
std::expected< ManagedSource< NavigationPosition >, TreeError > readingAnchor() const
std::expected< void, TreeError > setSelection(std::span< const RowId > rows) const
std::expected< void, TreeError > setReadingAnchor(ModelBookmark bookmark) const
std::expected< void, TreeError > setCurrent(ModelBookmark bookmark) const
std::expected< void, TreeError > clearReadingAnchor() const
std::expected< std::optional< ModelBookmark >, TreeError > readingBookmark() const
std::expected< void, TreeError > navigate(RowId id) const
std::expected< bool, TreeError > applyReply(const PositionReply &reply) const
std::expected< void, ManagedError > setModel(ManagedModel< T > model, ModelRebindOptions options={}) const
Definition managed_navigation_views.hpp:861
ManagedNavigation()=default
Empty handle; operations return CLOSED.
std::expected< void, TreeError > setChangeMap(PositionChangeMap changes) const
std::expected< PositionRequest, TreeError > beginResolve(std::uint64_t revision) const
std::expected< ManagedSource< NavigationSelection >, TreeError > selection() const
std::expected< std::stop_token, TreeError > stopToken() const
Additive lifecycle owner over one existing Application subtree. UI affine and nonmovable....
Definition managed.hpp:530
Read-only weak scene-owned derived value; no writable alias or subscription escapes.
Definition managed.hpp:484
Copyable bookmark owning metadata only; never retains model, snapshot, view or page....
Definition model_position.hpp:66
std::span< const RowId > rows() const noexcept
ModelResource resource() const noexcept
NavigationSelection()=default
Empty selection, without allocating.
PositionResolution resolution() const noexcept
Immutable bounded provider proof between two revisions of a finite order. The provider must report al...
Definition model_position.hpp:224
Public Portals API.
Definition action.hpp:8
PositionAffinity
Preferred surviving side when a position is deleted or text is inserted beside a mark.
Definition model_position.hpp:42
@ FORWARD
Prefer the following item; an end boundary falls back to the preceding item.
Definition model_position.hpp:43
NavigationProjection
Explicit projection-domain agreement; absence from a projection never proves deletion.
Definition managed_navigation.hpp:102
@ PRESERVES_ROW_IDS
Caller guarantees identical complete RowIds in the original source domain.
Definition managed_navigation.hpp:104
@ SAME_MODEL
Binding must use the context's original managed model.
Definition managed_navigation.hpp:103
PositionKind
Position interpretation; a row, a gap, and a text mark are not interchangeable.
Definition model_position.hpp:35
@ ITEM
Full RowId with a version-qualified ordinal hint.
Definition model_position.hpp:36
PositionResolution
Successful protocol outcomes; absence of support differs from missing history.
Definition model_position.hpp:123
@ EMPTY
Compatible source is empty and has no current item.
Definition model_position.hpp:126
ModelRestorePolicy
Remember a resource position by default; RESET explicitly selects its initial policy.
Definition managed_navigation.hpp:32
@ REMEMBER
Restore this navigation session's saved resource position.
Definition managed_navigation.hpp:33
@ RESET
Forget the target checkpoint and use its initial position/selection.
Definition managed_navigation.hpp:34
TreeError
Checked tree failures; rejected operations never start the requested callback.
Definition widget_types.hpp:26
Checked bookmark capacity, independent of logical source length.
Definition model_position.hpp:57
Original error plus independent runner/restoration and cleanup failures.
Definition managed_diagnostics.hpp:62
Bounded history options, independent of model row count.
Definition managed_navigation.hpp:38
std::size_t maxBytes
Aggregate entry/selection/bookmark metadata credit.
Definition managed_navigation.hpp:39
BookmarkOptions bookmarks
Existing 4096-byte per-bookmark default.
Definition managed_navigation.hpp:40
Explicit rebinding policy; omitted history options inherit the session's settings.
Definition managed_navigation.hpp:44
ModelRestorePolicy restore
Default return-to-resource behavior.
Definition managed_navigation.hpp:45
bool retainPreparedOverride
Low-level opt-in to retaining a previous view callback across models.
Definition managed_navigation.hpp:46
std::optional< ModelCheckpointOptions > checkpoints
Initial session capacity; immutable once history exists.
Definition managed_navigation.hpp:47
Logical resource namespace, distinct from its current delivery session. Reuse an existing SourceStamp...
Definition model_position.hpp:21
Independent opt-in view channels; scrolling never changes current by itself.
Definition managed_navigation.hpp:108
bool readingAnchor
Share logical first-row anchors, mapped independently in each projection.
Definition managed_navigation.hpp:111
bool current
Share stable current using the control's existing single-selection policy.
Definition managed_navigation.hpp:110
NavigationProjection projection
Explicit source-domain agreement.
Definition managed_navigation.hpp:109
Positive bounded metadata limits; no source extent or viewport is retained.
Definition managed_navigation.hpp:95
BookmarkOptions bookmarks
Maximum owning metadata for each captured position.
Definition managed_navigation.hpp:97
std::size_t maxSelectedRows
Maximum explicit selected set, independent of current/focus.
Definition managed_navigation.hpp:96
std::size_t maxCheckpointBytes
Aggregate remembered resource metadata for this context.
Definition managed_navigation.hpp:98
Published logical position, independent of provider revisions and screen coordinates....
Definition managed_navigation.hpp:54
bool operator==(const NavigationPosition &other) const noexcept=default
ModelResource resource
Logical source domain, including compatible-history lineage.
Definition managed_navigation.hpp:55
std::uint64_t offset
Logical gap/text coordinate; zero for ITEM.
Definition managed_navigation.hpp:58
std::optional< RowId > row
Current item; empty for no-current or non-item positions.
Definition managed_navigation.hpp:57
PositionKind kind
Provider position kind.
Definition managed_navigation.hpp:56
PositionAffinity affinity
Explicit deletion/insertion side.
Definition managed_navigation.hpp:59
PositionResolution resolution
Last declared resolution outcome.
Definition managed_navigation.hpp:60
Owning resolution receipt; meaningful only for its matching live request.
Definition model_position.hpp:142
Provider-assigned row identity, independent of position; increment generation on reuse.
Definition row_id.hpp:9
Internal bridge for checked access to managed scene and recipe state.
Definition ui_recipe_access.hpp:28