Flutter Engine
The Flutter Engine
accessibility_bridge_windows.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_ACCESSIBILITY_BRIDGE_WINDOWS_H_
6#define FLUTTER_SHELL_PLATFORM_WINDOWS_ACCESSIBILITY_BRIDGE_WINDOWS_H_
7
8#include "flutter/fml/macros.h"
9#include "flutter/shell/platform/common/accessibility_bridge.h"
10#include "flutter/third_party/accessibility/ax/platform/ax_fragment_root_delegate_win.h"
11
12namespace flutter {
13
14class FlutterWindowsEngine;
15class FlutterWindowsView;
16class FlutterPlatformNodeDelegateWindows;
17
18// The Win32 implementation of AccessibilityBridge.
19//
20// This interacts with Windows accessibility APIs, which includes routing
21// accessibility events fired from the framework to Windows, routing native
22// Windows accessibility events to the framework, and creating Windows-specific
23// FlutterPlatformNodeDelegate objects for each node in the semantics tree.
24///
25/// AccessibilityBridgeWindows must be created as a shared_ptr, since some
26/// methods acquires its weak_ptr.
29 public:
31 virtual ~AccessibilityBridgeWindows() = default;
32
33 // |AccessibilityBridge|
36 fml::MallocMapping data) override;
37
38 // Dispatches a Windows accessibility event of the specified type, generated
39 // by the accessibility node associated with the specified semantics node.
40 //
41 // This is a virtual method for the convenience of unit tests.
43 std::shared_ptr<FlutterPlatformNodeDelegateWindows> node_delegate,
45
46 // Sets the accessibility focus to the accessibility node associated with the
47 // specified semantics node.
48 //
49 // This is a virtual method for the convenience of unit tests.
50 virtual void SetFocus(
51 std::shared_ptr<FlutterPlatformNodeDelegateWindows> node_delegate);
52
53 // |AXFragmentRootDelegateWin|
55
56 // |AXFragmentRootDelegateWin|
58
59 // |AXFragmentRootDelegateWin|
60 bool IsAXFragmentRootAControlElement() override;
61
62 protected:
63 // |AccessibilityBridge|
65 ui::AXEventGenerator::TargetedEvent targeted_event) override;
66
67 // |AccessibilityBridge|
68 std::shared_ptr<FlutterPlatformNodeDelegate>
70
71 // Retrieve the focused node for accessibility events.
72 virtual std::weak_ptr<FlutterPlatformNodeDelegate> GetFocusedNode();
73
74 private:
75 FlutterWindowsView* view_;
76
77 FML_DISALLOW_COPY_AND_ASSIGN(AccessibilityBridgeWindows);
78};
79
80} // namespace flutter
81
82#endif // FLUTTER_SHELL_PLATFORM_WINDOWS_ACCESSIBILITY_BRIDGE_WINDOWS_H_
std::shared_ptr< FlutterPlatformNodeDelegateWindows > node_delegate
ax::mojom::Event event_type
virtual void DispatchWinAccessibilityEvent(std::shared_ptr< FlutterPlatformNodeDelegateWindows > node_delegate, ax::mojom::Event event_type)
virtual std::weak_ptr< FlutterPlatformNodeDelegate > GetFocusedNode()
std::shared_ptr< FlutterPlatformNodeDelegate > CreateFlutterPlatformNodeDelegate() override
Creates a platform specific FlutterPlatformNodeDelegate. Ownership passes to the caller....
void DispatchAccessibilityAction(AccessibilityNodeId target, FlutterSemanticsAction action, fml::MallocMapping data) override
Dispatch accessibility action back to the Flutter framework. These actions are generated in the nativ...
virtual void SetFocus(std::shared_ptr< FlutterPlatformNodeDelegateWindows > node_delegate)
gfx::NativeViewAccessible GetChildOfAXFragmentRoot() override
gfx::NativeViewAccessible GetParentOfAXFragmentRoot() override
virtual ~AccessibilityBridgeWindows()=default
void OnAccessibilityEvent(ui::AXEventGenerator::TargetedEvent targeted_event) override
Handle accessibility events generated due to accessibility tree changes. These events are needed to b...
UIView * view() const override
A Mapping like NonOwnedMapping, but uses Free as its release proc.
Definition: mapping.h:144
FlutterSemanticsAction
Definition: embedder.h:113
uint32_t * target
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41
ui::AXNode::AXID AccessibilityNodeId
UnimplementedNativeViewAccessible * NativeViewAccessible