5#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_ACCESSIBILITY_BRIDGE_H_
6#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_ACCESSIBILITY_BRIDGE_H_
11#include <unordered_map>
12#include <unordered_set>
15#include "flutter/fml/macros.h"
16#include "flutter/fml/memory/weak_ptr.h"
17#include "flutter/fml/platform/darwin/scoped_nsobject.h"
18#include "flutter/lib/ui/semantics/custom_accessibility_action.h"
19#include "flutter/lib/ui/semantics/semantics_node.h"
20#import "flutter/shell/platform/darwin/common/framework/Headers/FlutterChannels.h"
21#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h"
22#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h"
23#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h"
24#import "flutter/shell/platform/darwin/ios/framework/Source/SemanticsObject.h"
25#import "flutter/shell/platform/darwin/ios/framework/Source/accessibility_bridge_ios.h"
38class AccessibilityBridge final :
public AccessibilityBridgeIos {
54 std::shared_ptr<FlutterPlatformViewsController> platform_views_controller,
55 std::unique_ptr<IosDelegate> ios_delegate =
nullptr);
60 void HandleEvent(NSDictionary<NSString*, id>* annotatedEvent);
70 UIView*
view()
const override {
return view_controller_.
view; }
77 return platform_views_controller_;
91 NSMutableArray<NSNumber*>* doomed_uids);
95 const std::shared_ptr<FlutterPlatformViewsController> platform_views_controller_;
99 int32_t last_focused_semantics_object_id_;
102 int32_t previous_route_id_ = 0;
103 std::unordered_map<int32_t, flutter::CustomAccessibilityAction> actions_;
104 std::vector<int32_t> previous_routes_;
105 std::unique_ptr<IosDelegate> ios_delegate_;
virtual void PostAccessibilityNotification(UIAccessibilityNotifications notification, id argument)=0
virtual bool IsFlutterViewControllerPresentingModalViewController(FlutterViewController *view_controller)=0
virtual ~IosDelegate()=default
AccessibilityBridge(FlutterViewController *view_controller, PlatformViewIOS *platform_view, std::shared_ptr< FlutterPlatformViewsController > platform_views_controller, std::unique_ptr< IosDelegate > ios_delegate=nullptr)
void UpdateSemantics(flutter::SemanticsNodeUpdates nodes, const flutter::CustomAccessibilityActionUpdates &actions)
UIView * view() const override
void DispatchSemanticsAction(int32_t id, flutter::SemanticsAction action) override
std::shared_ptr< FlutterPlatformViewsController > GetPlatformViewsController() const override
UIView< UITextInput > * textInputView() override
void AccessibilityObjectDidLoseFocus(int32_t id) override
void DispatchSemanticsAction(int32_t id, flutter::SemanticsAction action, fml::MallocMapping args) override
bool isVoiceOverRunning() const override
void HandleEvent(NSDictionary< NSString *, id > *annotatedEvent)
fml::WeakPtr< AccessibilityBridge > GetWeakPtr()
void AccessibilityObjectDidBecomeFocused(int32_t id) override
FlutterView * view() const
A Mapping like NonOwnedMapping, but uses Free as its release proc.
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
std::unordered_map< int32_t, SemanticsNode > SemanticsNodeUpdates
std::unordered_map< int32_t, CustomAccessibilityAction > CustomAccessibilityActionUpdates