ContentPresenter
struct · ferroui-controls · v0.5.0
struct ContentPresenter
Presents a single item of data inside a templated control.
Members
TYPEto_refPSEUDO_CLASSESbackground_propertybackground_sizing_propertyborder_brush_propertyborder_thickness_propertycorner_radius_propertybox_shadow_propertyforeground_propertyfont_family_propertyfont_size_propertyfont_style_propertyfont_weight_propertyfont_stretch_propertytext_alignment_propertytext_wrapping_propertytext_trimming_propertyline_height_propertyletter_spacing_propertymax_lines_propertychild_propertycontent_propertycontent_template_propertyhorizontal_content_alignment_propertyvertical_content_alignment_propertypadding_propertyrecognizes_access_key_propertyconstructnewbackgroundset_backgroundbackground_sizingset_background_sizingborder_brushset_border_brushborder_thicknessset_border_thicknesscorner_radiusset_corner_radiusbox_shadowset_box_shadowforegroundset_foregroundfont_familyset_font_familyfont_sizeset_font_sizefont_styleset_font_stylefont_weightset_font_weightfont_stretchset_font_stretchtext_alignmentset_text_alignmenttext_wrappingset_text_wrappingtext_trimmingset_text_trimmingline_heightset_line_heightletter_spacingset_letter_spacingmax_linesset_max_lineschildcontentset_contentcontent_templateset_content_templatehorizontal_content_alignmentset_horizontal_content_alignmentvertical_content_alignmentset_vertical_content_alignmentpaddingset_paddingrecognizes_access_keyset_recognizes_access_keyhostset_content_with_data_contextupdate_childlayout_thicknessarrange_override_impl
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ContentPresenter>
Returns a strong reference to this object.
PSEUDO_CLASSES
const PSEUDO_CLASSES: PseudoClassesAttribute
The pseudoclasses set by the class.
background_property
fn background_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
Defines the Background property.
background_sizing_property
fn background_sizing_property() -> &'static StyledProperty<BackgroundSizing>
Defines the BackgroundSizing property.
border_brush_property
fn border_brush_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
Defines the BorderBrush property.
border_thickness_property
fn border_thickness_property() -> &'static StyledProperty<Thickness>
Defines the BorderThickness property.
corner_radius_property
fn corner_radius_property() -> &'static StyledProperty<CornerRadius>
Defines the CornerRadius property.
box_shadow_property
fn box_shadow_property() -> &'static StyledProperty<BoxShadows>
Defines the BoxShadow property.
foreground_property
fn foreground_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
Defines the Foreground property.
font_family_property
fn font_family_property() -> &'static StyledProperty<FontFamily>
Defines the FontFamily property.
font_size_property
fn font_size_property() -> &'static StyledProperty<f64>
Defines the FontSize property.
font_style_property
fn font_style_property() -> &'static StyledProperty<FontStyle>
Defines the FontStyle property.
font_weight_property
fn font_weight_property() -> &'static StyledProperty<FontWeight>
Defines the FontWeight property.
font_stretch_property
fn font_stretch_property() -> &'static StyledProperty<FontStretch>
Defines the FontStretch property.
text_alignment_property
fn text_alignment_property() -> &'static StyledProperty<TextAlignment>
Defines the TextAlignment property.
text_wrapping_property
fn text_wrapping_property() -> &'static StyledProperty<TextWrapping>
Defines the TextWrapping property.
text_trimming_property
fn text_trimming_property() -> &'static StyledProperty<Rc<dyn TextTrimming>>
Defines the TextTrimming property.
line_height_property
fn line_height_property() -> &'static StyledProperty<f64>
Defines the LineHeight property.
letter_spacing_property
fn letter_spacing_property() -> &'static StyledProperty<f64>
Defines the LetterSpacing property.
max_lines_property
fn max_lines_property() -> &'static StyledProperty<i32>
Defines the MaxLines property.
child_property
fn child_property() -> &'static DirectProperty<ContentPresenter, Option<Ref<Control>>>
Defines the Child property.
content_property
fn content_property() -> &'static StyledProperty<Option<BoxedValue>>
Defines the Content property.
content_template_property
fn content_template_property() -> &'static StyledProperty<Option<Rc<dyn IDataTemplate>>>
Defines the ContentTemplate property.
horizontal_content_alignment_property
fn horizontal_content_alignment_property() -> &'static StyledProperty<HorizontalAlignment>
Defines the HorizontalContentAlignment property.
vertical_content_alignment_property
fn vertical_content_alignment_property() -> &'static StyledProperty<VerticalAlignment>
Defines the VerticalContentAlignment property.
padding_property
fn padding_property() -> &'static StyledProperty<Thickness>
Defines the Padding property.
recognizes_access_key_property
fn recognizes_access_key_property() -> &'static StyledProperty<bool>
Defines the RecognizesAccessKey property.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
background
fn background(self: &Self) -> Option<Rc<dyn IBrush>>
A brush with which to paint the background.
set_background
fn set_background(self: &Self, value: Option<Rc<dyn IBrush>>)
background_sizing
fn background_sizing(self: &Self) -> BackgroundSizing
How the background is drawn relative to the border.
set_background_sizing
fn set_background_sizing(self: &Self, value: BackgroundSizing)
border_brush
fn border_brush(self: &Self) -> Option<Rc<dyn IBrush>>
A brush with which to paint the border.
set_border_brush
fn set_border_brush(self: &Self, value: Option<Rc<dyn IBrush>>)
border_thickness
fn border_thickness(self: &Self) -> Thickness
The thickness of the border.
set_border_thickness
fn set_border_thickness(self: &Self, value: Thickness)
corner_radius
fn corner_radius(self: &Self) -> CornerRadius
The radius of the border rounded corners.
set_corner_radius
fn set_corner_radius(self: &Self, value: CornerRadius)
box_shadow
fn box_shadow(self: &Self) -> BoxShadows
The box shadow effect parameters.
set_box_shadow
fn set_box_shadow(self: &Self, value: BoxShadows)
foreground
fn foreground(self: &Self) -> Option<Rc<dyn IBrush>>
A brush used to paint the text.
set_foreground
fn set_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
font_family
fn font_family(self: &Self) -> FontFamily
The font family.
set_font_family
fn set_font_family(self: &Self, value: FontFamily)
font_size
fn font_size(self: &Self) -> f64
The font size.
set_font_size
fn set_font_size(self: &Self, value: f64)
font_style
fn font_style(self: &Self) -> FontStyle
The font style.
set_font_style
fn set_font_style(self: &Self, value: FontStyle)
font_weight
fn font_weight(self: &Self) -> FontWeight
The font weight.
set_font_weight
fn set_font_weight(self: &Self, value: FontWeight)
font_stretch
fn font_stretch(self: &Self) -> FontStretch
The font stretch.
set_font_stretch
fn set_font_stretch(self: &Self, value: FontStretch)
text_alignment
fn text_alignment(self: &Self) -> TextAlignment
The text alignment.
set_text_alignment
fn set_text_alignment(self: &Self, value: TextAlignment)
text_wrapping
fn text_wrapping(self: &Self) -> TextWrapping
The text wrapping.
set_text_wrapping
fn set_text_wrapping(self: &Self, value: TextWrapping)
text_trimming
fn text_trimming(self: &Self) -> Rc<dyn TextTrimming>
The text trimming.
set_text_trimming
fn set_text_trimming(self: &Self, value: Rc<dyn TextTrimming>)
line_height
fn line_height(self: &Self) -> f64
The line height.
set_line_height
fn set_line_height(self: &Self, value: f64)
letter_spacing
fn letter_spacing(self: &Self) -> f64
The letter spacing.
set_letter_spacing
fn set_letter_spacing(self: &Self, value: f64)
max_lines
fn max_lines(self: &Self) -> i32
The max lines.
set_max_lines
fn set_max_lines(self: &Self, value: i32)
child
fn child(self: &Self) -> Option<Ref<Control>>
The control displayed by the presenter.
content
fn content(self: &Self) -> Option<BoxedValue>
The content to be displayed by the presenter.
set_content
fn set_content(self: &Self, value: Option<BoxedValue>)
content_template
fn content_template(self: &Self) -> Option<Rc<dyn IDataTemplate>>
The data template used to display the content of the control.
set_content_template
fn set_content_template(self: &Self, value: Option<Rc<dyn IDataTemplate>>)
horizontal_content_alignment
fn horizontal_content_alignment(self: &Self) -> HorizontalAlignment
The horizontal alignment of the content within the border the control.
set_horizontal_content_alignment
fn set_horizontal_content_alignment(self: &Self, value: HorizontalAlignment)
vertical_content_alignment
fn vertical_content_alignment(self: &Self) -> VerticalAlignment
The vertical alignment of the content within the border of the control.
set_vertical_content_alignment
fn set_vertical_content_alignment(self: &Self, value: VerticalAlignment)
padding
fn padding(self: &Self) -> Thickness
The space between the border and the child control.
set_padding
fn set_padding(self: &Self, value: Thickness)
recognizes_access_key
fn recognizes_access_key(self: &Self) -> bool
Determine if the presenter should use access text in its style.
set_recognizes_access_key
fn set_recognizes_access_key(self: &Self, value: bool)
host
fn host(self: &Self) -> Option<Ref<FerroObject>>
The host content control.
set_content_with_data_context
fn set_content_with_data_context(self: &Self, content: Option<BoxedValue>, data_context: Option<BoxedValue>)
Sets the content and the data context of the presenter at once: the
child is created with data_context instead of the data context
derived from the content.
update_child
fn update_child(self: &Self)
Updates the child control based on the content.
Usually the child control is created automatically when
apply_template is called; however for this to happen, the control
needs to be attached to a logical tree (if the control is not attached
to the logical tree, it is reasonable to expect that the data
templates needed for the child are not yet available). This method
forces the child to be updated regardless.
layout_thickness
fn layout_thickness(self: &Self) -> Thickness
The border thickness used for rendering: rounded to device pixels when layout rounding is in use.
arrange_override_impl
fn arrange_override_impl(self: &Self, final_size: Size, offset: Vector) -> Size
Arranges the child within final_size, with the origin of the
content area displaced by offset.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeControlImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<ContentPresenter>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleInteractiveImplInputElementImplControlImplVisualImplFerroObjectImplStyledElementImplLayoutableImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.