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