Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
flutter::TestAccessibilityBridge Class Reference

#include <test_accessibility_bridge.h>

Inheritance diagram for flutter::TestAccessibilityBridge:
flutter::AccessibilityBridge flutter::FlutterPlatformNodeDelegate::OwnerBridge ui::AXPlatformTreeManager ui::AXTreeObserver flutter::AccessibilityBridgeIos ui::AXTreeManager

Public Member Functions

 TestAccessibilityBridge ()=default
 
void DispatchAccessibilityAction (AccessibilityNodeId target, FlutterSemanticsAction action, fml::MallocMapping data) override
 Dispatch accessibility action back to the Flutter framework. These actions are generated in the native accessibility system when users interact with the assistive technologies. For example, a FlutterSemanticsAction::kFlutterSemanticsActionTap is fired when user click or touch the screen. More...
 
- Public Member Functions inherited from flutter::AccessibilityBridge
 AccessibilityBridge ()
 Creates a new instance of a accessibility bridge. More...
 
virtual ~AccessibilityBridge ()
 
void AddFlutterSemanticsNodeUpdate (const FlutterSemanticsNode2 &node)
 Adds a semantics node update to the pending semantics update. Calling this method alone will NOT update the semantics tree. To flush the pending updates, call the CommitUpdates(). More...
 
void AddFlutterSemanticsCustomActionUpdate (const FlutterSemanticsCustomAction2 &action)
 Adds a custom semantics action update to the pending semantics update. Calling this method alone will NOT update the semantics tree. To flush the pending updates, call the CommitUpdates(). More...
 
void CommitUpdates ()
 Flushes the pending updates and applies them to this accessibility bridge. Calling this with no pending updates does nothing, and callers should call this method at the end of an atomic batch to avoid leaving the tree in a unstable state. For example if a node reparents from A to B, callers should only call this method when both removal from A and addition to B are in the pending updates. More...
 
std::weak_ptr< FlutterPlatformNodeDelegateGetFlutterPlatformNodeDelegateFromID (AccessibilityNodeId id) const
 Get the flutter platform node delegate with the given id from this accessibility bridge. Returns expired weak_ptr if the delegate associated with the id does not exist or has been removed from the accessibility tree. More...
 
const ui::AXTreeDataGetAXTreeData () const
 Get the ax tree data from this accessibility bridge. The tree data contains information such as the id of the node that has the keyboard focus or the text selection range. More...
 
const std::vector< ui::AXEventGenerator::TargetedEventGetPendingEvents () const
 Gets all pending accessibility events generated during semantics updates. This is useful when deciding how to handle events in AccessibilityBridgeDelegate::OnAccessibilityEvent in case one may decide to handle an event differently based on all pending events. More...
 
ui::AXNodeGetNodeFromTree (const ui::AXTreeID tree_id, const ui::AXNode::AXID node_id) const override
 
ui::AXNodeGetNodeFromTree (const ui::AXNode::AXID node_id) const override
 
ui::AXTreeID GetTreeID () const override
 
ui::AXTreeID GetParentTreeID () const override
 
ui::AXNodeGetRootAsAXNode () const override
 
ui::AXNodeGetParentNodeFromParentTreeAsAXNode () const override
 
ui::AXTreeGetTree () const override
 
ui::AXPlatformNodeGetPlatformNodeFromTree (const ui::AXNode::AXID node_id) const override
 
ui::AXPlatformNodeGetPlatformNodeFromTree (const ui::AXNode &node) const override
 
ui::AXPlatformNodeDelegateRootDelegate () const override
 
 AccessibilityBridge (FlutterViewController *view_controller, PlatformViewIOS *platform_view, std::shared_ptr< FlutterPlatformViewsController > platform_views_controller, std::unique_ptr< IosDelegate > ios_delegate=nullptr)
 
 ~AccessibilityBridge ()
 
void UpdateSemantics (flutter::SemanticsNodeUpdates nodes, const flutter::CustomAccessibilityActionUpdates &actions)
 
void HandleEvent (NSDictionary< NSString *, id > *annotatedEvent)
 
void DispatchSemanticsAction (int32_t id, flutter::SemanticsAction action) override
 
void DispatchSemanticsAction (int32_t id, flutter::SemanticsAction action, fml::MallocMapping args) override
 
void AccessibilityObjectDidBecomeFocused (int32_t id) override
 
void AccessibilityObjectDidLoseFocus (int32_t id) override
 
UIView< UITextInput > * textInputView () override
 
UIView * view () const override
 
bool isVoiceOverRunning () const override
 
fml::WeakPtr< AccessibilityBridgeGetWeakPtr ()
 
std::shared_ptr< FlutterPlatformViewsControllerGetPlatformViewsController () const override
 
void clearState ()
 
- Public Member Functions inherited from flutter::FlutterPlatformNodeDelegate::OwnerBridge
virtual ~OwnerBridge ()=default
 
virtual gfx::RectF RelativeToGlobalBounds (const ui::AXNode *node, bool &offscreen, bool clip_bounds)=0
 Gets the rectangular bounds of the ax node relative to global coordinate. More...
 
- Public Member Functions inherited from ui::AXPlatformTreeManager
virtual ~AXPlatformTreeManager ()=default
 
virtual AXPlatformNodeGetPlatformNodeFromTree (const AXNode::AXID node_id) const =0
 
virtual AXPlatformNodeGetPlatformNodeFromTree (const AXNode &node) const =0
 
virtual AXPlatformNodeDelegateRootDelegate () const =0
 
- Public Member Functions inherited from ui::AXTreeManager
virtual ~AXTreeManager ()=default
 
virtual AXNodeGetNodeFromTree (const AXTreeID tree_id, const AXNode::AXID node_id) const =0
 
virtual AXNodeGetNodeFromTree (const AXNode::AXID node_id) const =0
 
virtual AXTreeID GetTreeID () const =0
 
virtual AXTreeID GetParentTreeID () const =0
 
virtual AXNodeGetRootAsAXNode () const =0
 
virtual AXNodeGetParentNodeFromParentTreeAsAXNode () const =0
 
virtual AXTreeGetTree () const =0
 
- Public Member Functions inherited from flutter::AccessibilityBridgeIos
virtual ~AccessibilityBridgeIos ()=default
 
virtual UIView * view () const =0
 
virtual bool isVoiceOverRunning () const =0
 
virtual UIView< UITextInput > * textInputView ()=0
 
virtual void DispatchSemanticsAction (int32_t id, flutter::SemanticsAction action)=0
 
virtual void DispatchSemanticsAction (int32_t id, flutter::SemanticsAction action, fml::MallocMapping args)=0
 
virtual void AccessibilityObjectDidBecomeFocused (int32_t id)=0
 
virtual void AccessibilityObjectDidLoseFocus (int32_t id)=0
 
virtual std::shared_ptr< FlutterPlatformViewsControllerGetPlatformViewsController () const =0
 

Public Attributes

std::vector< ui::AXEventGenerator::Eventaccessibility_events
 
std::vector< FlutterSemanticsActionperformed_actions
 

Protected Member Functions

void OnAccessibilityEvent (ui::AXEventGenerator::TargetedEvent targeted_event) override
 Handle accessibility events generated due to accessibility tree changes. These events are needed to be sent to native accessibility system. See ui::AXEventGenerator::Event for possible events. More...
 
std::shared_ptr< FlutterPlatformNodeDelegateCreateFlutterPlatformNodeDelegate () override
 Creates a platform specific FlutterPlatformNodeDelegate. Ownership passes to the caller. This method will be called whenever a new AXNode is created in AXTree. Each platform needs to implement this method in order to inject its subclass into the accessibility bridge. More...
 
virtual void OnAccessibilityEvent (ui::AXEventGenerator::TargetedEvent targeted_event)=0
 Handle accessibility events generated due to accessibility tree changes. These events are needed to be sent to native accessibility system. See ui::AXEventGenerator::Event for possible events. More...
 
virtual std::shared_ptr< FlutterPlatformNodeDelegateCreateFlutterPlatformNodeDelegate ()=0
 Creates a platform specific FlutterPlatformNodeDelegate. Ownership passes to the caller. This method will be called whenever a new AXNode is created in AXTree. Each platform needs to implement this method in order to inject its subclass into the accessibility bridge. More...
 
virtual void DispatchAccessibilityAction (AccessibilityNodeId target, FlutterSemanticsAction action, fml::MallocMapping data)=0
 Dispatch accessibility action back to the Flutter framework. These actions are generated in the native accessibility system when users interact with the assistive technologies. For example, a FlutterSemanticsAction::kFlutterSemanticsActionTap is fired when user click or touch the screen. More...
 
virtual gfx::NativeViewAccessible GetNativeAccessibleFromId (AccessibilityNodeId id)=0
 Get the native accessibility node with the given id. More...
 
virtual AccessibilityNodeId GetLastFocusedId ()=0
 Get the last id of the node that received accessibility focus. More...
 
virtual void SetLastFocusedId (AccessibilityNodeId node_id)=0
 Update the id of the node that is currently foucsed by the native accessibility system. More...
 

Detailed Description

Definition at line 12 of file test_accessibility_bridge.h.

Constructor & Destructor Documentation

◆ TestAccessibilityBridge()

flutter::TestAccessibilityBridge::TestAccessibilityBridge ( )
default

Member Function Documentation

◆ CreateFlutterPlatformNodeDelegate()

std::shared_ptr< FlutterPlatformNodeDelegate > flutter::TestAccessibilityBridge::CreateFlutterPlatformNodeDelegate ( )
overrideprotectedvirtual

Creates a platform specific FlutterPlatformNodeDelegate. Ownership passes to the caller. This method will be called whenever a new AXNode is created in AXTree. Each platform needs to implement this method in order to inject its subclass into the accessibility bridge.

Implements flutter::AccessibilityBridge.

Definition at line 10 of file test_accessibility_bridge.cc.

10 {
11 return std::make_unique<FlutterPlatformNodeDelegate>();
12};

◆ DispatchAccessibilityAction()

void flutter::TestAccessibilityBridge::DispatchAccessibilityAction ( AccessibilityNodeId  target,
FlutterSemanticsAction  action,
fml::MallocMapping  data 
)
overridevirtual

Dispatch accessibility action back to the Flutter framework. These actions are generated in the native accessibility system when users interact with the assistive technologies. For example, a FlutterSemanticsAction::kFlutterSemanticsActionTap is fired when user click or touch the screen.

Parameters
[in]targetThe semantics node id of the action target.
[in]actionThe generated flutter semantics action.
[in]dataAdditional data associated with the action.

Implements flutter::FlutterPlatformNodeDelegate::OwnerBridge.

Definition at line 19 of file test_accessibility_bridge.cc.

22 {
23 performed_actions.push_back(action);
24}
std::vector< FlutterSemanticsAction > performed_actions

◆ OnAccessibilityEvent()

void flutter::TestAccessibilityBridge::OnAccessibilityEvent ( ui::AXEventGenerator::TargetedEvent  targeted_event)
overrideprotectedvirtual

Handle accessibility events generated due to accessibility tree changes. These events are needed to be sent to native accessibility system. See ui::AXEventGenerator::Event for possible events.

Parameters
[in]targeted_eventThe object that contains both the generated event and the event target.

Implements flutter::AccessibilityBridge.

Definition at line 14 of file test_accessibility_bridge.cc.

15 {
16 accessibility_events.push_back(targeted_event.event_params.event);
17}
std::vector< ui::AXEventGenerator::Event > accessibility_events

Member Data Documentation

◆ accessibility_events

std::vector<ui::AXEventGenerator::Event> flutter::TestAccessibilityBridge::accessibility_events

Definition at line 20 of file test_accessibility_bridge.h.

◆ performed_actions

std::vector<FlutterSemanticsAction> flutter::TestAccessibilityBridge::performed_actions

Definition at line 21 of file test_accessibility_bridge.h.


The documentation for this class was generated from the following files: