| 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 88 of file accessibility_plugin.cc.

89 : engine_(engine) {}

## Member Function Documentation

## ◆ Announce()

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

Definition at line 107 of file accessibility_plugin.cc.

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

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

Referenced by flutter::testing::TEST_F().

## ◆ SetUp()

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

Definition at line 91 of file accessibility_plugin.cc.

92 {
93 BasicMessageChannel<> channel{binary_messenger, kAccessibilityChannelName,
94 &StandardMessageCodec::GetInstance()};
95
96 channel.SetMessageHandler(
97 [plugin](const EncodableValue& message,
98 const MessageReply<EncodableValue>& reply) {
99 HandleMessage(plugin, message);
100
101 // The accessibility channel does not support error handling.
102 // Always return an empty response even on failure.
103 reply(EncodableValue{std::monostate{}});
104 });
105 }
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.

Referenced by flutter::testing::AccessibilityPluginTest::SetUp().

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

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