| Flutter Linux Embedder |

fl_view_accessible.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_LINUX_FL_VIEW_ACCESSIBLE_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_FL_VIEW_ACCESSIBLE_H_
7
8 #if !defined(__FLUTTER_LINUX_INSIDE__) && !defined(FLUTTER_LINUX_COMPILATION)
9 #error "Only <flutter_linux/flutter_linux.h> can be included directly."
10 #endif
11
12 #include <atk/atk.h>
13
14 #include "flutter/shell/platform/embedder/embedder.h"
15 #include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h"
16
17 G_BEGIN_DECLS
18
19 // ATK g_autoptr macros weren't added until 2.37. Add them manually.
20 // https://gitlab.gnome.org/GNOME/atk/-/issues/10
21 #if !ATK_CHECK_VERSION(2, 37, 0)
22 G_DEFINE_AUTOPTR_CLEANUP_FUNC(AtkPlug, g_object_unref)
23 #endif
24
25 G_DECLARE_FINAL_TYPE(FlViewAccessible,
26 fl_view_accessible,
27 FL,
28 VIEW_ACCESSIBLE,
29 AtkPlug)
30
31 /**
32 * FlViewAccessible:
33 *
34 * #FlViewAccessible is an object that exposes accessibility information for an
35 * #FlView.
36 */
37
38 /**
39 * fl_view_accessible_new:
40 * @engine: the #FlEngine.
41 * @view_id: the Flutter view id.
42 *
43 * Creates a new accessibility object that exposes Flutter accessibility
44 * information to ATK.
45 *
46 * Returns: a new #FlViewAccessible.
47 */
48 FlViewAccessible* fl_view_accessible_new(FlEngine* engine,
49 FlutterViewId view_id);
50
51 /**
52 * fl_view_accessible_handle_update_semantics:
53 * @accessible: an #FlViewAccessible.
54 * @update: semantic update information.
55 *
56 * Handle a semantics update from Flutter.
57 */
58 void fl_view_accessible_handle_update_semantics(
59 FlViewAccessible* accessible,
60 const FlutterSemanticsUpdate2* update);
61
62 /**
63 * fl_view_accessible_send_announcement:
64 * @accessible: an #FlViewAccessible.
65 * @message: text to be announced.
66 * @assertive: %TRUE if the message should be in an assertive voice.
67 *
68 * Sends an annoucement to a screen reader.
69 */
70 void fl_view_accessible_send_announcement(FlViewAccessible* accessible,
71 const char* message,
72 gboolean assertive);
73
74 G_END_DECLS
75
76 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_VIEW_ACCESSIBLE_H_
accessible
FlViewAccessible * accessible
Definition: fl_accessibility_handler.cc:41
message
const char * message
Definition: fl_accessibility_handler.cc:21
FL
FL
Definition: fl_binary_messenger.cc:27
fl_engine.h
fl_view_accessible_new
FlViewAccessible * fl_view_accessible_new(FlEngine *engine, FlutterViewId view_id)
Definition: fl_view_accessible.cc:148
fl_view_accessible_send_announcement
void fl_view_accessible_send_announcement(FlViewAccessible *accessible, const char *message, gboolean assertive)
Definition: fl_view_accessible.cc:214
fl_view_accessible_handle_update_semantics
void fl_view_accessible_handle_update_semantics(FlViewAccessible *accessible, const FlutterSemanticsUpdate2 *update)
Definition: fl_view_accessible.cc:157
view_id
G_BEGIN_DECLS FlutterViewId view_id
Definition: fl_view_accessible.h:49
G_DECLARE_FINAL_TYPE
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlViewAccessible, fl_view_accessible, FL, VIEW_ACCESSIBLE, AtkPlug) FlViewAccessible *fl_view_accessible_new(FlEngine *engine