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 #ifndef SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERTEXTINPUTPLUGIN_H_
6 #define SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERTEXTINPUTPLUGIN_H_
7 
8 #import <UIKit/UIKit.h>
9 
10 #import "flutter/shell/platform/darwin/common/framework/Headers/FlutterChannels.h"
11 #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h"
12 
13 @interface FlutterTextInputPlugin : NSObject
14 
15 @property(nonatomic, assign) id<FlutterTextInputDelegate> textInputDelegate;
16 - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result;
17 
18 /**
19  * The `UITextInput` implementation used to control text entry.
20  *
21  * This is used by `AccessibilityBridge` to forward interactions with iOS'
22  * accessibility system.
23  */
24 - (UIView<UITextInput>*)textInputView;
25 
26 @end
27 
28 /** An indexed position in the buffer of a Flutter text editing widget. */
29 @interface FlutterTextPosition : UITextPosition
30 
31 @property(nonatomic, readonly) NSUInteger index;
32 
33 + (instancetype)positionWithIndex:(NSUInteger)index;
34 - (instancetype)initWithIndex:(NSUInteger)index;
35 
36 @end
37 
38 /** A range of text in the buffer of a Flutter text editing widget. */
39 @interface FlutterTextRange : UITextRange <NSCopying>
40 
41 @property(nonatomic, readonly) NSRange range;
42 
43 + (instancetype)rangeWithNSRange:(NSRange)range;
44 
45 @end
46 
47 #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG
49 #endif
50 @interface FlutterTextInputView : UIView <UITextInput>
51 
52 // UITextInput
53 @property(nonatomic, readonly) NSMutableString* text;
54 @property(nonatomic, readonly) NSMutableString* markedText;
55 @property(readwrite, copy) UITextRange* selectedTextRange;
56 @property(nonatomic, strong) UITextRange* markedTextRange;
57 @property(nonatomic, copy) NSDictionary* markedTextStyle;
58 @property(nonatomic, assign) id<UITextInputDelegate> inputDelegate;
59 
60 // UITextInputTraits
61 @property(nonatomic) UITextAutocapitalizationType autocapitalizationType;
62 @property(nonatomic) UITextAutocorrectionType autocorrectionType;
63 @property(nonatomic) UITextSpellCheckingType spellCheckingType;
64 @property(nonatomic) BOOL enablesReturnKeyAutomatically;
65 @property(nonatomic) UIKeyboardAppearance keyboardAppearance;
66 @property(nonatomic) UIKeyboardType keyboardType;
67 @property(nonatomic) UIReturnKeyType returnKeyType;
68 @property(nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry;
69 @property(nonatomic) UITextSmartQuotesType smartQuotesType API_AVAILABLE(ios(11.0));
70 @property(nonatomic) UITextSmartDashesType smartDashesType API_AVAILABLE(ios(11.0));
71 @property(nonatomic, copy) UITextContentType textContentType API_AVAILABLE(ios(10.0));
72 
73 @property(nonatomic, assign) id<FlutterTextInputDelegate> textInputDelegate;
74 
75 @end
76 #endif // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERTEXTINPUTPLUGIN_H_
id< FlutterTextInputDelegate > textInputDelegate
UIView< UITextInput > * textInputView()
void(^ FlutterResult)(id _Nullable result)
#define FLUTTER_EXPORT