| Flutter Windows Embedder |

flutter_platform_node_delegate_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_FLUTTER_PLATFORM_NODE_DELEGATE_WINDOWS_H_
6 #define FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_PLATFORM_NODE_DELEGATE_WINDOWS_H_
7
8 #include "flutter/fml/macros.h"
9 #include "flutter/shell/platform/common/flutter_platform_node_delegate.h"
10 #include "flutter/shell/platform/windows/flutter_windows_view.h"
11 #include "flutter/third_party/accessibility/ax/platform/ax_platform_node.h"
12 #include "flutter/third_party/accessibility/ax/platform/ax_unique_id.h"
13
14 namespace flutter {
15
16 // The Windows implementation of FlutterPlatformNodeDelegate.
17 //
18 // This class implements a wrapper around the Windows accessibility objects
19 // that compose the accessibility tree.
20 class FlutterPlatformNodeDelegateWindows : public FlutterPlatformNodeDelegate {
21 public:
22 FlutterPlatformNodeDelegateWindows(std::weak_ptr<AccessibilityBridge> bridge,
23 FlutterWindowsView* view);
24 virtual ~FlutterPlatformNodeDelegateWindows();
25
26 // |ui::AXPlatformNodeDelegate|
27 void Init(std::weak_ptr<OwnerBridge> bridge, ui::AXNode* node) override;
28
29 // |ui::AXPlatformNodeDelegate|
30 gfx::NativeViewAccessible GetNativeViewAccessible() override;
31
32 // |ui::AXPlatformNodeDelegate|
33 gfx::NativeViewAccessible HitTestSync(
34 int screen_physical_pixel_x,
35 int screen_physical_pixel_y) const override;
36
37 // |FlutterPlatformNodeDelegate|
38 gfx::Rect GetBoundsRect(
39 const ui::AXCoordinateSystem coordinate_system,
40 const ui::AXClippingBehavior clipping_behavior,
41 ui::AXOffscreenResult* offscreen_result) const override;
42
43 // Dispatches a Windows accessibility event of the specified type, generated
44 // by the accessibility node associated with this object. This is a
45 // convenience wrapper around |NotifyWinEvent|.
46 virtual void DispatchWinAccessibilityEvent(ax::mojom::Event event_type);
47
48 // Sets the accessibility focus to the accessibility node associated with
49 // this object.
50 void SetFocus();
51
52 // | AXPlatformNodeDelegate |
53 gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override;
54
55 // | FlutterPlatformNodeDelegate |
56 ui::AXPlatformNode* GetPlatformNode() const override;
57
58 private:
59 ui::AXPlatformNode* ax_platform_node_;
60 std::weak_ptr<AccessibilityBridge> bridge_;
61 FlutterWindowsView* view_;
62
63 FML_DISALLOW_COPY_AND_ASSIGN(FlutterPlatformNodeDelegateWindows);
64 };
65
66 } // namespace flutter
67
68 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_FLUTTER_PLATFORM_NODE_DELEGATE_WINDOWS_H_
flutter::FlutterPlatformNodeDelegateWindows
Definition: flutter_platform_node_delegate_windows.h:20
flutter::FlutterWindowsView
Definition: flutter_windows_view.h:34
flutter::FlutterPlatformNodeDelegateWindows::GetNativeViewAccessible
gfx::NativeViewAccessible GetNativeViewAccessible() override
Definition: flutter_platform_node_delegate_windows.cc:43
flutter::FlutterPlatformNodeDelegateWindows::FlutterPlatformNodeDelegateWindows
FlutterPlatformNodeDelegateWindows(std::weak_ptr< AccessibilityBridge > bridge, FlutterWindowsView *view)
Definition: flutter_platform_node_delegate_windows.cc:18
flutter::FlutterPlatformNodeDelegateWindows::GetBoundsRect
gfx::Rect GetBoundsRect(const ui::AXCoordinateSystem coordinate_system, const ui::AXClippingBehavior clipping_behavior, ui::AXOffscreenResult *offscreen_result) const override
Definition: flutter_platform_node_delegate_windows.cc:82
flutter::FlutterPlatformNodeDelegateWindows::DispatchWinAccessibilityEvent
virtual void DispatchWinAccessibilityEvent(ax::mojom::Event event_type)
Definition: flutter_platform_node_delegate_windows.cc:96
flutter::FlutterPlatformNodeDelegateWindows::GetTargetForNativeAccessibilityEvent
gfx::AcceleratedWidget GetTargetForNativeAccessibilityEvent() override
Definition: flutter_platform_node_delegate_windows.cc:109
flutter::FlutterPlatformNodeDelegateWindows::HitTestSync
gfx::NativeViewAccessible HitTestSync(int screen_physical_pixel_x, int screen_physical_pixel_y) const override
Definition: flutter_platform_node_delegate_windows.cc:49
flutter::FlutterPlatformNodeDelegateWindows::Init
void Init(std::weak_ptr< OwnerBridge > bridge, ui::AXNode *node) override
Called only once, immediately after construction. The constructor doesn't take any arguments because ...
Definition: flutter_platform_node_delegate_windows.cc:34
flutter_windows_view.h
flutter::FlutterPlatformNodeDelegateWindows::GetPlatformNode
ui::AXPlatformNode * GetPlatformNode() const override
Definition: flutter_platform_node_delegate_windows.cc:113
flutter
Definition: accessibility_bridge_windows.cc:11
flutter_platform_node_delegate.h
flutter::FlutterPlatformNodeDelegateWindows::~FlutterPlatformNodeDelegateWindows
virtual ~FlutterPlatformNodeDelegateWindows()
Definition: flutter_platform_node_delegate_windows.cc:27
flutter::FlutterPlatformNodeDelegate
Definition: flutter_platform_node_delegate.h:33
flutter::FlutterPlatformNodeDelegateWindows::SetFocus
void SetFocus()
Definition: flutter_platform_node_delegate_windows.cc:101
event_type
ax::mojom::Event event_type
Definition: accessibility_bridge_windows_unittests.cc:34