| 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_RUNTIME_DELEGATE_H_ |
| 6 | #define FLUTTER_RUNTIME_RUNTIME_DELEGATE_H_ |
| 7 | |
| 8 | #include <memory> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include "flutter/assets/asset_manager.h" |
| 12 | #include "flutter/flow/layers/layer_tree.h" |
| 13 | #include "flutter/lib/ui/semantics/custom_accessibility_action.h" |
| 14 | #include "flutter/lib/ui/semantics/semantics_node.h" |
| 15 | #include "flutter/lib/ui/text/font_collection.h" |
| 16 | #include "flutter/lib/ui/window/platform_message.h" |
| 17 | #include "flutter/shell/common/platform_message_handler.h" |
| 18 | #include "third_party/dart/runtime/include/dart_api.h" |
| 19 | |
| 20 | namespace flutter { |
| 21 | |
| 22 | class RuntimeDelegate { |
| 23 | public: |
| 24 | virtual bool ImplicitViewEnabled() = 0; |
| 25 | |
| 26 | virtual std::string DefaultRouteName() = 0; |
| 27 | |
| 28 | virtual void ScheduleFrame(bool regenerate_layer_tree = true) = 0; |
| 29 | |
| 30 | virtual void Render(std::unique_ptr<flutter::LayerTree> layer_tree, |
| 31 | float device_pixel_ratio) = 0; |
| 32 | |
| 33 | virtual void UpdateSemantics(SemanticsNodeUpdates update, |
| 34 | CustomAccessibilityActionUpdates actions) = 0; |
| 35 | |
| 36 | virtual void HandlePlatformMessage( |
| 37 | std::unique_ptr<PlatformMessage> message) = 0; |
| 38 | |
| 39 | virtual FontCollection& GetFontCollection() = 0; |
| 40 | |
| 41 | virtual std::shared_ptr<AssetManager> GetAssetManager() = 0; |
| 42 | |
| 43 | virtual void OnRootIsolateCreated() = 0; |
| 44 | |
| 45 | virtual void UpdateIsolateDescription(const std::string isolate_name, |
| 46 | int64_t isolate_port) = 0; |
| 47 | |
| 48 | virtual void SetNeedsReportTimings(bool value) = 0; |
| 49 | |
| 50 | virtual std::unique_ptr<std::vector<std::string>> |
| 51 | ComputePlatformResolvedLocale( |
| 52 | const std::vector<std::string>& supported_locale_data) = 0; |
| 53 | |
| 54 | virtual void RequestDartDeferredLibrary(intptr_t loading_unit_id) = 0; |
| 55 | |
| 56 | virtual std::weak_ptr<PlatformMessageHandler> GetPlatformMessageHandler() |
| 57 | const = 0; |
| 58 | |
| 59 | protected: |
| 60 | virtual ~RuntimeDelegate(); |
| 61 | }; |
| 62 | |
| 63 | } // namespace flutter |
| 64 | |
| 65 | #endif // FLUTTER_RUNTIME_RUNTIME_DELEGATE_H_ |
| 66 |
