| Flutter macOS Embedder |

FlutterViewController_Internal.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_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_
7
8 #import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterViewController.h"
9
10 #include <memory>
11
12 #import "flutter/shell/platform/darwin/macos/framework/Source/AccessibilityBridgeMac.h"
13 #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.h"
14 #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterView.h"
15
16 @interface FlutterViewController ()
17
18 // The FlutterView for this view controller.
19 @property(nonatomic, readonly, nullable) FlutterView* flutterView;
20
21 @property(nonatomic, readonly) std::weak_ptr<flutter::AccessibilityBridgeMac> accessibilityBridge;
22
23 @property(nonatomic, nullable) NSString* applicationLocale;
24
25 /**
26 * Returns YES if provided event is being currently redispatched by keyboard manager.
27 */
28 - (BOOL)isDispatchingKeyEvent:(nonnull NSEvent*)event;
29
30 /**
31 * Set up the controller with `engine` and `id`, and other engine-level classes.
32 *
33 * This method is called by FlutterEngine. A view controller must be set up
34 * before being used, and must be set up only once until detachFromEngine:.
35 */
36 - (void)setUpWithEngine:(nonnull FlutterEngine*)engine
37 viewIdentifier:(FlutterViewIdentifier)viewIdentifier;
38
39 /**
40 * Reset the `engine` and `id` of this controller.
41 *
42 * This method is called by FlutterEngine.
43 */
44 - (void)detachFromEngine;
45
46 /**
47 * Called by the associated FlutterEngine when FlutterEngine#semanticsEnabled
48 * has changed.
49 */
50 - (void)notifySemanticsEnabledChanged;
51
52 /**
53 * Notify from the framework that the semantics for this view needs to be
54 * updated.
55 */
56 - (void)updateSemantics:(nonnull const FlutterSemanticsUpdate2*)update;
57
58 /**
59 * Updates the wide gamut surface format based on the current screen's
60 * display gamut. Should be called when the window moves to a different screen.
61 */
62 - (void)updateWideGamutForScreen;
63
64 /**
65 * Removes this controller from the engine. The controller is removed from the engine
66 * on dealloc, however in multi-window scenario the controller needs to be unregistered
67 * from the engine eagerly - because the FlutterView needs to be removed from the
68 * Flutter isolate before destroying the controller and window.
69 */
70 - (void)dispose;
71
72 @end
73
74 // Private methods made visible for testing
75 @interface FlutterViewController (TestMethods)
76 - (void)onAccessibilityStatusChanged:(BOOL)enabled;
77
78 /* Creates an accessibility bridge with the provided parameters.
79 *
80 * By default this method calls AccessibilityBridgeMac's initializer. Exposing
81 * this method allows unit tests to override.
82 */
83 - (std::shared_ptr<flutter::AccessibilityBridgeMac>)createAccessibilityBridgeWithEngine:
84 (nonnull FlutterEngine*)engine;
85
86 - (nonnull FlutterView*)createFlutterViewWithMTLDevice:(nonnull id<MTLDevice>)device
87 commandQueue:(nonnull id<MTLCommandQueue>)commandQueue;
88
89 @end
90
91 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_
AccessibilityBridgeMac.h
FlutterTextInputPlugin.h
FlutterView.h
FlutterViewController.h
FlutterViewIdentifier
int64_t FlutterViewIdentifier
Definition: FlutterViewController.h:21
FlutterViewController(TestMethods)
Definition: FlutterViewController_Internal.h:75
FlutterEngine
Definition: FlutterEngine.h:32
FlutterViewController
Definition: FlutterViewController.h:73
FlutterView
Definition: FlutterView.h:69