Package apple.uikit.protocol
Interface UITextInput
-
- All Superinterfaces:
UIKeyInput,UITextInputTraits
- All Known Subinterfaces:
UITextDraggable,UITextDroppable
- All Known Implementing Classes:
UISearchTextField,UITextField,UITextView
public interface UITextInput extends UIKeyInput
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description longbaseWritingDirectionForPositionInDirection(UITextPosition position, long direction)Writing directiondefault voidbeginFloatingCursorAtPoint(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.UITextPositionbeginningOfDocument()The end and beginning of the the text document.CGRectcaretRectForPosition(UITextPosition position)default longcharacterOffsetOfPositionWithinRange(UITextPosition position, UITextRange range)UITextRangecharacterRangeAtPoint(CGPoint point)UITextRangecharacterRangeByExtendingPositionInDirection(UITextPosition position, long direction)UITextPositionclosestPositionToPoint(CGPoint point)Hit testing.UITextPositionclosestPositionToPointWithinRange(CGPoint point, UITextRange range)longcomparePositionToPosition(UITextPosition position, UITextPosition other)Simple evaluation of positionsdefault voiddictationRecognitionFailed()default voiddictationRecordingDidEnd()These are optional methods for clients that wish to know when there are pending dictation results.default voidendFloatingCursor()UITextPositionendOfDocument()CGRectfirstRectForRange(UITextRange range)Geometry used to provide, for example, a correction rect.default CGRectframeForDictationResultPlaceholder(java.lang.Object placeholder)UITextInputDelegateinputDelegate()A system-provied input delegate is assigned when the system is interested in input changes.default voidinsertDictationResult(NSArray<? extends UIDictationPhrase> dictationResult)This is an optional method for clients that wish to support dictation phrase alternatives.default java.lang.ObjectinsertDictationResultPlaceholder()The following three optional methods are for clients that wish to support a placeholder for pending dictation results.default voidinsertTextAlternativesStyle(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 UITextPlaceholderinsertTextPlaceholderWithSize(CGSize size)Insert a placeholder If `size.height` is <= 0, then the placeholder is inline and line height.UITextRangemarkedTextRange()Nil if no marked text.NSDictionary<java.lang.String,?>markedTextStyle()Describes how the marked text should be drawn.longoffsetFromPositionToPosition(UITextPosition from, UITextPosition toPosition)UITextPositionpositionFromPositionInDirectionOffset(UITextPosition position, long direction, long offset)UITextPositionpositionFromPositionOffset(UITextPosition position, long offset)default UITextPositionpositionWithinRangeAtCharacterOffset(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.UITextPositionpositionWithinRangeFarthestInDirection(UITextRange range, long direction)Layout questions.default voidremoveDictationResultPlaceholderWillInsertResult(java.lang.Object placeholder, boolean willInsertResult)willInsertResult will be NO if the recognition failed.default voidremoveTextPlaceholder(UITextPlaceholder textPlaceholder)Remove the placeholder.voidreplaceRangeWithText(UITextRange range, java.lang.String text)UITextRangeselectedTextRange()Text may have a selection, either zero-length (a caret) or ranged.default longselectionAffinity()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 UITextSelectionRectsdefault voidsetAttributedMarkedTextSelectedRange(NSAttributedString markedText, NSRange selectedRange)set attributedString as markedText, selectedRange is a range within the markedTextvoidsetBaseWritingDirectionForRange(long writingDirection, UITextRange range)voidsetInputDelegate(UITextInputDelegate value)A system-provied input delegate is assigned when the system is interested in input changes.voidsetMarkedTextSelectedRange(java.lang.String markedText, NSRange selectedRange)selectedRange is a range within the markedTextvoidsetMarkedTextStyle(NSDictionary<java.lang.String,?> value)Describes how the marked text should be drawn.voidsetSelectedTextRange(UITextRange value)Text may have a selection, either zero-length (a caret) or ranged.default voidsetSelectionAffinity(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 booleanshouldChangeTextInRangeReplacementText(UITextRange range, java.lang.String text)return NO to not change textdefault UIViewtextInputView()An affiliated view that provides a coordinate system for all geometric values in this protocol.java.lang.StringtextInRange(UITextRange range)Methods for manipulating text.UITextRangetextRangeFromPositionToPosition(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.UITextInputTokenizertokenizer()A tokenizer must be provided to inform the text input system about text units of varying granularity.voidunmarkText()default voidupdateFloatingCursorAtPoint(CGPoint point)-
Methods inherited from interface apple.uikit.protocol.UIKeyInput
deleteBackward, hasText, insertText
-
Methods inherited from interface apple.uikit.protocol.UITextInputTraits
autocapitalizationType, autocorrectionType, enablesReturnKeyAutomatically, isSecureTextEntry, keyboardAppearance, keyboardType, passwordRules, returnKeyType, setAutocapitalizationType, setAutocorrectionType, setEnablesReturnKeyAutomatically, setKeyboardAppearance, setKeyboardType, setPasswordRules, setReturnKeyType, setSecureTextEntry, setSmartDashesType, setSmartInsertDeleteType, setSmartQuotesType, setSpellCheckingType, setTextContentType, smartDashesType, smartInsertDeleteType, smartQuotesType, spellCheckingType, textContentType
-
-
-
-
Method Detail
-
baseWritingDirectionForPositionInDirection
long baseWritingDirectionForPositionInDirection(UITextPosition position, long direction)
Writing direction
-
beginFloatingCursorAtPoint
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. If a client does not implement these methods, user feedback will be limited to the outcome after setting the selected text range using positions resulting from hit testing.
-
beginningOfDocument
UITextPosition beginningOfDocument()
The end and beginning of the the text document.
-
caretRectForPosition
CGRect caretRectForPosition(UITextPosition position)
-
characterOffsetOfPositionWithinRange
default long characterOffsetOfPositionWithinRange(UITextPosition position, UITextRange range)
-
characterRangeAtPoint
UITextRange characterRangeAtPoint(CGPoint point)
-
characterRangeByExtendingPositionInDirection
UITextRange characterRangeByExtendingPositionInDirection(UITextPosition position, long direction)
-
closestPositionToPoint
UITextPosition closestPositionToPoint(CGPoint point)
Hit testing.
-
closestPositionToPointWithinRange
UITextPosition closestPositionToPointWithinRange(CGPoint point, UITextRange range)
-
comparePositionToPosition
long comparePositionToPosition(UITextPosition position, UITextPosition other)
Simple evaluation of positions
-
dictationRecognitionFailed
default void dictationRecognitionFailed()
-
dictationRecordingDidEnd
default void dictationRecordingDidEnd()
These are optional methods for clients that wish to know when there are pending dictation results.
-
endFloatingCursor
default void endFloatingCursor()
-
endOfDocument
UITextPosition endOfDocument()
-
firstRectForRange
CGRect firstRectForRange(UITextRange range)
Geometry used to provide, for example, a correction rect.
-
frameForDictationResultPlaceholder
default CGRect frameForDictationResultPlaceholder(java.lang.Object placeholder)
-
inputDelegate
UITextInputDelegate inputDelegate()
A system-provied input delegate is assigned when the system is interested in input changes.
-
insertDictationResult
default void insertDictationResult(NSArray<? extends UIDictationPhrase> dictationResult)
This is an optional method for clients that wish to support dictation phrase alternatives. If they do not implement this method, dictation will just insert the most likely interpretation of what was spoken via -insertText:. dictationResult is an array of UIDictationPhrases.
-
insertDictationResultPlaceholder
default java.lang.Object insertDictationResultPlaceholder()
The following three optional methods are for clients that wish to support a placeholder for pending dictation results. -insertDictationPlaceholder must return a reference to the placeholder. This reference will be used to identify the placeholder by the other methods (there may be more than one placeholder).
-
markedTextRange
UITextRange markedTextRange()
Nil if no marked text.
-
markedTextStyle
NSDictionary<java.lang.String,?> markedTextStyle()
Describes how the marked text should be drawn.
-
offsetFromPositionToPosition
long offsetFromPositionToPosition(UITextPosition from, UITextPosition toPosition)
-
positionFromPositionInDirectionOffset
UITextPosition positionFromPositionInDirectionOffset(UITextPosition position, long direction, long offset)
-
positionFromPositionOffset
UITextPosition positionFromPositionOffset(UITextPosition position, long offset)
-
positionWithinRangeAtCharacterOffset
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.
-
positionWithinRangeFarthestInDirection
UITextPosition positionWithinRangeFarthestInDirection(UITextRange range, long direction)
Layout questions.
-
removeDictationResultPlaceholderWillInsertResult
default void removeDictationResultPlaceholderWillInsertResult(java.lang.Object placeholder, boolean willInsertResult)willInsertResult will be NO if the recognition failed.
-
replaceRangeWithText
void replaceRangeWithText(UITextRange range, java.lang.String text)
-
selectedTextRange
UITextRange selectedTextRange()
Text may have a selection, either zero-length (a caret) or ranged. Editing operations are always performed on the text from this selection. nil corresponds to no selection.
-
selectionAffinity
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.
-
selectionRectsForRange
NSArray<? extends UITextSelectionRect> selectionRectsForRange(UITextRange range)
Returns an array of UITextSelectionRects
-
setBaseWritingDirectionForRange
void setBaseWritingDirectionForRange(long writingDirection, UITextRange range)
-
setInputDelegate
void setInputDelegate(UITextInputDelegate value)
A system-provied input delegate is assigned when the system is interested in input changes.
-
setMarkedTextSelectedRange
void setMarkedTextSelectedRange(java.lang.String markedText, NSRange selectedRange)selectedRange is a range within the markedText
-
setMarkedTextStyle
void setMarkedTextStyle(NSDictionary<java.lang.String,?> value)
Describes how the marked text should be drawn.
-
setSelectedTextRange
void setSelectedTextRange(UITextRange value)
Text may have a selection, either zero-length (a caret) or ranged. Editing operations are always performed on the text from this selection. nil corresponds to no selection.
-
setSelectionAffinity
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.
-
shouldChangeTextInRangeReplacementText
default boolean shouldChangeTextInRangeReplacementText(UITextRange range, java.lang.String text)
return NO to not change text
-
textInRange
java.lang.String textInRange(UITextRange range)
Methods for manipulating text.
-
textInputView
default UIView textInputView()
An affiliated view that provides a coordinate system for all geometric values in this protocol. If unimplmeented, the first view in the responder chain will be selected.
-
textRangeFromPositionToPosition
UITextRange textRangeFromPositionToPosition(UITextPosition fromPosition, UITextPosition toPosition)
Methods for creating ranges and positions.
-
textStylingAtPositionInDirection
default NSDictionary<java.lang.String,?> textStylingAtPositionInDirection(UITextPosition position, long direction)
Text styling information can affect, for example, the appearance of a correction rect. Returns a dictionary containing NSAttributedString keys.
-
tokenizer
UITextInputTokenizer tokenizer()
A tokenizer must be provided to inform the text input system about text units of varying granularity.
-
unmarkText
void unmarkText()
-
updateFloatingCursorAtPoint
default void updateFloatingCursorAtPoint(CGPoint point)
-
insertTextAlternativesStyle
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. If they do not implement this method, the text will be inserted by -insertText: without the phase alternatives.
-
insertTextPlaceholderWithSize
default UITextPlaceholder insertTextPlaceholderWithSize(CGSize size)
Insert a placeholder If `size.height` is <= 0, then the placeholder is inline and line height. If `size.height` is > 0, then the placeholder is treated as a paragraph of height `size.height`.
-
removeTextPlaceholder
default void removeTextPlaceholder(UITextPlaceholder textPlaceholder)
Remove the placeholder.
-
setAttributedMarkedTextSelectedRange
default void setAttributedMarkedTextSelectedRange(NSAttributedString markedText, NSRange selectedRange)
set attributedString as markedText, selectedRange is a range within the markedText
-
-