One UI-owned view with bounded owning row text and one independent model consumer. Construct with a consumer of the frame's model. Delegate owns its captures and returns owning text; it runs only during preparation and must not perform I/O, mutate models/tree, or retain row borrows. Preparation is transactional on allocation/delegate failure. The retained frame and text survive through render inside WidgetTree::frame. No row widgets, worker, hidden pin or terminal I/O exist. Use tree-checked free mutations; read getters through tree.read. Destroy on the UI owner.
More...
|
| | VirtualList (ModelConsumer< T > consumer, std::function< GraphemeText(const ModelRow< T > &)> delegate, VirtualListOptions options={}, SizePolicy policy=DEFAULT_VIEWPORT_POLICY) |
| | Own consumer, delegate and options; validation happens on preparation.
|
|
| ~VirtualList () override |
| | Cancel work; worker ownership may outlive this view.
|
| std::uint64_t | firstRow () const noexcept |
| | Integral scroll position, clamped at preparation.
|
| ScrollState | scrollState () const noexcept |
| std::optional< RowId > | anchorRow () const noexcept |
| std::optional< RowId > | selection () const noexcept |
| | Stable identity, retained across model revisions and hidden views.
|
| RowRange | visibleRange () const noexcept |
| | Last successfully prepared visible rows.
|
| RowRange | preparedRange () const noexcept |
| | Last successfully prepared viewport plus overscan.
|
| RangeState | rangeState () const noexcept |
| | Last prepared model readiness; error text is owned by its retained model range.
|
| DataRangeStatus | dataStatus () const noexcept |
| std::expected< CellSize, TreeError > | measure (CellSize available) override |
| | Viewport-sized intrinsic extent, independent of logical row count.
|
| std::expected< void, TreeError > | arrange (CellRect local) override |
| | Remember local bounds without reading/loading/formatting rows.
|
| std::expected< void, TreeError > | paint (PaintContext &context) override |
| | Emit widget-local commands; caller applies surface translation and ancestor clip.
|
| ComputedStyle | styleDefaults () const override |
| | SizedWidget (SizePolicy policy={}) |
| | Own the supplied policies; checked by layout.
|
| SizePolicy | sizePolicy () const override |
| | Copy current policy without borrowing storage.
|
|
virtual | ~Widget ()=default |
| | Destroy on UI after the last active tree borrow.
|
|
virtual void | mount () |
| | Called exactly once after attachment; exceptions are reported.
|
| virtual void | unmount () |
| | Called once before destruction, children first; cleanup continues on exceptions.
|
| virtual bool | styleReadOnly () const noexcept |
| | Read actual view-only state during style staging; false by default.
|
| const std::shared_ptr< const StyleSnapshot > & | computedStyle () const noexcept |
| | Inspect the last atomically installed theme inside tree.read/frame.
|
| std::uint64_t | styleRevision () const noexcept |
|
virtual | ~LayoutItem ()=default |
| | Destroy with the implementing widget.
|
template<class T>
class portals::VirtualList< T >
One UI-owned view with bounded owning row text and one independent model consumer. Construct with a consumer of the frame's model. Delegate owns its captures and returns owning text; it runs only during preparation and must not perform I/O, mutate models/tree, or retain row borrows. Preparation is transactional on allocation/delegate failure. The retained frame and text survive through render inside WidgetTree::frame. No row widgets, worker, hidden pin or terminal I/O exist. Use tree-checked free mutations; read getters through tree.read. Destroy on the UI owner.
- Template Parameters
-
| T | Domain value exposed by ModelRow<T>. It need not be copyable/default-constructible; this view only borrows const rows during its delegate. The provider must publish immutable transitively owned values and stable nonzero RowId pairs. The copyable delegate owns captures, returns GraphemeText with options.width_policy, and may throw; preparation reports those failures. |