pub unsafe trait BETextInput:
UIKeyInput
+ BETextSelectionDirectionNavigation
+ BEResponderEditActions {
Show 69 methods
// Provided methods
unsafe fn asyncInputDelegate(
&self,
) -> Option<Retained<ProtocolObject<dyn BETextInputDelegate>>>
where Self: Sized + Message { ... }
unsafe fn setAsyncInputDelegate(
&self,
async_input_delegate: Option<&ProtocolObject<dyn BETextInputDelegate>>,
)
where Self: Sized + Message { ... }
unsafe fn canPerformAction_withSender(
&self,
action: Sel,
sender: Option<&AnyObject>,
) -> bool
where Self: Sized + Message { ... }
unsafe fn isEditable(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn handleKeyEntry_withCompletionHandler(
&self,
entry: &BEKeyEntry,
completion_handler: &DynBlock<dyn Fn(NonNull<BEKeyEntry>, Bool)>,
)
where Self: Sized + Message { ... }
unsafe fn shiftKeyStateChangedFromState_toState(
&self,
old_state: BEKeyModifierFlags,
new_state: BEKeyModifierFlags,
)
where Self: Sized + Message { ... }
unsafe fn textInRange(
&self,
range: &UITextRange,
) -> Option<Retained<NSString>>
where Self: Sized + Message { ... }
unsafe fn offsetFromPosition_toPosition(
&self,
from: &UITextPosition,
to_position: &UITextPosition,
) -> NSInteger
where Self: Sized + Message { ... }
unsafe fn setBaseWritingDirection_forRange(
&self,
writing_direction: NSWritingDirection,
range: &UITextRange,
)
where Self: Sized + Message { ... }
unsafe fn deleteInDirection_toGranularity(
&self,
direction: UITextStorageDirection,
granularity: UITextGranularity,
)
where Self: Sized + Message { ... }
unsafe fn transposeCharactersAroundSelection(&self)
where Self: Sized + Message { ... }
unsafe fn replaceText_withText_options_completionHandler(
&self,
original_text: &NSString,
replacement_text: &NSString,
options: BETextReplacementOptions,
completion_handler: &DynBlock<dyn Fn(NonNull<NSArray<UITextSelectionRect>>)>,
)
where Self: Sized + Message { ... }
unsafe fn requestTextContextForAutocorrectionWithCompletionHandler(
&self,
completion_handler: &DynBlock<dyn Fn(NonNull<BETextDocumentContext>)>,
)
where Self: Sized + Message { ... }
unsafe fn requestTextRectsForString_withCompletionHandler(
&self,
input: &NSString,
completion_handler: &DynBlock<dyn Fn(NonNull<NSArray<UITextSelectionRect>>)>,
)
where Self: Sized + Message { ... }
unsafe fn automaticallyPresentEditMenu(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn requestPreferredArrowDirectionForEditMenuWithCompletionHandler(
&self,
completion_handler: &DynBlock<dyn Fn(UIEditMenuArrowDirection)>,
)
where Self: Sized + Message { ... }
unsafe fn systemWillPresentEditMenuWithAnimator(
&self,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
where Self: Sized + Message { ... }
unsafe fn systemWillDismissEditMenuWithAnimator(
&self,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
where Self: Sized + Message { ... }
unsafe fn extendedTextInputTraits(
&self,
) -> Option<Retained<ProtocolObject<dyn BEExtendedTextInputTraits>>>
where Self: Sized + Message { ... }
unsafe fn textStylingAtPosition_inDirection(
&self,
position: &UITextPosition,
direction: UITextStorageDirection,
) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>
where Self: Sized + Message { ... }
unsafe fn isReplaceAllowed(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn replaceSelectedText_withText(
&self,
text: &NSString,
replacement_text: &NSString,
)
where Self: Sized + Message { ... }
unsafe fn updateCurrentSelectionTo_fromGesture_inState(
&self,
point: CGPoint,
gesture_type: BEGestureType,
state: UIGestureRecognizerState,
)
where Self: Sized + Message { ... }
unsafe fn setSelectionFromPoint_toPoint_gesture_state(
&self,
from: CGPoint,
to: CGPoint,
gesture: BEGestureType,
state: UIGestureRecognizerState,
)
where Self: Sized + Message { ... }
unsafe fn adjustSelectionBoundaryToPoint_touchPhase_baseIsStart_flags(
&self,
point: CGPoint,
touch: BESelectionTouchPhase,
boundary_is_start: bool,
flags: BESelectionFlags,
)
where Self: Sized + Message { ... }
unsafe fn textInteractionGesture_shouldBeginAtPoint(
&self,
gesture_type: BEGestureType,
point: CGPoint,
) -> bool
where Self: Sized + Message { ... }
unsafe fn selectedText(&self) -> Option<Retained<NSString>>
where Self: Sized + Message { ... }
unsafe fn selectedTextRange(&self) -> Option<Retained<UITextRange>>
where Self: Sized + Message { ... }
unsafe fn setSelectedTextRange(
&self,
selected_text_range: Option<&UITextRange>,
)
where Self: Sized + Message { ... }
unsafe fn isSelectionAtDocumentStart(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn caretRectForPosition(&self, position: &UITextPosition) -> CGRect
where Self: Sized + Message { ... }
unsafe fn selectionRectsForRange(
&self,
range: &UITextRange,
) -> Retained<NSArray<UITextSelectionRect>>
where Self: Sized + Message { ... }
unsafe fn selectWordForReplacement(&self)
where Self: Sized + Message { ... }
unsafe fn updateSelectionWithExtentPoint_boundary_completionHandler(
&self,
point: CGPoint,
granularity: UITextGranularity,
completion_handler: &DynBlock<dyn Fn(Bool)>,
)
where Self: Sized + Message { ... }
unsafe fn selectTextInGranularity_atPoint_completionHandler(
&self,
granularity: UITextGranularity,
point: CGPoint,
completion_handler: &DynBlock<dyn Fn()>,
)
where Self: Sized + Message { ... }
unsafe fn selectPositionAtPoint_completionHandler(
&self,
point: CGPoint,
completion_handler: &DynBlock<dyn Fn()>,
)
where Self: Sized + Message { ... }
unsafe fn selectPositionAtPoint_withContextRequest_completionHandler(
&self,
point: CGPoint,
request: &BETextDocumentRequest,
completion_handler: &DynBlock<dyn Fn(NonNull<BETextDocumentContext>)>,
)
where Self: Sized + Message { ... }
unsafe fn adjustSelectionByRange_completionHandler(
&self,
range: BEDirectionalTextRange,
completion_handler: &DynBlock<dyn Fn()>,
)
where Self: Sized + Message { ... }
unsafe fn moveByOffset(&self, offset: NSInteger)
where Self: Sized + Message { ... }
unsafe fn moveSelectionAtBoundary_inStorageDirection_completionHandler(
&self,
granularity: UITextGranularity,
direction: UITextStorageDirection,
completion_handler: &DynBlock<dyn Fn()>,
)
where Self: Sized + Message { ... }
unsafe fn selectTextForEditMenuWithLocationInView_completionHandler(
&self,
location_in_view: CGPoint,
completion_handler: &DynBlock<dyn Fn(Bool, *mut NSString, NSRange)>,
)
where Self: Sized + Message { ... }
unsafe fn markedText(&self) -> Option<Retained<NSString>>
where Self: Sized + Message { ... }
unsafe fn attributedMarkedText(
&self,
) -> Option<Retained<NSAttributedString>>
where Self: Sized + Message { ... }
unsafe fn markedTextRange(&self) -> Option<Retained<UITextRange>>
where Self: Sized + Message { ... }
unsafe fn hasMarkedText(&self) -> bool
where Self: Sized + Message { ... }
unsafe fn setMarkedText_selectedRange(
&self,
marked_text: Option<&NSString>,
selected_range: NSRange,
)
where Self: Sized + Message { ... }
unsafe fn setAttributedMarkedText_selectedRange(
&self,
marked_text: Option<&NSAttributedString>,
selected_range: NSRange,
)
where Self: Sized + Message { ... }
unsafe fn unmarkText(&self)
where Self: Sized + Message { ... }
unsafe fn isPointNearMarkedText(&self, point: CGPoint) -> bool
where Self: Sized + Message { ... }
unsafe fn requestDocumentContext_completionHandler(
&self,
request: &BETextDocumentRequest,
completion_handler: &DynBlock<dyn Fn(NonNull<BETextDocumentContext>)>,
)
where Self: Sized + Message { ... }
unsafe fn willInsertFinalDictationResult(&self)
where Self: Sized + Message { ... }
unsafe fn replaceDictatedText_withText(
&self,
old_text: &NSString,
new_text: &NSString,
)
where Self: Sized + Message { ... }
unsafe fn didInsertFinalDictationResult(&self)
where Self: Sized + Message { ... }
unsafe fn alternativesForSelectedText(
&self,
) -> Option<Retained<NSArray<BETextAlternatives>>>
where Self: Sized + Message { ... }
unsafe fn addTextAlternatives(&self, alternatives: &BETextAlternatives)
where Self: Sized + Message { ... }
unsafe fn insertTextAlternatives(&self, alternatives: &BETextAlternatives)
where Self: Sized + Message { ... }
unsafe fn removeTextAlternatives(&self)
where Self: Sized + Message { ... }
unsafe fn insertTextPlaceholderWithSize_completionHandler(
&self,
size: CGSize,
completion_handler: &DynBlock<dyn Fn(NonNull<UITextPlaceholder>)>,
)
where Self: Sized + Message { ... }
unsafe fn removeTextPlaceholder_willInsertText_completionHandler(
&self,
placeholder: &UITextPlaceholder,
will_insert_text: bool,
completion_handler: &DynBlock<dyn Fn()>,
)
where Self: Sized + Message { ... }
unsafe fn insertTextSuggestion(&self, text_suggestion: &BETextSuggestion)
where Self: Sized + Message { ... }
unsafe fn textInputView(&self) -> Retained<UIView>
where Self: Sized + Message { ... }
unsafe fn textFirstRect(&self) -> CGRect
where Self: Sized + Message { ... }
unsafe fn textLastRect(&self) -> CGRect
where Self: Sized + Message { ... }
unsafe fn unobscuredContentRect(&self) -> CGRect
where Self: Sized + Message { ... }
unsafe fn unscaledView(&self) -> Retained<UIView>
where Self: Sized + Message { ... }
unsafe fn selectionClipRect(&self) -> CGRect
where Self: Sized + Message { ... }
unsafe fn autoscrollToPoint(&self, point: CGPoint)
where Self: Sized + Message { ... }
unsafe fn cancelAutoscroll(&self)
where Self: Sized + Message { ... }
unsafe fn keyboardWillDismiss(&self)
where Self: Sized + Message { ... }
}
BETextInput
only.Expand description
Provided Methods§
Sourceunsafe fn asyncInputDelegate(
&self,
) -> Option<Retained<ProtocolObject<dyn BETextInputDelegate>>>
Available on crate feature BETextInputDelegate
only.
unsafe fn asyncInputDelegate( &self, ) -> Option<Retained<ProtocolObject<dyn BETextInputDelegate>>>
BETextInputDelegate
only.A system-provided input delegate is assigned when the system is interested in input changes.
Sourceunsafe fn setAsyncInputDelegate(
&self,
async_input_delegate: Option<&ProtocolObject<dyn BETextInputDelegate>>,
)
Available on crate feature BETextInputDelegate
only.
unsafe fn setAsyncInputDelegate( &self, async_input_delegate: Option<&ProtocolObject<dyn BETextInputDelegate>>, )
BETextInputDelegate
only.This is a weak property.
Setter for asyncInputDelegate
.
Sourceunsafe fn canPerformAction_withSender(
&self,
action: Sel,
sender: Option<&AnyObject>,
) -> bool
unsafe fn canPerformAction_withSender( &self, action: Sel, sender: Option<&AnyObject>, ) -> bool
Returns whether text related actions, such those included in UIResponderStandardEditActions, can be handled
Sourceunsafe fn isEditable(&self) -> bool
unsafe fn isEditable(&self) -> bool
Reflects the ability to modify text
Sourceunsafe fn handleKeyEntry_withCompletionHandler(
&self,
entry: &BEKeyEntry,
completion_handler: &DynBlock<dyn Fn(NonNull<BEKeyEntry>, Bool)>,
)
Available on crate features BEKeyEntry
and block2
only.
unsafe fn handleKeyEntry_withCompletionHandler( &self, entry: &BEKeyEntry, completion_handler: &DynBlock<dyn Fn(NonNull<BEKeyEntry>, Bool)>, )
BEKeyEntry
and block2
only.Delegates the handling for each stage of a key event (key down, press, up) and allows the BETextInput object to indicate whether it should prevent default system behaviors.
Sourceunsafe fn shiftKeyStateChangedFromState_toState(
&self,
old_state: BEKeyModifierFlags,
new_state: BEKeyModifierFlags,
)
unsafe fn shiftKeyStateChangedFromState_toState( &self, old_state: BEKeyModifierFlags, new_state: BEKeyModifierFlags, )
Indicates a transition in shift state
Sourceunsafe fn textInRange(&self, range: &UITextRange) -> Option<Retained<NSString>>
unsafe fn textInRange(&self, range: &UITextRange) -> Option<Retained<NSString>>
Returns the text in the specified range.
Sourceunsafe fn offsetFromPosition_toPosition(
&self,
from: &UITextPosition,
to_position: &UITextPosition,
) -> NSInteger
unsafe fn offsetFromPosition_toPosition( &self, from: &UITextPosition, to_position: &UITextPosition, ) -> NSInteger
Returns the number of UTF-16 characters between one text position and another text position.
Sourceunsafe fn setBaseWritingDirection_forRange(
&self,
writing_direction: NSWritingDirection,
range: &UITextRange,
)
unsafe fn setBaseWritingDirection_forRange( &self, writing_direction: NSWritingDirection, range: &UITextRange, )
Sets the base writing direction for a specified range of text in a document.
Sourceunsafe fn deleteInDirection_toGranularity(
&self,
direction: UITextStorageDirection,
granularity: UITextGranularity,
)
unsafe fn deleteInDirection_toGranularity( &self, direction: UITextStorageDirection, granularity: UITextGranularity, )
Deletes text by the specified direction and granularity. Current supported combinations include:
character backward = delete character forward = delete-forward word backward = option + delete word forward = option + delete-forward line end = cmd + delete line start = cmd + delete-forward paragraph end = ctrl + K paragraph start = ctrl + fn + K
(On Apple keyboards, the delete-forward key is a combination of fn + delete)
Sourceunsafe fn transposeCharactersAroundSelection(&self)
unsafe fn transposeCharactersAroundSelection(&self)
Transposes the characters on either side of the caret in response to the key command, ctrl + T
Sourceunsafe fn replaceText_withText_options_completionHandler(
&self,
original_text: &NSString,
replacement_text: &NSString,
options: BETextReplacementOptions,
completion_handler: &DynBlock<dyn Fn(NonNull<NSArray<UITextSelectionRect>>)>,
)
Available on crate feature block2
only.
unsafe fn replaceText_withText_options_completionHandler( &self, original_text: &NSString, replacement_text: &NSString, options: BETextReplacementOptions, completion_handler: &DynBlock<dyn Fn(NonNull<NSArray<UITextSelectionRect>>)>, )
block2
only.Replace the specified text preceding the current selection.
Completion handler should be invoked with the rects representing the replacementText. If the replaceText could not be completed succesfully, such as when the originalText no longer matches the current text, then the completion handler should be invoked with an empty array.
Sourceunsafe fn requestTextContextForAutocorrectionWithCompletionHandler(
&self,
completion_handler: &DynBlock<dyn Fn(NonNull<BETextDocumentContext>)>,
)
Available on crate features BETextDocumentContext
and block2
only.
unsafe fn requestTextContextForAutocorrectionWithCompletionHandler( &self, completion_handler: &DynBlock<dyn Fn(NonNull<BETextDocumentContext>)>, )
BETextDocumentContext
and block2
only.Invoked by the system to gather context around the current selection. Clients should generally include the setence that contains the current selection and include the previous sentence if the current selection is at a boundary.
Sourceunsafe fn requestTextRectsForString_withCompletionHandler(
&self,
input: &NSString,
completion_handler: &DynBlock<dyn Fn(NonNull<NSArray<UITextSelectionRect>>)>,
)
Available on crate feature block2
only.
unsafe fn requestTextRectsForString_withCompletionHandler( &self, input: &NSString, completion_handler: &DynBlock<dyn Fn(NonNull<NSArray<UITextSelectionRect>>)>, )
block2
only.Invoked by the system to gather context for the presentation of various text related UI’s.
Completion handler should be invoked with the UITextSelectionRect
s for the substring nearest to the caret
that matches the given input
Sourceunsafe fn automaticallyPresentEditMenu(&self) -> bool
unsafe fn automaticallyPresentEditMenu(&self) -> bool
Controls whether the edit menu is allowed to be presented or should be suppressed.
Sourceunsafe fn requestPreferredArrowDirectionForEditMenuWithCompletionHandler(
&self,
completion_handler: &DynBlock<dyn Fn(UIEditMenuArrowDirection)>,
)
Available on crate feature block2
only.
unsafe fn requestPreferredArrowDirectionForEditMenuWithCompletionHandler( &self, completion_handler: &DynBlock<dyn Fn(UIEditMenuArrowDirection)>, )
block2
only.Invoked by the system to gather context, including the client’s preference for how the edit menu should be positioned relative to the selected text.
Sourceunsafe fn systemWillPresentEditMenuWithAnimator(
&self,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
unsafe fn systemWillPresentEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
Invoked by the system when it is about to present an edit menu with an animator.
Sourceunsafe fn systemWillDismissEditMenuWithAnimator(
&self,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
)
unsafe fn systemWillDismissEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
Invoked by the system when it is about to dismiss an edit menu with an animator.
Sourceunsafe fn extendedTextInputTraits(
&self,
) -> Option<Retained<ProtocolObject<dyn BEExtendedTextInputTraits>>>
unsafe fn extendedTextInputTraits( &self, ) -> Option<Retained<ProtocolObject<dyn BEExtendedTextInputTraits>>>
Object from which the BEExtendedTextInputTraits will be gathered.
Sourceunsafe fn textStylingAtPosition_inDirection(
&self,
position: &UITextPosition,
direction: UITextStorageDirection,
) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>
unsafe fn textStylingAtPosition_inDirection( &self, position: &UITextPosition, direction: UITextStorageDirection, ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>
Returns a dictionary containing NSAttributedString keys represeting appearance customizations.
For example, text styling information influence the appearance of a correction rect.
Sourceunsafe fn isReplaceAllowed(&self) -> bool
unsafe fn isReplaceAllowed(&self) -> bool
Returns whether replacement should be allowed for an editable element.
For example, replacement shouldn’t be allowed in password fields or when the selected text is only consists of whitespace.
Sourceunsafe fn replaceSelectedText_withText(
&self,
text: &NSString,
replacement_text: &NSString,
)
unsafe fn replaceSelectedText_withText( &self, text: &NSString, replacement_text: &NSString, )
Replaces the specified text
with replacementText
- If there is a nonzero length current selection, then replace text with replacementText.
- If there is zero length current selection, then replace the matching word before the selection
- If the zero length selection is at the start of the element, then replace the matching word after the selection
Sourceunsafe fn updateCurrentSelectionTo_fromGesture_inState(
&self,
point: CGPoint,
gesture_type: BEGestureType,
state: UIGestureRecognizerState,
)
Available on crate features BETextSelectionTypes
and objc2-core-foundation
only.
unsafe fn updateCurrentSelectionTo_fromGesture_inState( &self, point: CGPoint, gesture_type: BEGestureType, state: UIGestureRecognizerState, )
BETextSelectionTypes
and objc2-core-foundation
only.Indicates the point
the text interaction gesture is tracking has changed
Indicate to the system the change was handled by invoking: -[BETextInteraction selectionChangedWithGestureAtPoint:gesture:state:flags:]
Sourceunsafe fn setSelectionFromPoint_toPoint_gesture_state(
&self,
from: CGPoint,
to: CGPoint,
gesture: BEGestureType,
state: UIGestureRecognizerState,
)
Available on crate features BETextSelectionTypes
and objc2-core-foundation
only.
unsafe fn setSelectionFromPoint_toPoint_gesture_state( &self, from: CGPoint, to: CGPoint, gesture: BEGestureType, state: UIGestureRecognizerState, )
BETextSelectionTypes
and objc2-core-foundation
only.Indicates the selection should change to contain the text between the
from
and to
points.
For example, see the keyboard’s trackpad selection gesture explained in “Turn the onscreen keyboard into a trackpad” guide on support.apple.com
Sourceunsafe fn adjustSelectionBoundaryToPoint_touchPhase_baseIsStart_flags(
&self,
point: CGPoint,
touch: BESelectionTouchPhase,
boundary_is_start: bool,
flags: BESelectionFlags,
)
Available on crate features BETextSelectionTypes
and objc2-core-foundation
only.
unsafe fn adjustSelectionBoundaryToPoint_touchPhase_baseIsStart_flags( &self, point: CGPoint, touch: BESelectionTouchPhase, boundary_is_start: bool, flags: BESelectionFlags, )
BETextSelectionTypes
and objc2-core-foundation
only.Adjusts the selection’s start or end boundary specified by boundaryIsStart
to the point
For example, the selection’s boundary would be adjusted when the user moves the selection handles
Indicate to the system that the change was handled by invoking: -[BETextInteraction selectionBoundaryAdjustedToPoint:touchPhase:flags:]
Sourceunsafe fn textInteractionGesture_shouldBeginAtPoint(
&self,
gesture_type: BEGestureType,
point: CGPoint,
) -> bool
Available on crate features BETextSelectionTypes
and objc2-core-foundation
only.
unsafe fn textInteractionGesture_shouldBeginAtPoint( &self, gesture_type: BEGestureType, point: CGPoint, ) -> bool
BETextSelectionTypes
and objc2-core-foundation
only.Returns whether a gesture with the given gestureType
should begin for the given point
Sourceunsafe fn selectedText(&self) -> Option<Retained<NSString>>
unsafe fn selectedText(&self) -> Option<Retained<NSString>>
String representing the selected text.
Sourceunsafe fn selectedTextRange(&self) -> Option<Retained<UITextRange>>
unsafe fn selectedTextRange(&self) -> Option<Retained<UITextRange>>
Range representing the selected text.
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.
Sourceunsafe fn setSelectedTextRange(&self, selected_text_range: Option<&UITextRange>)
unsafe fn setSelectedTextRange(&self, selected_text_range: Option<&UITextRange>)
Setter for selectedTextRange
.
Sourceunsafe fn isSelectionAtDocumentStart(&self) -> bool
unsafe fn isSelectionAtDocumentStart(&self) -> bool
Represents whether the current selection is at the beginning of the document
Sourceunsafe fn caretRectForPosition(&self, position: &UITextPosition) -> CGRect
Available on crate feature objc2-core-foundation
only.
unsafe fn caretRectForPosition(&self, position: &UITextPosition) -> CGRect
objc2-core-foundation
only.Returns a rectangle to draw the caret at a specified insertion point.
Sourceunsafe fn selectionRectsForRange(
&self,
range: &UITextRange,
) -> Retained<NSArray<UITextSelectionRect>>
unsafe fn selectionRectsForRange( &self, range: &UITextRange, ) -> Retained<NSArray<UITextSelectionRect>>
Returns an array of selection rects corresponding to the range of text.
Sourceunsafe fn selectWordForReplacement(&self)
unsafe fn selectWordForReplacement(&self)
Selects a word with autocorrect replacement suggestions when it is tapped
Sourceunsafe fn updateSelectionWithExtentPoint_boundary_completionHandler(
&self,
point: CGPoint,
granularity: UITextGranularity,
completion_handler: &DynBlock<dyn Fn(Bool)>,
)
Available on crate features block2
and objc2-core-foundation
only.
unsafe fn updateSelectionWithExtentPoint_boundary_completionHandler( &self, point: CGPoint, granularity: UITextGranularity, completion_handler: &DynBlock<dyn Fn(Bool)>, )
block2
and objc2-core-foundation
only.Adjusts the selection from current text position to include text at the given point
.
For example, while holding shift, click a point in a text document and the current selection should adjust to include all the text up to that point.
Sourceunsafe fn selectTextInGranularity_atPoint_completionHandler(
&self,
granularity: UITextGranularity,
point: CGPoint,
completion_handler: &DynBlock<dyn Fn()>,
)
Available on crate features block2
and objc2-core-foundation
only.
unsafe fn selectTextInGranularity_atPoint_completionHandler( &self, granularity: UITextGranularity, point: CGPoint, completion_handler: &DynBlock<dyn Fn()>, )
block2
and objc2-core-foundation
only.Updates the selection to text contained within the specified granularity
at the given point
Sourceunsafe fn selectPositionAtPoint_completionHandler(
&self,
point: CGPoint,
completion_handler: &DynBlock<dyn Fn()>,
)
Available on crate features block2
and objc2-core-foundation
only.
unsafe fn selectPositionAtPoint_completionHandler( &self, point: CGPoint, completion_handler: &DynBlock<dyn Fn()>, )
block2
and objc2-core-foundation
only.Sets the selection caret to the given point
Sourceunsafe fn selectPositionAtPoint_withContextRequest_completionHandler(
&self,
point: CGPoint,
request: &BETextDocumentRequest,
completion_handler: &DynBlock<dyn Fn(NonNull<BETextDocumentContext>)>,
)
Available on crate features BETextDocumentContext
and BETextDocumentRequest
and block2
and objc2-core-foundation
only.
unsafe fn selectPositionAtPoint_withContextRequest_completionHandler( &self, point: CGPoint, request: &BETextDocumentRequest, completion_handler: &DynBlock<dyn Fn(NonNull<BETextDocumentContext>)>, )
BETextDocumentContext
and BETextDocumentRequest
and block2
and objc2-core-foundation
only.Sets the selection caret to the given point. Also includes a convenience document context request.
Sourceunsafe fn adjustSelectionByRange_completionHandler(
&self,
range: BEDirectionalTextRange,
completion_handler: &DynBlock<dyn Fn()>,
)
Available on crate feature block2
only.
unsafe fn adjustSelectionByRange_completionHandler( &self, range: BEDirectionalTextRange, completion_handler: &DynBlock<dyn Fn()>, )
block2
only.Adjusts the selection by the moving the selected range by the given range
, in character granularity units.
The start of the current selection is moved by range.offset
characters, and the length of the selection
is modified by range.length
characters. For instance, if the current selection is the word “world” in
“Hello world” and the range
is { -6, -2 }
, the selected text after adjustment will be “Hel”.
Sourceunsafe fn moveByOffset(&self, offset: NSInteger)
unsafe fn moveByOffset(&self, offset: NSInteger)
Adjusts the current selection by offset
in character granularity units
Sourceunsafe fn moveSelectionAtBoundary_inStorageDirection_completionHandler(
&self,
granularity: UITextGranularity,
direction: UITextStorageDirection,
completion_handler: &DynBlock<dyn Fn()>,
)
Available on crate feature block2
only.
unsafe fn moveSelectionAtBoundary_inStorageDirection_completionHandler( &self, granularity: UITextGranularity, direction: UITextStorageDirection, completion_handler: &DynBlock<dyn Fn()>, )
block2
only.Moves the caret to relative to the current position in the direction
to the given granularity
.
The direction
is “forward” or “backward” in accordance with the directionality of the language.
This method is invoked only when -[BETextInput textInteractionGesture:shouldBeginAtPoint:] returns YES.
Sourceunsafe fn selectTextForEditMenuWithLocationInView_completionHandler(
&self,
location_in_view: CGPoint,
completion_handler: &DynBlock<dyn Fn(Bool, *mut NSString, NSRange)>,
)
Available on crate features block2
and objc2-core-foundation
only.
unsafe fn selectTextForEditMenuWithLocationInView_completionHandler( &self, location_in_view: CGPoint, completion_handler: &DynBlock<dyn Fn(Bool, *mut NSString, NSRange)>, )
block2
and objc2-core-foundation
only.Indicates the edit menu is being shown at the given location in the text input view’s coordinate space.
The completion handler takes a BOOL indicating whether or not the menu should be shown, a string representing the text context around the updated selection range (generally encompassing the paragraph that contains the selection range) as well as the range of the updated selection, relative to the paragraph context.
Sourceunsafe fn markedText(&self) -> Option<Retained<NSString>>
unsafe fn markedText(&self) -> Option<Retained<NSString>>
String for the text that has been marked as part of an active input session
Sourceunsafe fn attributedMarkedText(&self) -> Option<Retained<NSAttributedString>>
unsafe fn attributedMarkedText(&self) -> Option<Retained<NSAttributedString>>
Attributed string for the text that has been marked as part of an active input session
Sourceunsafe fn markedTextRange(&self) -> Option<Retained<UITextRange>>
unsafe fn markedTextRange(&self) -> Option<Retained<UITextRange>>
Range representing the position of the markedText.
If text can be selected, it can be marked. Marked text represents provisionally inserted text that has yet to be confirmed by the user. It requires unique visual treatment in its display. If there is any marked text, the selection, whether a caret or an extended range, always resides within.
Setting marked text either replaces the existing marked text or, if none is present, inserts it from the current selection.
Return nil if no marked text
Sourceunsafe fn hasMarkedText(&self) -> bool
unsafe fn hasMarkedText(&self) -> bool
Indicates whether there any text is currently marked as part of an active input session
Sourceunsafe fn setMarkedText_selectedRange(
&self,
marked_text: Option<&NSString>,
selected_range: NSRange,
)
unsafe fn setMarkedText_selectedRange( &self, marked_text: Option<&NSString>, selected_range: NSRange, )
Inserts the provided text and marks it to indicate that it is part of an active input session.
Sourceunsafe fn setAttributedMarkedText_selectedRange(
&self,
marked_text: Option<&NSAttributedString>,
selected_range: NSRange,
)
unsafe fn setAttributedMarkedText_selectedRange( &self, marked_text: Option<&NSAttributedString>, selected_range: NSRange, )
Inserts the provided styled text and marks it to indicate that it is part of an active input session.
Sourceunsafe fn unmarkText(&self)
unsafe fn unmarkText(&self)
Unmarks the currently marked text
Sourceunsafe fn isPointNearMarkedText(&self, point: CGPoint) -> bool
Available on crate feature objc2-core-foundation
only.
unsafe fn isPointNearMarkedText(&self, point: CGPoint) -> bool
objc2-core-foundation
only.Returns whether a point should be considered “near” the marked text. Used to determine whether text interaction gestures near marked text should begin.
For example, text interaction gestures may considered “near” if they are within 66 points.
Sourceunsafe fn requestDocumentContext_completionHandler(
&self,
request: &BETextDocumentRequest,
completion_handler: &DynBlock<dyn Fn(NonNull<BETextDocumentContext>)>,
)
Available on crate features BETextDocumentContext
and BETextDocumentRequest
and block2
only.
unsafe fn requestDocumentContext_completionHandler( &self, request: &BETextDocumentRequest, completion_handler: &DynBlock<dyn Fn(NonNull<BETextDocumentContext>)>, )
BETextDocumentContext
and BETextDocumentRequest
and block2
only.Gathers context about the current document for the system
Sourceunsafe fn willInsertFinalDictationResult(&self)
unsafe fn willInsertFinalDictationResult(&self)
Indicates the system is about to insert the final dictation result.
Sourceunsafe fn replaceDictatedText_withText(
&self,
old_text: &NSString,
new_text: &NSString,
)
unsafe fn replaceDictatedText_withText( &self, old_text: &NSString, new_text: &NSString, )
Inserts/replaces text for a dictation.
Sourceunsafe fn didInsertFinalDictationResult(&self)
unsafe fn didInsertFinalDictationResult(&self)
Indicates system has inserted the final dictation result
Sourceunsafe fn alternativesForSelectedText(
&self,
) -> Option<Retained<NSArray<BETextAlternatives>>>
Available on crate feature BETextAlternatives
only.
unsafe fn alternativesForSelectedText( &self, ) -> Option<Retained<NSArray<BETextAlternatives>>>
BETextAlternatives
only.Returns the text alternatives that are available to the text input object.
Sourceunsafe fn addTextAlternatives(&self, alternatives: &BETextAlternatives)
Available on crate feature BETextAlternatives
only.
unsafe fn addTextAlternatives(&self, alternatives: &BETextAlternatives)
BETextAlternatives
only.Adds text alternatives to the text input object for the current selection
Sourceunsafe fn insertTextAlternatives(&self, alternatives: &BETextAlternatives)
Available on crate feature BETextAlternatives
only.
unsafe fn insertTextAlternatives(&self, alternatives: &BETextAlternatives)
BETextAlternatives
only.Inserts the given text
or one of it’s alternative texts available on alternatives
Sourceunsafe fn removeTextAlternatives(&self)
unsafe fn removeTextAlternatives(&self)
Removes text alternatives from the text input object for the current selection
Sourceunsafe fn insertTextPlaceholderWithSize_completionHandler(
&self,
size: CGSize,
completion_handler: &DynBlock<dyn Fn(NonNull<UITextPlaceholder>)>,
)
Available on crate features block2
and objc2-core-foundation
only.
unsafe fn insertTextPlaceholderWithSize_completionHandler( &self, size: CGSize, completion_handler: &DynBlock<dyn Fn(NonNull<UITextPlaceholder>)>, )
block2
and objc2-core-foundation
only.Inserts a placeholder object to reserve visual space during text input.
If size.height
is less than or equal to zero, then the placeholder is inline and line height.
If size.height
is greather than zero, then the placeholder is treated as a paragraph of height size.height
.
Sourceunsafe fn removeTextPlaceholder_willInsertText_completionHandler(
&self,
placeholder: &UITextPlaceholder,
will_insert_text: bool,
completion_handler: &DynBlock<dyn Fn()>,
)
Available on crate feature block2
only.
unsafe fn removeTextPlaceholder_willInsertText_completionHandler( &self, placeholder: &UITextPlaceholder, will_insert_text: bool, completion_handler: &DynBlock<dyn Fn()>, )
block2
only.Removes a placeholder object from the text input view.
Sourceunsafe fn insertTextSuggestion(&self, text_suggestion: &BETextSuggestion)
Available on crate feature BETextSuggestion
only.
unsafe fn insertTextSuggestion(&self, text_suggestion: &BETextSuggestion)
BETextSuggestion
only.Inserts a textSuggestion
in response to a user suggestion selection
Sourceunsafe fn textInputView(&self) -> Retained<UIView>
unsafe fn textInputView(&self) -> Retained<UIView>
An affiliated view that provides a coordinate system for all geometric values in this protocol.
Sourceunsafe fn textFirstRect(&self) -> CGRect
Available on crate feature objc2-core-foundation
only.
unsafe fn textFirstRect(&self) -> CGRect
objc2-core-foundation
only.Returns a rect representing the bounds of the first line of marked text, if marked text is set.
Otherwise, this returns a rect representing the bounds of the last word at or before the insertion point.
Sourceunsafe fn textLastRect(&self) -> CGRect
Available on crate feature objc2-core-foundation
only.
unsafe fn textLastRect(&self) -> CGRect
objc2-core-foundation
only.Returns a rect representing the bounds of the last line of marked text, if marked text is set.
Otherwise, this returns a rect representing the bounds of the last word at or before the insertion point.
This may have the same value of textFirstRect
, but can differ in cases such as a word that spans two lines.
Sourceunsafe fn unobscuredContentRect(&self) -> CGRect
Available on crate feature objc2-core-foundation
only.
unsafe fn unobscuredContentRect(&self) -> CGRect
objc2-core-foundation
only.Rect used to place UI (such as selection handles) in a location that isn’t obscurred by app UI.
Must return a rect in textInputView
’s coordinate space.
Sourceunsafe fn unscaledView(&self) -> Retained<UIView>
unsafe fn unscaledView(&self) -> Retained<UIView>
View representing the web content that is agnostic of zoom state. Used to draw zoom agnostic system UI elements, such as the selection handles
Sourceunsafe fn selectionClipRect(&self) -> CGRect
Available on crate feature objc2-core-foundation
only.
unsafe fn selectionClipRect(&self) -> CGRect
objc2-core-foundation
only.Rect representing the bounds of editable elements, used to ensure and UI don’t overflow outside them
Sourceunsafe fn autoscrollToPoint(&self, point: CGPoint)
Available on crate feature objc2-core-foundation
only.
unsafe fn autoscrollToPoint(&self, point: CGPoint)
objc2-core-foundation
only.Indicates autoscrolling has been triggered by a text interaction gesture.
Called repeatedly during range adjustment gestures, or when placing the text cursor.
The given point is in the coordinate space of the textInputView
.
Sourceunsafe fn cancelAutoscroll(&self)
unsafe fn cancelAutoscroll(&self)
Indicates autoscrolling is complete.
There will be no more calls intoautoscrollToPoint
until a text interaction gesture starts autoscrolling.
Sourceunsafe fn keyboardWillDismiss(&self)
unsafe fn keyboardWillDismiss(&self)
Called when the user has requested the keyboard to dismiss itself.