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_LIB_UI_SEMANTICS_SEMANTICS_UPDATE_H_
6#define FLUTTER_LIB_UI_SEMANTICS_SEMANTICS_UPDATE_H_
7
8#include "flutter/lib/ui/dart_wrapper.h"
9#include "flutter/lib/ui/semantics/custom_accessibility_action.h"
10#include "flutter/lib/ui/semantics/semantics_node.h"
11
12namespace tonic {
13class DartLibraryNatives;
14} // namespace tonic
15
16namespace flutter {
17
18class SemanticsUpdate : public RefCountedDartWrappable<SemanticsUpdate> {
19 DEFINE_WRAPPERTYPEINFO();
20 FML_FRIEND_MAKE_REF_COUNTED(SemanticsUpdate);
21
22 public:
23 ~SemanticsUpdate() override;
24 static void create(Dart_Handle semantics_update_handle,
25 SemanticsNodeUpdates nodes,
26 CustomAccessibilityActionUpdates actions);
27
28 SemanticsNodeUpdates takeNodes();
29
30 CustomAccessibilityActionUpdates takeActions();
31
32 void dispose();
33
34 static void RegisterNatives(tonic::DartLibraryNatives* natives);
35
36 private:
37 explicit SemanticsUpdate(SemanticsNodeUpdates nodes,
38 CustomAccessibilityActionUpdates updates);
39
40 SemanticsNodeUpdates nodes_;
41 CustomAccessibilityActionUpdates actions_;
42};
43
44} // namespace flutter
45
46#endif // FLUTTER_LIB_UI_SEMANTICS_SEMANTICS_UPDATE_H_
47