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_RUNTIME_PLATFORM_DATA_H_ |
6 | #define FLUTTER_RUNTIME_PLATFORM_DATA_H_ |
7 | |
8 | #include "flutter/lib/ui/window/viewport_metrics.h" |
9 | |
10 | #include <memory> |
11 | #include <string> |
12 | #include <vector> |
13 | |
14 | namespace flutter { |
15 | |
16 | //------------------------------------------------------------------------------ |
17 | /// The struct of platform-specific data used for initializing ui.Window. |
18 | /// |
19 | /// framework may request data from ui.Window before platform is properly |
20 | /// configured. Engine this struct to set the desired default value for |
21 | /// ui.Window when creating Shell before platform is ready to send the real |
22 | /// data. |
23 | /// |
24 | /// See also: |
25 | /// |
26 | /// * flutter::Shell::Create, which takes a platform_data to initialize the |
27 | /// ui.Window attached to it. |
28 | struct PlatformData { |
29 | PlatformData(); |
30 | |
31 | ~PlatformData(); |
32 | |
33 | ViewportMetrics viewport_metrics; |
34 | std::string language_code; |
35 | std::string country_code; |
36 | std::string script_code; |
37 | std::string variant_code; |
38 | std::vector<std::string> locale_data; |
39 | std::string user_settings_data = "{}" ; |
40 | std::string lifecycle_state; |
41 | bool semantics_enabled = false; |
42 | bool assistive_technology_enabled = false; |
43 | int32_t accessibility_feature_flags_ = 0; |
44 | }; |
45 | |
46 | } // namespace flutter |
47 | |
48 | #endif // FLUTTER_RUNTIME_PLATFORM_DATA_H_ |
49 | |