TreeDataGridPresenterHooks
trait · ferroui-controls-treedatagrid · v0.5.0
trait TreeDataGridPresenterHooks: ObjectType + Upcast<ferroui_controls::Control> + 'static
The abstract and virtual members of the reference's presenter base, implemented by each presenter class. The defaults are the base implementations.
Members
Itempresenter_basepresenter_controlorientationitem_countitem_atsubscribe_to_itemsunsubscribe_from_itemsrealize_elementupdate_element_indexunrealize_elementunrealize_element_on_item_removedfinalize_recycled_elementarrange_elementmeasure_elementget_initial_constraintneeds_final_measure_passget_final_constraintget_element_from_factoryget_element_atget_element_positioncalculate_size_uget_or_estimate_anchor_element_for_viewportestimate_element_size_uget_parent_presenter_viewportget_measure_viewportneeds_measure_for_viewport_changeon_effective_viewport_changedas_final_measure_selectortrace_enabled
Item
type Item: Clone + 'static
The type of the items the presenter shows.
presenter_base
fn presenter_base(self: &Self) -> &TreeDataGridPresenterBase
The state of the base.
presenter_control
fn presenter_control(self: &Self) -> &Control
The presenter as a control.
orientation
fn orientation(self: &Self) -> Orientation
The axis along which the items are laid out.
item_count
fn item_count(self: &Self) -> Option<usize>
The number of items, or None when the presenter has no items (Items is null).
item_at
fn item_at(self: &Self, index: usize) -> <Self as >::Item
The item at index.
subscribe_to_items
fn subscribe_to_items(self: &Self, handler: Rc<dyn Fn(&PresenterItemsChange) -> ()>) -> Option<u64>
Subscribes to the changes of the items; None when the items do not notify.
unsubscribe_from_items
fn unsubscribe_from_items(self: &Self, token: u64)
Removes a subscription of subscribe_to_items.
realize_element
fn realize_element(self: &Self, element: &Ref<Control>, item: &<Self as >::Item, index: i32)
Prepares element to show item, at index (RealizeElement).
update_element_index
fn update_element_index(self: &Self, element: &Ref<Control>, old_index: i32, new_index: i32)
The index of a realized element changed (UpdateElementIndex).
unrealize_element
fn unrealize_element(self: &Self, element: &Ref<Control>)
Clears element before it is recycled (UnrealizeElement).
unrealize_element_on_item_removed
fn unrealize_element_on_item_removed(self: &Self, element: &Ref<Control>)
Clears element before it is recycled because its item was removed
(UnrealizeElementOnItemRemoved).
finalize_recycled_element
fn finalize_recycled_element(self: &Self, _element: &Ref<Control>)
Releases what a recycled element retained when it is no longer needed for a quick reuse
(FinalizeRecycledElement).
arrange_element
fn arrange_element(self: &Self, _index: i32, element: &Ref<Control>, rect: Rect) -> Rect
Arranges element (ArrangeElement); returns the rect it was arranged in.
measure_element
fn measure_element(self: &Self, _index: i32, element: &Ref<Control>, available_size: Size) -> Size
Measures element (MeasureElement); returns its size.
get_initial_constraint
fn get_initial_constraint(self: &Self, _element: &Ref<Control>, _index: i32, available_size: Size) -> Size
Gets the initial constraint for the first pass of the two-pass measure
(GetInitialConstraint).
The measure pass is split into two parts:
- The initial pass is used to determine the "natural" size of the elements. In this pass, infinity can be used as the measure constraint if the element has no other constraints on its size.
- The final pass is made once the "natural" sizes of the elements are known and any layout
logic has been run. This pass is needed because controls should not be arranged with a size
less than that passed as the constraint during the measure pass. This pass is only run if
needs_final_measure_passreturns true.
needs_final_measure_pass
fn needs_final_measure_pass(self: &Self, _first_index: i32, _elements: &[Option<Ref<Control>>]) -> bool
Called when the initial pass of the two-pass measure has been completed, in order to
determine whether a final measure pass is necessary (NeedsFinalMeasurePass).
first_index is the index of the first element in elements.
get_final_constraint
fn get_final_constraint(self: &Self, element: &Ref<Control>, _index: i32, _available_size: Size) -> Size
Gets the final constraint for the second pass of the two-pass measure
(GetFinalConstraint).
get_element_from_factory
fn get_element_from_factory(self: &Self, item: &<Self as >::Item, _index: i32) -> Ref<Control>
Gets the element that shows item from the element factory (GetElementFromFactory).
get_element_at
fn get_element_at(self: &Self, _position: f64) -> (i32, f64)
The index and position of the element at position (GetElementAt).
get_element_position
fn get_element_position(self: &Self, _index: i32) -> f64
The position of the element at index (GetElementPosition).
calculate_size_u
fn calculate_size_u(self: &Self, _available_size: Size) -> f64
The estimated size of all the items on the primary axis (CalculateSizeU).
get_or_estimate_anchor_element_for_viewport
fn get_or_estimate_anchor_element_for_viewport(self: &Self, viewport_start: f64, viewport_end: f64, item_count: i32) -> (i32, f64)
The anchor element from which realization starts (GetOrEstimateAnchorElementForViewport).
estimate_element_size_u
fn estimate_element_size_u(self: &Self) -> f64
The estimated size of an element on the primary axis (EstimateElementSizeU).
get_parent_presenter_viewport
fn get_parent_presenter_viewport(self: &Self) -> Option<Rect>
The viewport of the parent presenter, if the presenter is nested in one
(GetParentPresenterViewPort).
get_measure_viewport
fn get_measure_viewport(self: &Self, viewport: Rect) -> Rect
The viewport realization fills, from the effective viewport (GetMeasureViewport).
needs_measure_for_viewport_change
fn needs_measure_for_viewport_change(self: &Self, _measure_viewport: Rect, _viewport: Rect) -> bool
Whether a change of the effective viewport needs a new measure
(NeedsMeasureForViewportChange).
on_effective_viewport_changed
fn on_effective_viewport_changed(self: &Self, e: &EffectiveViewportChangedEventArgs)
Called when the effective viewport of the presenter changes (OnEffectiveViewportChanged).
as_final_measure_selector
fn as_final_measure_selector(self: &Self) -> Option<&dyn IFinalMeasureSelector>
The presenter as a selector of the elements of the final measure pass
(this is IFinalMeasureSelector).
trace_enabled
fn trace_enabled(self: &Self) -> bool
Whether the diagnostic trace of the presenter is written (the rows presenter's).
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.