Trait BETextInput

Source
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 { ... }
}
Available on crate feature BETextInput only.
Expand description

Provided Methods§

Source

unsafe fn asyncInputDelegate( &self, ) -> Option<Retained<ProtocolObject<dyn BETextInputDelegate>>>
where Self: Sized + Message,

Available on crate feature BETextInputDelegate only.

A system-provided input delegate is assigned when the system is interested in input changes.

Source

unsafe fn setAsyncInputDelegate( &self, async_input_delegate: Option<&ProtocolObject<dyn BETextInputDelegate>>, )
where Self: Sized + Message,

Available on crate feature BETextInputDelegate only.

This is a weak property. Setter for asyncInputDelegate.

Source

unsafe fn canPerformAction_withSender( &self, action: Sel, sender: Option<&AnyObject>, ) -> bool
where Self: Sized + Message,

Returns whether text related actions, such those included in UIResponderStandardEditActions, can be handled

Source

unsafe fn isEditable(&self) -> bool
where Self: Sized + Message,

Reflects the ability to modify text

Source

unsafe fn handleKeyEntry_withCompletionHandler( &self, entry: &BEKeyEntry, completion_handler: &DynBlock<dyn Fn(NonNull<BEKeyEntry>, Bool)>, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn shiftKeyStateChangedFromState_toState( &self, old_state: BEKeyModifierFlags, new_state: BEKeyModifierFlags, )
where Self: Sized + Message,

Indicates a transition in shift state

Source

unsafe fn textInRange(&self, range: &UITextRange) -> Option<Retained<NSString>>
where Self: Sized + Message,

Returns the text in the specified range.

Source

unsafe fn offsetFromPosition_toPosition( &self, from: &UITextPosition, to_position: &UITextPosition, ) -> NSInteger
where Self: Sized + Message,

Returns the number of UTF-16 characters between one text position and another text position.

Source

unsafe fn setBaseWritingDirection_forRange( &self, writing_direction: NSWritingDirection, range: &UITextRange, )
where Self: Sized + Message,

Sets the base writing direction for a specified range of text in a document.

Source

unsafe fn deleteInDirection_toGranularity( &self, direction: UITextStorageDirection, granularity: UITextGranularity, )
where Self: Sized + Message,

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)

Source

unsafe fn transposeCharactersAroundSelection(&self)
where Self: Sized + Message,

Transposes the characters on either side of the caret in response to the key command, ctrl + T

Source

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,

Available on crate feature 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.

Source

unsafe fn requestTextContextForAutocorrectionWithCompletionHandler( &self, completion_handler: &DynBlock<dyn Fn(NonNull<BETextDocumentContext>)>, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn requestTextRectsForString_withCompletionHandler( &self, input: &NSString, completion_handler: &DynBlock<dyn Fn(NonNull<NSArray<UITextSelectionRect>>)>, )
where Self: Sized + Message,

Available on crate feature 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 UITextSelectionRects for the substring nearest to the caret that matches the given input

Source

unsafe fn automaticallyPresentEditMenu(&self) -> bool
where Self: Sized + Message,

Controls whether the edit menu is allowed to be presented or should be suppressed.

Source

unsafe fn requestPreferredArrowDirectionForEditMenuWithCompletionHandler( &self, completion_handler: &DynBlock<dyn Fn(UIEditMenuArrowDirection)>, )
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn systemWillPresentEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
where Self: Sized + Message,

Invoked by the system when it is about to present an edit menu with an animator.

Source

unsafe fn systemWillDismissEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>, )
where Self: Sized + Message,

Invoked by the system when it is about to dismiss an edit menu with an animator.

Source

unsafe fn extendedTextInputTraits( &self, ) -> Option<Retained<ProtocolObject<dyn BEExtendedTextInputTraits>>>
where Self: Sized + Message,

Object from which the BEExtendedTextInputTraits will be gathered.

Source

unsafe fn textStylingAtPosition_inDirection( &self, position: &UITextPosition, direction: UITextStorageDirection, ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>
where Self: Sized + Message,

Returns a dictionary containing NSAttributedString keys represeting appearance customizations.

For example, text styling information influence the appearance of a correction rect.

Source

unsafe fn isReplaceAllowed(&self) -> bool
where Self: Sized + Message,

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.

Source

unsafe fn replaceSelectedText_withText( &self, text: &NSString, replacement_text: &NSString, )
where Self: Sized + Message,

Replaces the specified text with replacementText

  1. If there is a nonzero length current selection, then replace text with replacementText.
  2. If there is zero length current selection, then replace the matching word before the selection
  3. If the zero length selection is at the start of the element, then replace the matching word after the selection
Source

unsafe fn updateCurrentSelectionTo_fromGesture_inState( &self, point: CGPoint, gesture_type: BEGestureType, state: UIGestureRecognizerState, )
where Self: Sized + Message,

Available on crate features 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:]

Source

unsafe fn setSelectionFromPoint_toPoint_gesture_state( &self, from: CGPoint, to: CGPoint, gesture: BEGestureType, state: UIGestureRecognizerState, )
where Self: Sized + Message,

Available on crate features 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

Source

unsafe fn adjustSelectionBoundaryToPoint_touchPhase_baseIsStart_flags( &self, point: CGPoint, touch: BESelectionTouchPhase, boundary_is_start: bool, flags: BESelectionFlags, )
where Self: Sized + Message,

Available on crate features 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:]

Source

unsafe fn textInteractionGesture_shouldBeginAtPoint( &self, gesture_type: BEGestureType, point: CGPoint, ) -> bool
where Self: Sized + Message,

Available on crate features BETextSelectionTypes and objc2-core-foundation only.

Returns whether a gesture with the given gestureType should begin for the given point

Source

unsafe fn selectedText(&self) -> Option<Retained<NSString>>
where Self: Sized + Message,

String representing the selected text.

Source

unsafe fn selectedTextRange(&self) -> Option<Retained<UITextRange>>
where Self: Sized + Message,

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.

Source

unsafe fn setSelectedTextRange(&self, selected_text_range: Option<&UITextRange>)
where Self: Sized + Message,

Setter for selectedTextRange.

Source

unsafe fn isSelectionAtDocumentStart(&self) -> bool
where Self: Sized + Message,

Represents whether the current selection is at the beginning of the document

Source

unsafe fn caretRectForPosition(&self, position: &UITextPosition) -> CGRect
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.

Returns a rectangle to draw the caret at a specified insertion point.

Source

unsafe fn selectionRectsForRange( &self, range: &UITextRange, ) -> Retained<NSArray<UITextSelectionRect>>
where Self: Sized + Message,

Returns an array of selection rects corresponding to the range of text.

Source

unsafe fn selectWordForReplacement(&self)
where Self: Sized + Message,

Selects a word with autocorrect replacement suggestions when it is tapped

Source

unsafe fn updateSelectionWithExtentPoint_boundary_completionHandler( &self, point: CGPoint, granularity: UITextGranularity, completion_handler: &DynBlock<dyn Fn(Bool)>, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn selectTextInGranularity_atPoint_completionHandler( &self, granularity: UITextGranularity, point: CGPoint, completion_handler: &DynBlock<dyn Fn()>, )
where Self: Sized + Message,

Available on crate features block2 and objc2-core-foundation only.

Updates the selection to text contained within the specified granularity at the given point

Source

unsafe fn selectPositionAtPoint_completionHandler( &self, point: CGPoint, completion_handler: &DynBlock<dyn Fn()>, )
where Self: Sized + Message,

Available on crate features block2 and objc2-core-foundation only.

Sets the selection caret to the given point

Source

unsafe fn selectPositionAtPoint_withContextRequest_completionHandler( &self, point: CGPoint, request: &BETextDocumentRequest, completion_handler: &DynBlock<dyn Fn(NonNull<BETextDocumentContext>)>, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn adjustSelectionByRange_completionHandler( &self, range: BEDirectionalTextRange, completion_handler: &DynBlock<dyn Fn()>, )
where Self: Sized + Message,

Available on crate feature 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”.

Source

unsafe fn moveByOffset(&self, offset: NSInteger)
where Self: Sized + Message,

Adjusts the current selection by offset in character granularity units

Source

unsafe fn moveSelectionAtBoundary_inStorageDirection_completionHandler( &self, granularity: UITextGranularity, direction: UITextStorageDirection, completion_handler: &DynBlock<dyn Fn()>, )
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn selectTextForEditMenuWithLocationInView_completionHandler( &self, location_in_view: CGPoint, completion_handler: &DynBlock<dyn Fn(Bool, *mut NSString, NSRange)>, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn markedText(&self) -> Option<Retained<NSString>>
where Self: Sized + Message,

String for the text that has been marked as part of an active input session

Source

unsafe fn attributedMarkedText(&self) -> Option<Retained<NSAttributedString>>
where Self: Sized + Message,

Attributed string for the text that has been marked as part of an active input session

Source

unsafe fn markedTextRange(&self) -> Option<Retained<UITextRange>>
where Self: Sized + Message,

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

Source

unsafe fn hasMarkedText(&self) -> bool
where Self: Sized + Message,

Indicates whether there any text is currently marked as part of an active input session

Source

unsafe fn setMarkedText_selectedRange( &self, marked_text: Option<&NSString>, selected_range: NSRange, )
where Self: Sized + Message,

Inserts the provided text and marks it to indicate that it is part of an active input session.

Source

unsafe fn setAttributedMarkedText_selectedRange( &self, marked_text: Option<&NSAttributedString>, selected_range: NSRange, )
where Self: Sized + Message,

Inserts the provided styled text and marks it to indicate that it is part of an active input session.

Source

unsafe fn unmarkText(&self)
where Self: Sized + Message,

Unmarks the currently marked text

Source

unsafe fn isPointNearMarkedText(&self, point: CGPoint) -> bool
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn requestDocumentContext_completionHandler( &self, request: &BETextDocumentRequest, completion_handler: &DynBlock<dyn Fn(NonNull<BETextDocumentContext>)>, )
where Self: Sized + Message,

Available on crate features BETextDocumentContext and BETextDocumentRequest and block2 only.

Gathers context about the current document for the system

Source

unsafe fn willInsertFinalDictationResult(&self)
where Self: Sized + Message,

Indicates the system is about to insert the final dictation result.

Source

unsafe fn replaceDictatedText_withText( &self, old_text: &NSString, new_text: &NSString, )
where Self: Sized + Message,

Inserts/replaces text for a dictation.

Source

unsafe fn didInsertFinalDictationResult(&self)
where Self: Sized + Message,

Indicates system has inserted the final dictation result

Source

unsafe fn alternativesForSelectedText( &self, ) -> Option<Retained<NSArray<BETextAlternatives>>>
where Self: Sized + Message,

Available on crate feature BETextAlternatives only.

Returns the text alternatives that are available to the text input object.

Source

unsafe fn addTextAlternatives(&self, alternatives: &BETextAlternatives)
where Self: Sized + Message,

Available on crate feature BETextAlternatives only.

Adds text alternatives to the text input object for the current selection

Source

unsafe fn insertTextAlternatives(&self, alternatives: &BETextAlternatives)
where Self: Sized + Message,

Available on crate feature BETextAlternatives only.

Inserts the given text or one of it’s alternative texts available on alternatives

Source

unsafe fn removeTextAlternatives(&self)
where Self: Sized + Message,

Removes text alternatives from the text input object for the current selection

Source

unsafe fn insertTextPlaceholderWithSize_completionHandler( &self, size: CGSize, completion_handler: &DynBlock<dyn Fn(NonNull<UITextPlaceholder>)>, )
where Self: Sized + Message,

Available on crate features 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.

Source

unsafe fn removeTextPlaceholder_willInsertText_completionHandler( &self, placeholder: &UITextPlaceholder, will_insert_text: bool, completion_handler: &DynBlock<dyn Fn()>, )
where Self: Sized + Message,

Available on crate feature block2 only.

Removes a placeholder object from the text input view.

Source

unsafe fn insertTextSuggestion(&self, text_suggestion: &BETextSuggestion)
where Self: Sized + Message,

Available on crate feature BETextSuggestion only.

Inserts a textSuggestion in response to a user suggestion selection

Source

unsafe fn textInputView(&self) -> Retained<UIView>
where Self: Sized + Message,

An affiliated view that provides a coordinate system for all geometric values in this protocol.

Source

unsafe fn textFirstRect(&self) -> CGRect
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn textLastRect(&self) -> CGRect
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn unobscuredContentRect(&self) -> CGRect
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn unscaledView(&self) -> Retained<UIView>
where Self: Sized + Message,

View representing the web content that is agnostic of zoom state. Used to draw zoom agnostic system UI elements, such as the selection handles

Source

unsafe fn selectionClipRect(&self) -> CGRect
where Self: Sized + Message,

Available on crate feature objc2-core-foundation only.

Rect representing the bounds of editable elements, used to ensure and UI don’t overflow outside them

Source

unsafe fn autoscrollToPoint(&self, point: CGPoint)
where Self: Sized + Message,

Available on crate feature 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.

Source

unsafe fn cancelAutoscroll(&self)
where Self: Sized + Message,

Indicates autoscrolling is complete.

There will be no more calls intoautoscrollToPoint until a text interaction gesture starts autoscrolling.

Source

unsafe fn keyboardWillDismiss(&self)
where Self: Sized + Message,

Called when the user has requested the keyboard to dismiss itself.

Trait Implementations§

Source§

impl ProtocolType for dyn BETextInput

Source§

const NAME: &'static str = "BETextInput"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn BETextInput
where T: ?Sized + Message + BETextInput,

Implementations on Foreign Types§

Source§

impl<T> BETextInput for ProtocolObject<T>
where T: ?Sized + BETextInput,

Implementors§