.. index:: pair: class; EE::UI::AccessibilityManager .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager: class EE::UI::AccessibilityManager ================================== .. toctree:: :hidden: struct_EE_UI_AccessibilityManager_ChildrenCacheEntry.rst class_EE_UI_AccessibilityManager_ScopedDispatch.rst Overview ~~~~~~~~ Resolves accessibility information directly from the live :ref:`UI ` tree. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class AccessibilityManager { public: // structs struct :ref:`ChildrenCacheEntry`; // classes class :ref:`ScopedDispatch`; // construction :target:`AccessibilityManager`(:ref:`UISceneNode`* scene); :target:`~AccessibilityManager`(); // methods :ref:`AccessibilityNodeRef` :target:`getRoot`(); :ref:`AccessibilityNodeRef` :target:`getNodeRef`(:ref:`UIWidget`* widget); :ref:`AccessibilityNodeRef` :ref:`findNodeRef`(:ref:`UIWidget`* widget) const; bool :target:`isValid`(:ref:`AccessibilityNodeRef` ref) const; :ref:`AccessibilityRole` :ref:`getNodeRole`(:ref:`AccessibilityNodeRef` ref) const; :ref:`AccessibilityState` :target:`getNodeState`(:ref:`AccessibilityNodeRef` ref) const; :ref:`AccessibilityNodeInfo` :target:`getNodeInfo`(:ref:`AccessibilityNodeRef` ref, bool includeValue = true) const; :ref:`AccessibilityNodeInfo` :ref:`getNodeInfo`(:ref:`AccessibilityNodeRef` ref, bool includeValue, bool includeTextOffsets) const; :ref:`AccessibilityNodeRef` :target:`getParent`(:ref:`AccessibilityNodeRef` ref); :ref:`Int32` :target:`getIndexInParent`(:ref:`AccessibilityNodeRef` ref); :ref:`AccessibilityTextInfo` :target:`getTextInfo`(:ref:`AccessibilityNodeRef` ref) const; :ref:`Int32` :ref:`getTextLength`(:ref:`AccessibilityNodeRef` ref) const; :ref:`String` :target:`getTextRange`(:ref:`AccessibilityNodeRef` ref, :ref:`Int32` start, :ref:`Int32` end) const; bool :ref:`getTextLineBounds`(:ref:`AccessibilityNodeRef` ref, :ref:`Int32` offset, :ref:`Int32`& start, :ref:`Int32`& end) const; :ref:`AccessibilityTextRevision` :target:`getTextRevision`(:ref:`AccessibilityNodeRef` ref) const; void :ref:`onTextChanged`(:ref:`UIWidget`* widget, const :ref:`Doc::DocumentContentChange`* change); void :ref:`setSuppressedTextChanges`(:ref:`AccessibilityNodeRef` ref); size_t :target:`getChildCount`(:ref:`AccessibilityNodeRef` ref); :ref:`AccessibilityNodeRef` :target:`getChild`(:ref:`AccessibilityNodeRef` ref, size_t index); const std::vector<:ref:`AccessibilityNodeRef`>& :target:`getChildren`(:ref:`AccessibilityNodeRef` ref); std::vector<:ref:`AccessibilityNodeRef`> :target:`getSelectedChildren`(:ref:`AccessibilityNodeRef` ref); :ref:`AccessibilityNodeRef` :target:`hitTest`(const :ref:`Math::Vector2f`& screenPosition); :ref:`AccessibilityNodeRef` :target:`getKeyboardFocusedNode`(); bool :target:`performAction`(:ref:`AccessibilityNodeRef` ref, const :ref:`AccessibilityActionRequest`& request); bool :target:`isBackendAvailable`() const; bool :target:`isBackendInitializationComplete`() const; bool :target:`hasActiveNativeClients`() const; void :ref:`onNativeClientObserved`(); void :ref:`onClientsDisconnected`(); void :target:`update`(); void :ref:`setBackend`(std::unique_ptr backend); :ref:`UISceneNode`* :target:`getSceneNode`() const; void :target:`notify`(:ref:`AccessibilityNodeRef` ref, :ref:`AccessibilityEvent` event, :ref:`AccessibilityNodeRef` related = {}, :ref:`Int32` index = -1); const std::vector<:ref:`AccessibilityPendingEvent`>& :target:`getPendingEvents`() const; void :target:`clearPendingEvents`(); void :ref:`announce`(const :ref:`String`& message, :ref:`AccessibilityLive` priority = :ref:`AccessibilityLive::Polite`); void :ref:`onLiveRegionChanged`(:ref:`UIWidget`* widget, :ref:`AccessibilityLive` priority); const std::vector<:ref:`AccessibilityAnnouncement`>& :target:`getPendingAnnouncements`() const; void :ref:`onRelationTargetChanged`(const std::string& id, const :ref:`Scene::Node`* excluded = nullptr); bool :ref:`isRelationTarget`(:ref:`String::HashType` idHash) const; void :ref:`onRelationSubtreeChanged`(const :ref:`Scene::Node`* subtree, bool removed); void :ref:`onNodeParentChange`(:ref:`Scene::Node`* node, bool removed); bool :ref:`onWidgetAccessibilitySourceDelete`(:ref:`UIWidget`* widget); void :ref:`onWidgetDelete`(:ref:`UIWidget`* widget); void :ref:`onSubtreeRemoved`(:ref:`Scene::Node`* node); }; .. _details-class_e_e_1_1_u_i_1_1_accessibility_manager: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Resolves accessibility information directly from the live :ref:`UI ` tree. Methods ------- .. index:: pair: function; findNodeRef .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1aab9b830f6b36f4682b471008c7de2cd8: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`AccessibilityNodeRef` findNodeRef(:ref:`UIWidget`* widget) const The widget's identity if one was handed out, without registering one. Clients only hold handed-out identities, so property changes of other widgets need no notification. .. index:: pair: function; getNodeRole .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a4c7024953500272c27427391cae77d58: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`AccessibilityRole` getNodeRole(:ref:`AccessibilityNodeRef` ref) const Scalar queries avoid constructing names, values, text offsets or relation caches. .. index:: pair: function; getNodeInfo .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a791db01eb2857d86c049ea7f0bf5ca95: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`AccessibilityNodeInfo` getNodeInfo(:ref:`AccessibilityNodeRef` ref, bool includeValue, bool includeTextOffsets) const Native metadata queries may also omit document-offset calculation. .. index:: pair: function; getTextLength .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a278673529783b2f1ebd49b573e5eda76: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Int32` getTextLength(:ref:`AccessibilityNodeRef` ref) const Ranged text access in code points. Prefer these over :ref:`getNodeInfo() ` 's value for text elements: they never copy more than the requested range. .. index:: pair: function; getTextLineBounds .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1aae3c7be794dfd1d724453fc8b90d79a6: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool getTextLineBounds(:ref:`AccessibilityNodeRef` ref, :ref:`Int32` offset, :ref:`Int32`& start, :ref:`Int32`& end) const The line containing ``offset`` : [start, end), end past its newline. .. index:: pair: function; onTextChanged .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1afcf65f89e47cc8c380a3cea5977d10bd: .. ref-code-block:: cpp :class: doxyrest-title-code-block void onTextChanged(:ref:`UIWidget`* widget, const :ref:`Doc::DocumentContentChange`* change) Reports an edit of a text widget's document, or nullptr when its whole text was replaced. Only backends requesting edit records receive them. The first few edits per widget and frame are forwarded exactly; later ones collapse into a single whole-text change, so a replace-all costs one notification. .. index:: pair: function; setSuppressedTextChanges .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a8274566cacca75cbc0d084d0038a1604: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setSuppressedTextChanges(:ref:`AccessibilityNodeRef` ref) While set, text changes of this element are not forwarded: the caller reports them itself (AT-SPI SetTextContents sends one minimal diff). Node refs are local to this manager, so another window's element sharing the document still reports its changes. Pass an invalid ref to clear. .. index:: pair: function; onNativeClientObserved .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a5b594a9793712be233a4129e4379f921: .. ref-code-block:: cpp :class: doxyrest-title-code-block void onNativeClientObserved() Updates the scene's cached fast-path flag after an actual native accessibility query. .. index:: pair: function; onClientsDisconnected .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a91e920103c20c71f656c096b6eaf76c3: .. ref-code-block:: cpp :class: doxyrest-title-code-block void onClientsDisconnected() The scene's last client went away: releases what only clients needed, such as queried model rows and their persistent model registrations. Identities are never reused, so a reconnecting client cannot reach a stale row. .. index:: pair: function; setBackend .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a107900ee1ec1eea8bd9cad6db1454507: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setBackend(std::unique_ptr backend) Replaces the platform backend, which :ref:`update() ` otherwise creates on first use. Intended for tests that observe what the manager delivers. .. index:: pair: function; announce .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a525b21bbe737651a0be0f9b74b81a1fc: .. ref-code-block:: cpp :class: doxyrest-title-code-block void announce(const :ref:`String`& message, :ref:`AccessibilityLive` priority = :ref:`AccessibilityLive::Polite`) Asks assistive clients to speak a message without moving focus. Delivered on the next :ref:`update() `; a no-op while no client is active. .. index:: pair: function; onLiveRegionChanged .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a1d4ab30612ca4736b14819f0468ad0a1: .. ref-code-block:: cpp :class: doxyrest-title-code-block void onLiveRegionChanged(:ref:`UIWidget`* widget, :ref:`AccessibilityLive` priority) Queues the current text of a widget inside a live region, replacing any announcement the same widget queued earlier in this frame. .. index:: pair: function; onRelationTargetChanged .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a3ce223b98db290de9872ab13ddc6d1b2: .. ref-code-block:: cpp :class: doxyrest-title-code-block void onRelationTargetChanged(const std::string& id, const :ref:`Scene::Node`* excluded = nullptr) The widget with this id changed its name, appeared or went away. Widgets that a client read and that are named or described by it (aria-labelledby, aria-describedby) report NameChanged or DescriptionChanged. Dependents inside ``excluded`` are skipped. .. index:: pair: function; isRelationTarget .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a5a4ce49681e723ad79d40f2c38abb7a4: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool isRelationTarget(:ref:`String::HashType` idHash) const Whether an active client may hold a name or description resolved through the id with this hash, so its dependents must be told when that id goes away. Allocation-free; it matches exactly what :ref:`onRelationTargetChanged() ` would act on. .. index:: pair: function; onRelationSubtreeChanged .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a3fa6118636717b95655d37c94907f191: .. ref-code-block:: cpp :class: doxyrest-title-code-block void onRelationSubtreeChanged(const :ref:`Scene::Node`* subtree, bool removed) A subtree appeared or is going away: notifies the dependents of each relation target in it, except those inside the subtree when it is going away. .. index:: pair: function; onNodeParentChange .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a17619368a865f55ab9ee09de690625af: .. ref-code-block:: cpp :class: doxyrest-title-code-block void onNodeParentChange(:ref:`Scene::Node`* node, bool removed) Reports a reparent/reorder edge for the exposed roots of a widget or plain-node subtree. Removal is reported while the old parent links are intact; arrival after final relinking. .. index:: pair: function; onWidgetAccessibilitySourceDelete .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a0a4f3c53da39da0425d745920aa6a000: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool onWidgetAccessibilitySourceDelete(:ref:`UIWidget`* widget) Returns whether the widget owned a model source that has now been released. .. index:: pair: function; onWidgetDelete .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1a048ded5993a75693a0475f5f20de1880: .. ref-code-block:: cpp :class: doxyrest-title-code-block void onWidgetDelete(:ref:`UIWidget`* widget) Empty and native-root-only managers skip invalidation inline, without a tree walk. Explicit semantic queries can retain descendants/text indexes without a native client: those still require invalidation. Active root relations also require the full path. .. index:: pair: function; onSubtreeRemoved .. _doxid-class_e_e_1_1_u_i_1_1_accessibility_manager_1aecab70769677d817a387d43ecb26686c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void onSubtreeRemoved(:ref:`Scene::Node`* node) Invalidates registered identities before a subtree changes accessibility owners.