• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "flutter/shell/platform/darwin/common/framework/Headers/FlutterChannels.h"
11 #include "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 #endif  // SHELL_PLATFORM_IOS_FRAMEWORK_SOURCE_FLUTTERTEXTINPUTPLUGIN_H_
48