Block
struct · ferroui-controls · v0.5.0
struct Block
Base class for block-level text content. A block owns paragraph formatting;
character formatting continues to use the inherited TextElement properties.
Members
TYPEto_reftextbuild_text_runsmeasure_embedded_controlstext_alignment_propertyline_height_propertyline_stacking_strategy_propertymargin_propertyflow_direction_propertyconstructtext_lengthtext_alignmentset_text_alignmenthorizontal_text_alignmentset_horizontal_text_alignmentline_heightset_line_heightline_stacking_strategyset_line_stacking_strategymarginset_marginflow_directionset_flow_direction
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<Block>
Returns a strong reference to this object.
text
fn text(self: &Self) -> String
Returns the text of this block, without a following paragraph separator.
build_text_runs
fn build_text_runs(self: &Self, text_runs: &mut Vec<Rc<dyn TextRun>>)
Appends formatter runs in content order.
measure_embedded_controls
fn measure_embedded_controls(self: &Self, available_size: Size) -> bool
Measures inline controls and reports whether a size changed.
text_alignment_property
fn text_alignment_property() -> &'static StyledProperty<TextAlignment>
line_height_property
fn line_height_property() -> &'static StyledProperty<f64>
line_stacking_strategy_property
fn line_stacking_strategy_property() -> &'static StyledProperty<LineStackingStrategy>
margin_property
fn margin_property() -> &'static StyledProperty<Thickness>
flow_direction_property
fn flow_direction_property() -> &'static StyledProperty<FlowDirection>
construct
fn construct() -> Self
text_length
fn text_length(self: &Self) -> usize
Length in UTF-16 code units, matching text formatter and document offsets.
text_alignment
fn text_alignment(self: &Self) -> TextAlignment
set_text_alignment
fn set_text_alignment(self: &Self, value: TextAlignment)
horizontal_text_alignment
fn horizontal_text_alignment(self: &Self) -> TextAlignment
Alias of TextAlignment, sharing its backing property and inheritance.
set_horizontal_text_alignment
fn set_horizontal_text_alignment(self: &Self, value: TextAlignment)
line_height
fn line_height(self: &Self) -> f64
NaN chooses the natural line height, as in the shared text formatter properties.
set_line_height
fn set_line_height(self: &Self, value: f64)
line_stacking_strategy
fn line_stacking_strategy(self: &Self) -> LineStackingStrategy
set_line_stacking_strategy
fn set_line_stacking_strategy(self: &Self, value: LineStackingStrategy)
margin
fn margin(self: &Self) -> Thickness
set_margin
fn set_margin(self: &Self, value: Thickness)
flow_direction
fn flow_direction(self: &Self) -> FlowDirection
set_flow_direction
fn set_flow_direction(self: &Self, value: FlowDirection)
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBlockImplExtTextElementImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtStyledElementImplExtClassDefaultsErasedDestructorIntoEitherDerefUpcast<T>Upcast<Block>StaticTypeObjectTypeSubclassable<T>StyledElementImplTextElementImplFerroObjectImplBlockImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.