public interface UITextInput extends UIKeyInput
| Modifier and Type | Method and Description |
|---|---|
long |
baseWritingDirectionForPositionInDirection(UITextPosition position,
long direction)
Writing direction
|
default void |
beginFloatingCursorAtPoint(CGPoint point)
The following three optional methods are for clients that wish to display a floating cursor to
guide user manipulation of the selected text range via the system-provided keyboard.
|
UITextPosition |
beginningOfDocument()
The end and beginning of the the text document.
|
CGRect |
caretRectForPosition(UITextPosition position) |
default long |
characterOffsetOfPositionWithinRange(UITextPosition position,
UITextRange range) |
UITextRange |
characterRangeAtPoint(CGPoint point) |
UITextRange |
characterRangeByExtendingPositionInDirection(UITextPosition position,
long direction) |
UITextPosition |
closestPositionToPoint(CGPoint point)
Hit testing.
|
UITextPosition |
closestPositionToPointWithinRange(CGPoint point,
UITextRange range) |
long |
comparePositionToPosition(UITextPosition position,
UITextPosition other)
Simple evaluation of positions
|
default void |
dictationRecognitionFailed() |
default void |
dictationRecordingDidEnd()
These are optional methods for clients that wish to know when there are pending dictation results.
|
default void |
endFloatingCursor() |
UITextPosition |
endOfDocument() |
CGRect |
firstRectForRange(UITextRange range)
Geometry used to provide, for example, a correction rect.
|
default CGRect |
frameForDictationResultPlaceholder(java.lang.Object placeholder) |
UITextInputDelegate |
inputDelegate()
A system-provided input delegate is assigned when the system is interested in input changes.
|
default void |
insertDictationResult(NSArray<? extends UIDictationPhrase> dictationResult)
This is an optional method for clients that wish to support dictation phrase alternatives.
|
default java.lang.Object |
insertDictationResultPlaceholder()
The following three optional methods are for clients that wish to support a placeholder for
pending dictation results.
|
default void |
insertTextAlternativesStyle(java.lang.String text,
NSArray<java.lang.String> alternatives,
long style)
This is an optional method for clients that wish to support text phrase alternatives.
|
default UITextPlaceholder |
insertTextPlaceholderWithSize(CGSize size)
Insert a placeholder
If `size.height` is <= 0, then the placeholder is inline and line height.
|
UITextRange |
markedTextRange()
Nil if no marked text.
|
NSDictionary<java.lang.String,?> |
markedTextStyle()
Describes how the marked text should be drawn.
|
long |
offsetFromPositionToPosition(UITextPosition from,
UITextPosition toPosition) |
UITextPosition |
positionFromPositionInDirectionOffset(UITextPosition position,
long direction,
long offset) |
UITextPosition |
positionFromPositionOffset(UITextPosition position,
long offset) |
default UITextPosition |
positionWithinRangeAtCharacterOffset(UITextRange range,
long offset)
To be implemented if there is not a one-to-one correspondence between text positions within range and character offsets into the associated string.
|
UITextPosition |
positionWithinRangeFarthestInDirection(UITextRange range,
long direction)
Layout questions.
|
default void |
removeDictationResultPlaceholderWillInsertResult(java.lang.Object placeholder,
boolean willInsertResult)
willInsertResult will be NO if the recognition failed.
|
default void |
removeTextPlaceholder(UITextPlaceholder textPlaceholder)
Remove the placeholder.
|
void |
replaceRangeWithText(UITextRange range,
java.lang.String text) |
UITextRange |
selectedTextRange()
Text may have a selection, either zero-length (a caret) or ranged.
|
default long |
selectionAffinity()
Selection affinity determines whether, for example, the insertion point appears after the last
character on a line or before the first character on the following line in cases where text
wraps across line boundaries.
|
NSArray<? extends UITextSelectionRect> |
selectionRectsForRange(UITextRange range)
Returns an array of UITextSelectionRects
|
default void |
setAttributedMarkedTextSelectedRange(NSAttributedString markedText,
NSRange selectedRange)
set attributedString as markedText, selectedRange is a range within the markedText
|
void |
setBaseWritingDirectionForRange(long writingDirection,
UITextRange range) |
void |
setInputDelegate_unsafe(UITextInputDelegate value)
A system-provided input delegate is assigned when the system is interested in input changes.
|
void |
setMarkedTextSelectedRange(java.lang.String markedText,
NSRange selectedRange)
selectedRange is a range within the markedText
|
void |
setMarkedTextStyle(NSDictionary<java.lang.String,?> value)
Describes how the marked text should be drawn.
|
void |
setSelectedTextRange(UITextRange value)
Text may have a selection, either zero-length (a caret) or ranged.
|
default void |
setSelectionAffinity(long value)
Selection affinity determines whether, for example, the insertion point appears after the last
character on a line or before the first character on the following line in cases where text
wraps across line boundaries.
|
default boolean |
shouldChangeTextInRangeReplacementText(UITextRange range,
java.lang.String text)
return NO to not change text
|
default UIView |
textInputView()
An affiliated view that provides a coordinate system for all geometric values in this protocol.
|
java.lang.String |
textInRange(UITextRange range)
Methods for manipulating text.
|
UITextRange |
textRangeFromPositionToPosition(UITextPosition fromPosition,
UITextPosition toPosition)
Methods for creating ranges and positions.
|
default NSDictionary<java.lang.String,?> |
textStylingAtPositionInDirection(UITextPosition position,
long direction)
Text styling information can affect, for example, the appearance of a correction rect.
|
UITextInputTokenizer |
tokenizer()
A tokenizer must be provided to inform the text input system about text units of varying granularity.
|
void |
unmarkText() |
default void |
updateFloatingCursorAtPoint(CGPoint point) |
deleteBackward, hasText, insertTextautocapitalizationType, autocorrectionType, enablesReturnKeyAutomatically, isSecureTextEntry, keyboardAppearance, keyboardType, passwordRules, returnKeyType, setAutocapitalizationType, setAutocorrectionType, setEnablesReturnKeyAutomatically, setKeyboardAppearance, setKeyboardType, setPasswordRules, setReturnKeyType, setSecureTextEntry, setSmartDashesType, setSmartInsertDeleteType, setSmartQuotesType, setSpellCheckingType, setTextContentType, smartDashesType, smartInsertDeleteType, smartQuotesType, spellCheckingType, textContentTypelong baseWritingDirectionForPositionInDirection(UITextPosition position, long direction)
default void beginFloatingCursorAtPoint(CGPoint point)
UITextPosition beginningOfDocument()
CGRect caretRectForPosition(UITextPosition position)
default long characterOffsetOfPositionWithinRange(UITextPosition position, UITextRange range)
UITextRange characterRangeAtPoint(CGPoint point)
UITextRange characterRangeByExtendingPositionInDirection(UITextPosition position, long direction)
UITextPosition closestPositionToPoint(CGPoint point)
UITextPosition closestPositionToPointWithinRange(CGPoint point, UITextRange range)
long comparePositionToPosition(UITextPosition position, UITextPosition other)
default void dictationRecognitionFailed()
default void dictationRecordingDidEnd()
default void endFloatingCursor()
UITextPosition endOfDocument()
CGRect firstRectForRange(UITextRange range)
default CGRect frameForDictationResultPlaceholder(java.lang.Object placeholder)
UITextInputDelegate inputDelegate()
default void insertDictationResult(NSArray<? extends UIDictationPhrase> dictationResult)
default java.lang.Object insertDictationResultPlaceholder()
UITextRange markedTextRange()
NSDictionary<java.lang.String,?> markedTextStyle()
long offsetFromPositionToPosition(UITextPosition from, UITextPosition toPosition)
UITextPosition positionFromPositionInDirectionOffset(UITextPosition position, long direction, long offset)
UITextPosition positionFromPositionOffset(UITextPosition position, long offset)
default UITextPosition positionWithinRangeAtCharacterOffset(UITextRange range, long offset)
UITextPosition positionWithinRangeFarthestInDirection(UITextRange range, long direction)
default void removeDictationResultPlaceholderWillInsertResult(java.lang.Object placeholder,
boolean willInsertResult)
void replaceRangeWithText(UITextRange range, java.lang.String text)
UITextRange selectedTextRange()
default long selectionAffinity()
NSArray<? extends UITextSelectionRect> selectionRectsForRange(UITextRange range)
void setBaseWritingDirectionForRange(long writingDirection,
UITextRange range)
void setInputDelegate_unsafe(UITextInputDelegate value)
void setMarkedTextSelectedRange(java.lang.String markedText,
NSRange selectedRange)
void setMarkedTextStyle(NSDictionary<java.lang.String,?> value)
void setSelectedTextRange(UITextRange value)
default void setSelectionAffinity(long value)
default boolean shouldChangeTextInRangeReplacementText(UITextRange range, java.lang.String text)
java.lang.String textInRange(UITextRange range)
default UIView textInputView()
UITextRange textRangeFromPositionToPosition(UITextPosition fromPosition, UITextPosition toPosition)
default NSDictionary<java.lang.String,?> textStylingAtPositionInDirection(UITextPosition position, long direction)
UITextInputTokenizer tokenizer()
void unmarkText()
default void updateFloatingCursorAtPoint(CGPoint point)
default void insertTextAlternativesStyle(java.lang.String text,
NSArray<java.lang.String> alternatives,
long style)
default UITextPlaceholder insertTextPlaceholderWithSize(CGSize size)
default void removeTextPlaceholder(UITextPlaceholder textPlaceholder)
default void setAttributedMarkedTextSelectedRange(NSAttributedString markedText, NSRange selectedRange)