pub struct HitTester { /* private fields */ }Expand description
Hit tester for finding accessible elements at a point.
Implementations§
Source§impl HitTester
impl HitTester
Sourcepub fn with_tree(tree: AccessibilityTree) -> Self
pub fn with_tree(tree: AccessibilityTree) -> Self
Create a hit tester with an existing tree.
Sourcepub fn tree(&self) -> &AccessibilityTree
pub fn tree(&self) -> &AccessibilityTree
Get the underlying tree.
Sourcepub fn tree_mut(&mut self) -> &mut AccessibilityTree
pub fn tree_mut(&mut self) -> &mut AccessibilityTree
Get mutable access to the tree.
Sourcepub fn hit_test(&self, point: Point) -> Option<&AccessibleNode>
pub fn hit_test(&self, point: Point) -> Option<&AccessibleNode>
Find the deepest accessible element at the given point.
Sourcepub fn hit_test_id(&self, point: Point) -> Option<AccessibleNodeId>
pub fn hit_test_id(&self, point: Point) -> Option<AccessibleNodeId>
Find the ID of the deepest accessible element at the given point.
Sourcepub fn hit_test_all(&self, point: Point) -> Vec<&AccessibleNode>
pub fn hit_test_all(&self, point: Point) -> Vec<&AccessibleNode>
Find all accessible elements at the given point (from topmost to root).
Sourcepub fn hit_test_all_ids(&self, point: Point) -> Vec<AccessibleNodeId>
pub fn hit_test_all_ids(&self, point: Point) -> Vec<AccessibleNodeId>
Find all element IDs at the given point.
Sourcepub fn hit_test_focusable(&self, point: Point) -> Option<&AccessibleNode>
pub fn hit_test_focusable(&self, point: Point) -> Option<&AccessibleNode>
Find the first focusable element at the given point.
Sourcepub fn hit_test_role(
&self,
point: Point,
role: AccessibleRole,
) -> Vec<&AccessibleNode>
pub fn hit_test_role( &self, point: Point, role: AccessibleRole, ) -> Vec<&AccessibleNode>
Find all elements with a specific role at the given point.