TreeDataGridPresenterBase
struct · ferroui-controls-treedatagrid · v0.5.0
struct TreeDataGridPresenterBase
The state of the reference's TreeDataGridPresenterBase<TItem>.
Members
newelement_factoryrealized_elementsrealized_element_countis_in_layoutis_layout_in_progressviewportstart_ufirst_indexbring_into_viewget_realized_elementstry_get_elementrecycle_all_elementsrecycle_all_elements_on_item_removeddefault_measure_elementget_element_from_factory_fordefault_get_or_estimate_anchor_element_for_viewportdefault_estimate_element_size_udefault_on_effective_viewport_changedis_viewport_covered_by_realized_elementsmeasure_overridearrange_overrideon_attached_to_visual_treeon_detached_from_visual_treeon_detached_from_logical_treesubscribe_to_item_changesunsubscribe_from_item_changeson_items_collection_changed
new
fn new() -> Self
element_factory
fn element_factory(self: &Self) -> Option<Rc<TreeDataGridElementFactory>>
The element factory (ElementFactory).
realized_elements
fn realized_elements(self: &Self) -> Vec<Option<Ref<Control>>>
The realized elements, with an empty slot for each item of the realized range that has no
element yet (RealizedElements).
realized_element_count
fn realized_element_count(self: &Self) -> usize
The number of realized elements, empty slots included.
is_in_layout
fn is_in_layout(self: &Self) -> bool
Whether the presenter is in its measure or arrange pass (IsInLayout).
is_layout_in_progress
fn is_layout_in_progress(self: &Self) -> bool
Whether the presenter is in its measure or arrange pass (IsLayoutInProgress).
viewport
fn viewport(self: &Self) -> Rect
The effective viewport of the presenter, intersected with its bounds (Viewport).
start_u
fn start_u(self: &Self) -> f64
Gets the position of the first realized element on the primary axis (StartU).
first_index
fn first_index(self: &Self) -> i32
The index of the first realized element (FirstIndex).
bring_into_view
fn bring_into_view<H: TreeDataGridPresenterHooks>(self: &Self, hooks: &H, index: i32, rect: Option<Rect>) -> Option<Ref<Control>>
Brings the item at index into view, realizing its element if needed (BringIntoView).
rect is the area of the element to bring into view. Returns the element, or None when
the item cannot be brought into view.
get_realized_elements
fn get_realized_elements(self: &Self) -> Vec<Ref<Control>>
The realized elements (GetRealizedElements).
try_get_element
fn try_get_element(self: &Self, index: i32) -> Option<Ref<Control>>
The realized element of the item at index, if any (TryGetElement).
recycle_all_elements
fn recycle_all_elements<H: TreeDataGridPresenterHooks>(self: &Self, hooks: &H, preserve_visual_tree_membership: bool, preserve_logical_tree_membership: bool)
Recycles all the realized elements (RecycleAllElements).
recycle_all_elements_on_item_removed
fn recycle_all_elements_on_item_removed<H: TreeDataGridPresenterHooks>(self: &Self, hooks: &H, preserve_visual_tree_membership: bool, preserve_logical_tree_membership: bool)
Recycles all the realized elements as if their items were removed
(RecycleAllElementsOnItemRemoved).
default_measure_element
fn default_measure_element(element: &Control, available_size: Size) -> Size
The base MeasureElement.
Optimization: skips the measure if the element was already measured with the same constraint and its measure is still valid. This significantly improves reattachment performance.
get_element_from_factory_for
fn get_element_from_factory_for(self: &Self, data: &dyn Any, parent: &Control) -> Ref<Control>
The base GetElementFromFactory(object data, int index, Control parent): the element of the
element factory for data, preferring one recycled from parent.
default_get_or_estimate_anchor_element_for_viewport
fn default_get_or_estimate_anchor_element_for_viewport(self: &Self, viewport_start: f64, viewport_end: f64, item_count: i32) -> (i32, f64)
The base GetOrEstimateAnchorElementForViewport.
default_estimate_element_size_u
fn default_estimate_element_size_u(self: &Self) -> f64
The base EstimateElementSizeU.
default_on_effective_viewport_changed
fn default_on_effective_viewport_changed<H: TreeDataGridPresenterHooks>(self: &Self, hooks: &H, e: &EffectiveViewportChangedEventArgs)
The base OnEffectiveViewportChanged.
is_viewport_covered_by_realized_elements
fn is_viewport_covered_by_realized_elements(self: &Self, orientation: Orientation, viewport: Rect) -> bool
Whether the realized elements cover viewport on the primary axis
(IsViewportCoveredByRealizedElements).
measure_override
fn measure_override<H: TreeDataGridPresenterHooks>(self: &Self, hooks: &H, available_size: Size) -> Size
The base MeasureOverride.
arrange_override
fn arrange_override<H: TreeDataGridPresenterHooks>(self: &Self, hooks: &H, final_size: Size) -> Size
The base ArrangeOverride.
on_attached_to_visual_tree
fn on_attached_to_visual_tree<H: TreeDataGridPresenterHooks>(self: &Self, hooks: &H)
The base OnAttachedToVisualTree, after the parent class's.
on_detached_from_visual_tree
fn on_detached_from_visual_tree<H: TreeDataGridPresenterHooks>(self: &Self, hooks: &H)
The base OnDetachedFromVisualTree, after the parent class's.
on_detached_from_logical_tree
fn on_detached_from_logical_tree<H: TreeDataGridPresenterHooks>(self: &Self, hooks: &H)
The base OnDetachedFromLogicalTree, after the parent class's.
subscribe_to_item_changes
fn subscribe_to_item_changes<H: TreeDataGridPresenterHooks>(self: &Self, hooks: &H)
Subscribes to the changes of the presenter's items, if they notify and the presenter is not
subscribed yet (SubscribeToItemChanges).
unsubscribe_from_item_changes
fn unsubscribe_from_item_changes<H: TreeDataGridPresenterHooks>(self: &Self, hooks: &H)
Removes the subscription to the changes of the presenter's items
(UnsubscribeFromItemChanges). Called before the items are replaced, while the presenter
still holds the items it subscribed to.
on_items_collection_changed
fn on_items_collection_changed<H: TreeDataGridPresenterHooks>(self: &Self, hooks: &H, e: &PresenterItemsChange)
Handles a change of the items (OnItemsCollectionChanged); a presenter also calls it with
a reset when its items are replaced.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEitherDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.