| Flutter Windows Embedder |

Public Member Functions | Static Public Member Functions | List of all members
flutter::AccessibilityPlugin Class Reference

`#include <accessibility_plugin.h>`

## Public Member Functions
| AccessibilityPlugin (FlutterWindowsEngine *engine)
virtual void | Announce (const FlutterViewId view_id, const std::string_view message)

## Static Public Member Functions
static void | SetUp (BinaryMessenger *binary_messenger, AccessibilityPlugin *plugin)

## Detailed Description

Definition at line 22 of file accessibility_plugin.h.

## Constructor & Destructor Documentation

## ◆ AccessibilityPlugin()

flutter::AccessibilityPlugin::AccessibilityPlugin | ( | FlutterWindowsEngine * | engine | ) |
| explicit

Definition at line 87 of file accessibility_plugin.cc.

88 : engine_(engine) {}

## Member Function Documentation

## ◆ Announce()

void flutter::AccessibilityPlugin::Announce | ( | const FlutterViewId | view_id,
|  | const std::string_view | message
| ) |  |
| virtual

Definition at line 106 of file accessibility_plugin.cc.

107 {
108 if (!engine_->semantics_enabled()) {
109 return;
110 }
111
112 auto view = engine_->view(view_id);
113 if (!view) {
114 return;
115 }
116
117 std::wstring wide_text = fml::Utf8ToWideString(message);
118 view->AnnounceAlert(wide_text);
119 }
flutter::FlutterWindowsEngine::view
FlutterWindowsView * view(FlutterViewId view_id) const
Definition: flutter_windows_engine.cc:688
flutter::FlutterWindowsEngine::semantics_enabled
bool semantics_enabled() const
Definition: flutter_windows_engine.h:258
message
Win32Message message
Definition: keyboard_unittests.cc:137

References message, flutter::FlutterWindowsEngine::semantics_enabled(), and flutter::FlutterWindowsEngine::view().

## ◆ SetUp()

void flutter::AccessibilityPlugin::SetUp | ( | BinaryMessenger * | binary_messenger,
|  | AccessibilityPlugin * | plugin
| ) |  |
| static

Definition at line 90 of file accessibility_plugin.cc.

91 {
92 BasicMessageChannel<> channel{binary_messenger, kAccessibilityChannelName,
93 &StandardMessageCodec::GetInstance()};
94
95 channel.SetMessageHandler(
96 [plugin](const EncodableValue& message,
97 const MessageReply<EncodableValue>& reply) {
98 HandleMessage(plugin, message);
99
100 // The accessibility channel does not support error handling.
101 // Always return an empty response even on failure.
102 reply(EncodableValue{std::monostate{}});
103 });
104 }
flutter::StandardMessageCodec::GetInstance
static const StandardMessageCodec & GetInstance(const StandardCodecSerializer *serializer=nullptr)
Definition: standard_codec.cc:293
kAccessibilityChannelName
static constexpr char kAccessibilityChannelName[]
Definition: flutter_windows_engine.cc:36

References flutter::StandardMessageCodec::GetInstance(), kAccessibilityChannelName, and message.

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

- shell/platform/windows/accessibility_plugin.h
- shell/platform/windows/accessibility_plugin.cc