2017-06-27 23:05:05 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
|
|
|
|
#import <React/RCTView.h>
|
|
|
|
|
2017-07-06 23:55:34 +00:00
|
|
|
#import "RCTBackedTextInputViewProtocol.h"
|
|
|
|
|
2017-06-27 23:05:05 +00:00
|
|
|
@class RCTBridge;
|
|
|
|
@class RCTEventDispatcher;
|
|
|
|
|
|
|
|
@interface RCTTextInput : RCTView {
|
|
|
|
@protected
|
|
|
|
RCTBridge *_bridge;
|
|
|
|
RCTEventDispatcher *_eventDispatcher;
|
2017-07-18 21:33:33 +00:00
|
|
|
UITextRange *_previousSelectionRange;
|
|
|
|
NSInteger _nativeEventCount;
|
|
|
|
NSInteger _mostRecentEventCount;
|
2017-07-18 21:33:35 +00:00
|
|
|
BOOL _blurOnSubmit;
|
2017-06-27 23:05:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER;
|
|
|
|
|
|
|
|
- (instancetype)init NS_UNAVAILABLE;
|
|
|
|
- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE;
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) UIView<RCTBackedTextInputViewProtocol> *backedTextInputView;
|
|
|
|
|
2017-06-27 23:05:08 +00:00
|
|
|
@property (nonatomic, assign) UIEdgeInsets reactPaddingInsets;
|
|
|
|
@property (nonatomic, assign) UIEdgeInsets reactBorderInsets;
|
|
|
|
@property (nonatomic, assign, readonly) CGSize contentSize;
|
|
|
|
|
|
|
|
@property (nonatomic, copy) RCTDirectEventBlock onContentSizeChange;
|
|
|
|
|
2017-07-18 21:33:33 +00:00
|
|
|
@property (nonatomic, assign) NSInteger mostRecentEventCount;
|
2017-07-18 21:33:35 +00:00
|
|
|
@property (nonatomic, assign) BOOL blurOnSubmit;
|
2017-07-18 21:33:37 +00:00
|
|
|
@property (nonatomic, assign) BOOL selectTextOnFocus;
|
2017-07-18 21:33:33 +00:00
|
|
|
|
2017-06-27 23:05:08 +00:00
|
|
|
- (void)invalidateContentSize;
|
|
|
|
|
2017-07-18 21:33:35 +00:00
|
|
|
// Temporary exposure of particial `RCTBackedTextInputDelegate` support.
|
|
|
|
// In the future all methods of the protocol should move to this class.
|
2017-07-18 21:33:37 +00:00
|
|
|
- (BOOL)textInputShouldBeginEditing;
|
2017-07-18 21:33:35 +00:00
|
|
|
- (BOOL)textInputShouldReturn;
|
|
|
|
- (void)textInputDidReturn;
|
|
|
|
|
2017-06-27 23:05:05 +00:00
|
|
|
@end
|