.. index:: pair: class; EE::UI::AccessibilityWidgetResolver .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver: class EE::UI::AccessibilityWidgetResolver ========================================= .. toctree:: :hidden: Overview ~~~~~~~~ Resolves standard widget semantics directly from the live widget instance. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class AccessibilityWidgetResolver { public: // methods static :ref:`AccessibilityRole` :target:`getRole`(const :ref:`UIWidget`* widget); static :ref:`Uint8` :target:`getHeadingLevel`(const :ref:`UIWidget`* widget); static void :ref:`onHTMLTextChanged`(:ref:`UIWidget`* widget, std::optional<:ref:`AccessibilityRole`> previousRole = std::nullopt); static const char* :ref:`getRoleName`(:ref:`AccessibilityRole` role); static bool :ref:`isLeafRole`(:ref:`AccessibilityRole` role); static :ref:`UIWidget`* :ref:`getLeafOwner`(const :ref:`Scene::Node`* node); static bool :ref:`isHiddenFromAccessibility`(const :ref:`UIWidget`* widget); static :ref:`String` :target:`getName`(const :ref:`UIWidget`* widget); static :ref:`String` :target:`getDescription`(const :ref:`UIWidget`* widget); static :ref:`String` :target:`getValue`(const :ref:`UIWidget`* widget); static :ref:`AccessibilityShortcut` :ref:`getShortcut`(const :ref:`UIWidget`* widget); static :ref:`AccessibilityRangeInfo` :target:`getRange`(const :ref:`UIWidget`* widget); static :ref:`AccessibilityTextInfo` :target:`getText`(const :ref:`UIWidget`* widget); static :ref:`AccessibilityTextInfo` :ref:`getText`(const :ref:`UIWidget`* widget, bool includeOffsets); static const :ref:`Doc::TextDocument`* :ref:`getTextDocument`(const :ref:`UIWidget`* widget); static :ref:`Int32` :ref:`getTextLength`(const :ref:`UIWidget`* widget); static :ref:`String` :target:`getTextRange`(const :ref:`UIWidget`* widget, :ref:`Int32` start, :ref:`Int32` end); static bool :ref:`getTextLineBounds`(const :ref:`UIWidget`* widget, :ref:`Int32` offset, :ref:`Int32`& start, :ref:`Int32`& end); static :ref:`AccessibilityTextRevision` :target:`getTextRevision`(const :ref:`UIWidget`* widget); static :ref:`Int32` :ref:`getTextOffset`(const :ref:`Doc::TextDocument`& document, const :ref:`Doc::TextPosition`& position); static :ref:`AccessibilityState` :target:`getState`(const :ref:`UIWidget`* widget); static :ref:`AccessibilityActions` :target:`getActions`(const :ref:`UIWidget`* widget); static :ref:`UIWidget`* :ref:`getOwningModelView`(const :ref:`Scene::Node`* node); static :ref:`UIWidget`* :ref:`getFocusOwner`(:ref:`Scene::Node`* focused, const :ref:`UIWidget`* sceneRoot); static :ref:`UIWidget`* :ref:`getEventTarget`(:ref:`UIWidget`* widget, :ref:`AccessibilityEvent` event); static bool :target:`performAction`(:ref:`UIWidget`* widget, const :ref:`AccessibilityActionRequest`& request); static std::vector<:ref:`AccessibilityIssue`> :ref:`audit`(const :ref:`UIWidget`* root); }; .. _details-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Resolves standard widget semantics directly from the live widget instance. Methods ------- .. index:: pair: function; onHTMLTextChanged .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1a940d520e021b17db5ded821f9fa576a9: .. ref-code-block:: cpp :class: doxyrest-title-code-block static void onHTMLTextChanged(:ref:`UIWidget`* widget, std::optional<:ref:`AccessibilityRole`> previousRole = std::nullopt) Updates queried HTML text and named ancestors. Called only after the activity gate. .. index:: pair: function; getRoleName .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1ae99d205f92fbce45cbc76e5dbee1a69b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static const char* getRoleName(:ref:`AccessibilityRole` role) A readable role name for tools and logs, for example "CheckBox". .. index:: pair: function; isLeafRole .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1a849fdb48bb11b26788f52b5bb129fe1c: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool isLeafRole(:ref:`AccessibilityRole` role) Controls whose content is fully described by their own name, value and state. Their implementation children (a button's text view, a menu item's shortcut label) are not exposed. .. index:: pair: function; getLeafOwner .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1ad35450cbc561c58b9c46cb326cb2647b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`UIWidget`* getLeafOwner(const :ref:`Scene::Node`* node) The outermost leaf control containing the node, or nullptr when no ancestor is a leaf. .. index:: pair: function; isHiddenFromAccessibility .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1a7d302a15619eb9d17be8783a660988db: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool isHiddenFromAccessibility(const :ref:`UIWidget`* widget) Whether the widget or any ancestor is hidden from accessibility (aria-hidden). .. index:: pair: function; getShortcut .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1afabb884ebc969593a771c9aa8ca43e4b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`AccessibilityShortcut` getShortcut(const :ref:`UIWidget`* widget) The keyboard shortcut of a menu item; empty for every other widget. .. index:: pair: function; getText .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1a6df4b1890a63bbc202456ab6f8987f45: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`AccessibilityTextInfo` getText(const :ref:`UIWidget`* widget, bool includeOffsets) Metadata-only queries avoid scanning document lines to calculate offsets. .. index:: pair: function; getTextDocument .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1ae098efec94756bce516186aaf99459fe: .. ref-code-block:: cpp :class: doxyrest-title-code-block static const :ref:`Doc::TextDocument`* getTextDocument(const :ref:`UIWidget`* widget) The document behind a text element; nullptr for other widgets and for password inputs, whose text is never exposed. .. index:: pair: function; getTextLength .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1af28f2e304d87c35cb07154044246e875: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`Int32` getTextLength(const :ref:`UIWidget`* widget) Ranged text access, in code points. None of these copy more than the requested range. .. index:: pair: function; getTextLineBounds .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1a878d70f7b87078866beef6660b5b9a1b: .. ref-code-block:: cpp :class: doxyrest-title-code-block static bool getTextLineBounds(const :ref:`UIWidget`* widget, :ref:`Int32` offset, :ref:`Int32`& start, :ref:`Int32`& end) The line containing ``offset`` : [start, end), end past its newline. .. index:: pair: function; getTextOffset .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1a8ba8ebf4e01f22a33ac00427394b35a3: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`Int32` getTextOffset(const :ref:`Doc::TextDocument`& document, const :ref:`Doc::TextPosition`& position) Standalone code-point offset calculation, without retaining a document cache (O(lines)). Native widget queries use their manager's optional incremental index instead. .. index:: pair: function; getOwningModelView .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1a147c327d108595408d4cec033161872a: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`UIWidget`* getOwningModelView(const :ref:`Scene::Node`* node) Returns the model view whose virtual nodes represent this widget, or nullptr when the widget is exposed directly: outside every model view, or inside its active cell editor. .. index:: pair: function; getFocusOwner .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1a52fd48e6033efa2729daffa67707d608: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`UIWidget`* getFocusOwner(:ref:`Scene::Node`* focused, const :ref:`UIWidget`* sceneRoot) Projects the keyboard focus node onto the accessibility element that exposes it. Hidden implementation children (for example a spin box's input) resolve to their semantic owner. .. index:: pair: function; getEventTarget .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1a02dc4a6ec6fa1a7ef522267b44c103fc: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`UIWidget`* getEventTarget(:ref:`UIWidget`* widget, :ref:`AccessibilityEvent` event) Routes internal control state changes to their semantic owner. .. index:: pair: function; audit .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_widget_resolver_1a5e98db30b3b21145ed9ad77cdbe56006: .. ref-code-block:: cpp :class: doxyrest-title-code-block static std::vector<:ref:`AccessibilityIssue`> audit(const :ref:`UIWidget`* root) Lists common authoring problems in a widget tree: controls without an accessible name and aria-labelledby / aria-describedby ids that resolve to nothing. Hidden and invisible subtrees are skipped, as are the implementation children of model views.