#[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
impl ItemRc
Sourcepub fn new(item_tree: VRc<ItemTreeVTable>, index: u32) -> Self
pub fn new(item_tree: VRc<ItemTreeVTable>, index: u32) -> Self
Create an ItemRc from a ItemTree and an index
pub fn is_root_item_of(&self, item_tree: &VRc<ItemTreeVTable>) -> bool
Sourcepub fn downcast<T: HasStaticVTable<ItemVTable>>(
&self,
) -> Option<VRcMapped<ItemTreeVTable, T>>
pub fn downcast<T: HasStaticVTable<ItemVTable>>( &self, ) -> Option<VRcMapped<ItemTreeVTable, T>>
Returns a VRcMapped
of this item, to conveniently access specialized item API.
pub fn downgrade(&self) -> ItemWeak
Sourcepub fn parent_item(&self) -> Option<ItemRc>
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.
Sourcepub fn is_visible(&self) -> bool
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.
pub fn is_accessible(&self) -> bool
pub fn accessible_role(&self) -> AccessibleRole
pub fn accessible_string_property( &self, what: AccessibleStringProperty, ) -> Option<SharedString>
pub fn accessible_action(&self, action: &AccessibilityAction)
pub fn supported_accessibility_actions(&self) -> SupportedAccessibilityAction
pub fn element_count(&self) -> Option<usize>
pub fn element_type_names_and_ids( &self, element_index: usize, ) -> Option<Vec<(SharedString, SharedString)>>
pub fn geometry(&self) -> LogicalRect
Sourcepub fn map_to_window(&self, p: LogicalPoint) -> LogicalPoint
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)
Sourcepub fn map_to_item_tree(
&self,
p: LogicalPoint,
item_tree: &VRc<ItemTreeVTable>,
) -> LogicalPoint
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)
Sourcepub fn item_tree(&self) -> &VRc<ItemTreeVTable>
pub fn item_tree(&self) -> &VRc<ItemTreeVTable>
Returns a reference to the ItemTree holding this item
Sourcepub fn first_child(&self) -> Option<Self>
pub fn first_child(&self) -> Option<Self>
The first child Item of this Item
Sourcepub fn last_child(&self) -> Option<Self>
pub fn last_child(&self) -> Option<Self>
The last child Item of this Item
Sourcepub fn previous_sibling(&self) -> Option<Self>
pub fn previous_sibling(&self) -> Option<Self>
The previous sibling of this Item
Sourcepub fn next_sibling(&self) -> Option<Self>
pub fn next_sibling(&self) -> Option<Self>
The next sibling of this Item
Sourcepub fn previous_focus_item(&self) -> Self
pub fn previous_focus_item(&self) -> Self
Move tab focus to the previous item:
Sourcepub fn next_focus_item(&self) -> Self
pub fn next_focus_item(&self) -> Self
Move tab focus to the next item:
pub fn window_adapter(&self) -> Option<WindowAdapterRc>
Sourcepub fn visit_descendants<R>(
&self,
visitor: impl FnMut(&ItemRc) -> ControlFlow<R>,
) -> Option<R>
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.