class SemanticsSource
Defined at line 21 of file ../../src/ui/a11y/lib/semantics/semantics_source.h
An interface for a11y query existing semantic information.
Public Methods
void SemanticsSource ()
Defined at line 23 of file ../../src/ui/a11y/lib/semantics/semantics_source.h
bool ViewHasSemantics (zx_koid_t view_ref_koid)
Returns true if the view referenced by |view_ref_koid| is providing semantics.
std::optional<fuchsia::ui::views::ViewRef> ViewRefClone (zx_koid_t view_ref_koid)
Returns a clone of the ViewRef referenced by |view_ref_koid| if it is known.
TODO(https://fxbug.dev/42123849): Move ViewRefClone from SemanticsSource to ViewRefWrapper.
const fuchsia::accessibility::semantics::Node * GetSemanticNode (zx_koid_t koid, uint32_t node_id)
Returns the semantic node with id |node_id| in the semantic tree with koid |koid|, if one
exists. Returns nullptr if |koid| is invalid, or if no node with id |node_id| is found.
const fuchsia::accessibility::semantics::Node * GetParentNode (zx_koid_t koid, uint32_t node_id)
Returns the parent of the node with id |node_id|. Returns nullptr if the
input node is the root.
Currently O(N). TODO(https://fxbug.dev/42059816): improve this.
const fuchsia::accessibility::semantics::Node * GetNextNode (zx_koid_t koid, uint32_t node_id, a11y::NodeFilter filter)
Returns the next node in traversal-order neighbors relative to the node with id |node_id|.
const fuchsia::accessibility::semantics::Node * GetNextNode (zx_koid_t koid, uint32_t node_id, a11y::NodeFilterWithParent filter)
Returns the next node in traversal-order neighbors relative to the node with id |node_id|.
This version provides both the node and its parent to the 'filter' function, for convenience.
const fuchsia::accessibility::semantics::Node * GetPreviousNode (zx_koid_t koid, uint32_t node_id, a11y::NodeFilter filter)
Returns the previous node in traversal-order neighbors relative to the node with id |node_id|.
Note: Currently O(N). TODO(https://fxbug.dev/42060491): improve this.
const fuchsia::accessibility::semantics::Node * GetPreviousNode (zx_koid_t koid, uint32_t node_id, a11y::NodeFilterWithParent filter)
Returns the previous node in traversal-order neighbors relative to the node with id |node_id|.
This version provides both the node and its parent to the 'filter' function, for convenience.
Note: Currently O(N). TODO(https://fxbug.dev/42060491): improve this.
void ExecuteHitTesting (zx_koid_t koid, fuchsia::math::PointF local_point, fuchsia::accessibility::semantics::SemanticListener::HitTestCallback callback)
Performs a hit test at the point specified by |local_point| within the view corresponding to
|koid|. If no such view is found, this function will return without attempting a hit test.
void PerformAccessibilityAction (zx_koid_t koid, uint32_t node_id, fuchsia::accessibility::semantics::Action action, fuchsia::accessibility::semantics::SemanticListener::OnAccessibilityActionRequestedCallback callback)
Performs accessibility action on node with id |node_id| in view with koid |koid|.
If no such view is found, this function will return without attempting a hit test.
std::optional<SemanticTransform> GetNodeToRootTransform (zx_koid_t , uint32_t node_id)
Returns a std::optional
<SemanticTransform
> to transform coordinates from node-local space into
view-root space. If the transform cannot be computed, then this method returns std::nullopt.
void ~SemanticsSource ()
Defined at line 24 of file ../../src/ui/a11y/lib/semantics/semantics_source.h