Flutter Engine
FlutterTextInputPlugin.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 <Cocoa/Cocoa.h>
6 
7 #import "flutter/shell/platform/darwin/common/framework/Headers/FlutterBinaryMessenger.h"
8 #import "flutter/shell/platform/darwin/macos/framework/Headers/FlutterViewController.h"
9 #import "flutter/shell/platform/darwin/macos/framework/Source/FlutterKeySecondaryResponder.h"
10 
11 @class FlutterTextField;
12 
13 /**
14  * A plugin to handle text input.
15  *
16  * Responsible for bridging the native macOS text input system with the Flutter framework text
17  * editing classes, via system channels.
18  *
19  * This is not an FlutterPlugin since it needs access to FlutterViewController internals, so needs
20  * to be managed differently.
21  *
22  * When accessibility is on, accessibility bridge creates a NSTextField, i.e. FlutterTextField,
23  * for every text field in the Flutter. This plugin acts as a field editor for those NSTextField[s].
24  */
26 
27 /**
28  * The NSTextField that currently has this plugin as its field editor.
29  *
30  * Must be nil if accessibility is off.
31  */
32 @property(nonatomic, weak) FlutterTextField* client;
33 
34 /**
35  * Initializes a text input plugin that coordinates key event handling with |viewController|.
36  */
37 - (instancetype)initWithViewController:(FlutterViewController*)viewController;
38 
39 /**
40  * Whether this plugin is the first responder of this NSWindow.
41  *
42  * When accessibility is on, this plugin is set as the first responder to act as the field
43  * editor for FlutterTextFields.
44  *
45  * Returns false if accessibility is off.
46  */
48 
49 @end
50 
51 // Private methods made visible for testing
53 - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result;
54 - (NSRect)firstRectForCharacterRange:(NSRange)range actualRange:(NSRangePointer)actualRange;
55 @end
UIViewController * viewController
void(^ FlutterResult)(id _Nullable result)
int BOOL
Definition: windows_types.h:37