| 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/FlutterKeyboardViewDelegate.h"
14 #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterTextInputPlugin.h"
15 #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterView.h"
16
17 @interface FlutterViewController () <FlutterKeyboardViewDelegate>
18
19 // The FlutterView for this view controller.
20 @property(nonatomic, readonly, nullable) FlutterView* flutterView;
21
22 /**
23 * The text input plugin that handles text editing state for text fields.
24 */
25 @property(nonatomic, readonly, nonnull) FlutterTextInputPlugin* textInputPlugin;
26
27 @property(nonatomic, readonly) std::weak_ptr<flutter::AccessibilityBridgeMac> accessibilityBridge;
28
29 /**
30 * Returns YES if provided event is being currently redispatched by keyboard manager.
31 */
32 - (BOOL)isDispatchingKeyEvent:(nonnull NSEvent*)event;
33
34 /**
35 * Set up the controller with `engine` and `id`, and other engine-level classes.
36 *
37 * This method is called by FlutterEngine. A view controller must be set up
38 * before being used, and must be set up only once until detachFromEngine:.
39 */
40 - (void)setUpWithEngine:(nonnull FlutterEngine*)engine
41 viewIdentifier:(FlutterViewIdentifier)viewIdentifier
42 threadSynchronizer:(nonnull FlutterThreadSynchronizer*)threadSynchronizer;
43
44 /**
45 * Reset the `engine` and `id` of this controller.
46 *
47 * This method is called by FlutterEngine.
48 */
49 - (void)detachFromEngine;
50
51 /**
52 * Called by the associated FlutterEngine when FlutterEngine#semanticsEnabled
53 * has changed.
54 */
55 - (void)notifySemanticsEnabledChanged;
56
57 /**
58 * Notify from the framework that the semantics for this view needs to be
59 * updated.
60 */
61 - (void)updateSemantics:(nonnull const FlutterSemanticsUpdate2*)update;
62
63 @end
64
65 // Private methods made visible for testing
66 @interface FlutterViewController (TestMethods)
67 - (void)onAccessibilityStatusChanged:(BOOL)enabled;
68
69 /* Creates an accessibility bridge with the provided parameters.
70 *
71 * By default this method calls AccessibilityBridgeMac's initializer. Exposing
72 * this method allows unit tests to override.
73 */
74 - (std::shared_ptr<flutter::AccessibilityBridgeMac>)createAccessibilityBridgeWithEngine:
75 (nonnull FlutterEngine*)engine;
76
77 - (nonnull FlutterView*)createFlutterViewWithMTLDevice:(nonnull id<MTLDevice>)device
78 commandQueue:(nonnull id<MTLCommandQueue>)commandQueue;
79
80 @end
81
82 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERVIEWCONTROLLER_INTERNAL_H_
FlutterEngine
Definition: FlutterEngine.h:30
FlutterKeyboardViewDelegate-p
Definition: FlutterKeyboardViewDelegate.h:42
FlutterViewController
Definition: FlutterViewController.h:73
FlutterKeyboardViewDelegate.h
FlutterTextInputPlugin.h
AccessibilityBridgeMac.h
FlutterViewController(TestMethods)
Definition: FlutterViewController_Internal.h:66
FlutterThreadSynchronizer
Definition: FlutterThreadSynchronizer.h:18
FlutterTextInputPlugin
Definition: FlutterTextInputPlugin.h:27
FlutterView
Definition: FlutterView.h:35
FlutterView.h
FlutterViewIdentifier
int64_t FlutterViewIdentifier
Definition: FlutterViewController.h:21
FlutterViewController.h