i_slint_core::item_tree

Struct ItemRc

Source
#[repr(C)]
pub struct ItemRc { /* private fields */ }
Expand description

A ItemRc is holding a reference to a ItemTree containing the item, and the index of this item

Implementations§

Source§

impl ItemRc

Source

pub fn new(item_tree: VRc<ItemTreeVTable>, index: u32) -> Self

Create an ItemRc from a ItemTree and an index

Source

pub fn is_root_item_of(&self, item_tree: &VRc<ItemTreeVTable>) -> bool

Source

pub fn borrow<'a>(&'a self) -> Pin<ItemRef<'a>>

Return a Pin<ItemRef<'a>>

Source

pub fn downcast<T: HasStaticVTable<ItemVTable>>( &self, ) -> Option<VRcMapped<ItemTreeVTable, T>>

Returns a VRcMapped of this item, to conveniently access specialized item API.

Source

pub fn downgrade(&self) -> ItemWeak

Source

pub fn parent_item(&self) -> Option<ItemRc>

Return the parent Item in the item tree.

If the item is a the root on its Window or PopupWindow, then the parent is None.

Source

pub fn is_visible(&self) -> bool

Returns true if this item is visible from the root of the item tree. Note that this will return false for Clip elements with the clip property evaluating to true.

Source

pub fn is_accessible(&self) -> bool

Source

pub fn accessible_role(&self) -> AccessibleRole

Source

pub fn accessible_string_property( &self, what: AccessibleStringProperty, ) -> Option<SharedString>

Source

pub fn accessible_action(&self, action: &AccessibilityAction)

Source

pub fn supported_accessibility_actions(&self) -> SupportedAccessibilityAction

Source

pub fn element_count(&self) -> Option<usize>

Source

pub fn element_type_names_and_ids( &self, element_index: usize, ) -> Option<Vec<(SharedString, SharedString)>>

Source

pub fn geometry(&self) -> LogicalRect

Source

pub fn map_to_window(&self, p: LogicalPoint) -> LogicalPoint

Returns an absolute position of p in the parent item coordinate system (does not add this item’s x and y)

Source

pub fn map_to_item_tree( &self, p: LogicalPoint, item_tree: &VRc<ItemTreeVTable>, ) -> LogicalPoint

Returns an absolute position of p in the ItemTree’s coordinate system (does not add this item’s x and y)

Source

pub fn index(&self) -> u32

Return the index of the item within the ItemTree

Source

pub fn item_tree(&self) -> &VRc<ItemTreeVTable>

Returns a reference to the ItemTree holding this item

Source

pub fn first_child(&self) -> Option<Self>

The first child Item of this Item

Source

pub fn last_child(&self) -> Option<Self>

The last child Item of this Item

Source

pub fn previous_sibling(&self) -> Option<Self>

The previous sibling of this Item

Source

pub fn next_sibling(&self) -> Option<Self>

The next sibling of this Item

Source

pub fn previous_focus_item(&self) -> Self

Move tab focus to the previous item:

Source

pub fn next_focus_item(&self) -> Self

Move tab focus to the next item:

Source

pub fn window_adapter(&self) -> Option<WindowAdapterRc>

Source

pub fn visit_descendants<R>( &self, visitor: impl FnMut(&ItemRc) -> ControlFlow<R>, ) -> Option<R>

Visit the children of this element and call the visitor to each of them, until the visitor returns ControlFlow::Break. When the visitor breaks, the function returns the value. If it doesn’t break, the function returns None.

Trait Implementations§

Source§

impl Clone for ItemRc

Source§

fn clone(&self) -> ItemRc

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ItemRc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ItemRc

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ItemRc

Auto Trait Implementations§

§

impl Freeze for ItemRc

§

impl RefUnwindSafe for ItemRc

§

impl !Send for ItemRc

§

impl !Sync for ItemRc

§

impl Unpin for ItemRc

§

impl UnwindSafe for ItemRc

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.