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