Trait objc2_ui_kit::UITextInput
source · pub unsafe trait UITextInput: UIKeyInput + IsMainThreadOnly {
Show 53 methods
// Provided methods
unsafe fn textInRange(
&self,
range: &UITextRange
) -> Option<Retained<NSString>>
where Self: Sized + Message { ... }
unsafe fn replaceRange_withText(&self, range: &UITextRange, text: &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 markedTextRange(&self) -> Option<Retained<UITextRange>>
where Self: Sized + Message { ... }
unsafe fn markedTextStyle(
&self
) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>
where Self: Sized + Message { ... }
unsafe fn setMarkedTextStyle(
&self,
marked_text_style: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>
)
where Self: Sized + Message { ... }
unsafe fn setMarkedText_selectedRange(
&self,
marked_text: Option<&NSString>,
selected_range: NSRange
)
where Self: Sized + Message { ... }
unsafe fn unmarkText(&self)
where Self: Sized + Message { ... }
unsafe fn beginningOfDocument(&self) -> Retained<UITextPosition>
where Self: Sized + Message { ... }
unsafe fn endOfDocument(&self) -> Retained<UITextPosition>
where Self: Sized + Message { ... }
unsafe fn textRangeFromPosition_toPosition(
&self,
from_position: &UITextPosition,
to_position: &UITextPosition
) -> Option<Retained<UITextRange>>
where Self: Sized + Message { ... }
unsafe fn positionFromPosition_offset(
&self,
position: &UITextPosition,
offset: NSInteger
) -> Option<Retained<UITextPosition>>
where Self: Sized + Message { ... }
unsafe fn positionFromPosition_inDirection_offset(
&self,
position: &UITextPosition,
direction: UITextLayoutDirection,
offset: NSInteger
) -> Option<Retained<UITextPosition>>
where Self: Sized + Message { ... }
unsafe fn comparePosition_toPosition(
&self,
position: &UITextPosition,
other: &UITextPosition
) -> NSComparisonResult
where Self: Sized + Message { ... }
unsafe fn offsetFromPosition_toPosition(
&self,
from: &UITextPosition,
to_position: &UITextPosition
) -> NSInteger
where Self: Sized + Message { ... }
unsafe fn inputDelegate(
&self
) -> Option<Retained<ProtocolObject<dyn UITextInputDelegate>>>
where Self: Sized + Message { ... }
unsafe fn setInputDelegate(
&self,
input_delegate: Option<&ProtocolObject<dyn UITextInputDelegate>>
)
where Self: Sized + Message { ... }
unsafe fn tokenizer(
&self
) -> Retained<ProtocolObject<dyn UITextInputTokenizer>>
where Self: Sized + Message { ... }
unsafe fn positionWithinRange_farthestInDirection(
&self,
range: &UITextRange,
direction: UITextLayoutDirection
) -> Option<Retained<UITextPosition>>
where Self: Sized + Message { ... }
unsafe fn characterRangeByExtendingPosition_inDirection(
&self,
position: &UITextPosition,
direction: UITextLayoutDirection
) -> Option<Retained<UITextRange>>
where Self: Sized + Message { ... }
unsafe fn baseWritingDirectionForPosition_inDirection(
&self,
position: &UITextPosition,
direction: UITextStorageDirection
) -> NSWritingDirection
where Self: Sized + Message { ... }
unsafe fn setBaseWritingDirection_forRange(
&self,
writing_direction: NSWritingDirection,
range: &UITextRange
)
where Self: Sized + Message { ... }
unsafe fn firstRectForRange(&self, range: &UITextRange) -> CGRect
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 closestPositionToPoint(
&self,
point: CGPoint
) -> Option<Retained<UITextPosition>>
where Self: Sized + Message { ... }
unsafe fn closestPositionToPoint_withinRange(
&self,
point: CGPoint,
range: &UITextRange
) -> Option<Retained<UITextPosition>>
where Self: Sized + Message { ... }
unsafe fn characterRangeAtPoint(
&self,
point: CGPoint
) -> Option<Retained<UITextRange>>
where Self: Sized + Message { ... }
unsafe fn shouldChangeTextInRange_replacementText(
&self,
range: &UITextRange,
text: &NSString
) -> bool
where Self: Sized + Message { ... }
unsafe fn textStylingAtPosition_inDirection(
&self,
position: &UITextPosition,
direction: UITextStorageDirection
) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>
where Self: Sized + Message { ... }
unsafe fn positionWithinRange_atCharacterOffset(
&self,
range: &UITextRange,
offset: NSInteger
) -> Option<Retained<UITextPosition>>
where Self: Sized + Message { ... }
unsafe fn characterOffsetOfPosition_withinRange(
&self,
position: &UITextPosition,
range: &UITextRange
) -> NSInteger
where Self: Sized + Message { ... }
unsafe fn textInputView(&self) -> Retained<UIView>
where Self: Sized + Message { ... }
unsafe fn selectionAffinity(&self) -> UITextStorageDirection
where Self: Sized + Message { ... }
unsafe fn setSelectionAffinity(
&self,
selection_affinity: UITextStorageDirection
)
where Self: Sized + Message { ... }
unsafe fn insertDictationResult(
&self,
dictation_result: &NSArray<UIDictationPhrase>
)
where Self: Sized + Message { ... }
unsafe fn dictationRecordingDidEnd(&self)
where Self: Sized + Message { ... }
unsafe fn dictationRecognitionFailed(&self)
where Self: Sized + Message { ... }
unsafe fn insertDictationResultPlaceholder(&self) -> Retained<AnyObject>
where Self: Sized + Message { ... }
unsafe fn frameForDictationResultPlaceholder(
&self,
placeholder: &AnyObject
) -> CGRect
where Self: Sized + Message { ... }
unsafe fn removeDictationResultPlaceholder_willInsertResult(
&self,
placeholder: &AnyObject,
will_insert_result: bool
)
where Self: Sized + Message { ... }
unsafe fn insertText_alternatives_style(
&self,
text: &NSString,
alternatives: &NSArray<NSString>,
style: UITextAlternativeStyle
)
where Self: Sized + Message { ... }
unsafe fn setAttributedMarkedText_selectedRange(
&self,
marked_text: Option<&NSAttributedString>,
selected_range: NSRange
)
where Self: Sized + Message { ... }
unsafe fn insertTextPlaceholderWithSize(
&self,
size: CGSize
) -> Retained<UITextPlaceholder>
where Self: Sized + Message { ... }
unsafe fn removeTextPlaceholder(&self, text_placeholder: &UITextPlaceholder)
where Self: Sized + Message { ... }
unsafe fn beginFloatingCursorAtPoint(&self, point: CGPoint)
where Self: Sized + Message { ... }
unsafe fn updateFloatingCursorAtPoint(&self, point: CGPoint)
where Self: Sized + Message { ... }
unsafe fn endFloatingCursor(&self)
where Self: Sized + Message { ... }
unsafe fn caretTransformForPosition(
&self,
position: &UITextPosition
) -> CGAffineTransform
where Self: Sized + Message { ... }
unsafe fn editMenuForTextRange_suggestedActions(
&self,
text_range: &UITextRange,
suggested_actions: &NSArray<UIMenuElement>
) -> Option<Retained<UIMenu>>
where Self: Sized + Message { ... }
unsafe fn willPresentEditMenuWithAnimator(
&self,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>
)
where Self: Sized + Message { ... }
unsafe fn willDismissEditMenuWithAnimator(
&self,
animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>
)
where Self: Sized + Message { ... }
}
Available on crate features
UITextInput
and UITextInputTraits
only.Provided Methods§
unsafe fn textInRange(&self, range: &UITextRange) -> Option<Retained<NSString>>
unsafe fn replaceRange_withText(&self, range: &UITextRange, text: &NSString)
unsafe fn selectedTextRange(&self) -> Option<Retained<UITextRange>>
unsafe fn setSelectedTextRange(&self, selected_text_range: Option<&UITextRange>)
unsafe fn markedTextRange(&self) -> Option<Retained<UITextRange>>
unsafe fn markedTextStyle( &self ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>
unsafe fn setMarkedTextStyle( &self, marked_text_style: Option<&NSDictionary<NSAttributedStringKey, AnyObject>> )
unsafe fn setMarkedText_selectedRange( &self, marked_text: Option<&NSString>, selected_range: NSRange )
unsafe fn unmarkText(&self)
unsafe fn beginningOfDocument(&self) -> Retained<UITextPosition>
unsafe fn endOfDocument(&self) -> Retained<UITextPosition>
unsafe fn textRangeFromPosition_toPosition( &self, from_position: &UITextPosition, to_position: &UITextPosition ) -> Option<Retained<UITextRange>>
unsafe fn positionFromPosition_offset( &self, position: &UITextPosition, offset: NSInteger ) -> Option<Retained<UITextPosition>>
unsafe fn positionFromPosition_inDirection_offset( &self, position: &UITextPosition, direction: UITextLayoutDirection, offset: NSInteger ) -> Option<Retained<UITextPosition>>
unsafe fn comparePosition_toPosition( &self, position: &UITextPosition, other: &UITextPosition ) -> NSComparisonResult
unsafe fn offsetFromPosition_toPosition( &self, from: &UITextPosition, to_position: &UITextPosition ) -> NSInteger
unsafe fn inputDelegate( &self ) -> Option<Retained<ProtocolObject<dyn UITextInputDelegate>>>
unsafe fn setInputDelegate( &self, input_delegate: Option<&ProtocolObject<dyn UITextInputDelegate>> )
unsafe fn tokenizer(&self) -> Retained<ProtocolObject<dyn UITextInputTokenizer>>
unsafe fn positionWithinRange_farthestInDirection( &self, range: &UITextRange, direction: UITextLayoutDirection ) -> Option<Retained<UITextPosition>>
unsafe fn characterRangeByExtendingPosition_inDirection( &self, position: &UITextPosition, direction: UITextLayoutDirection ) -> Option<Retained<UITextRange>>
unsafe fn baseWritingDirectionForPosition_inDirection( &self, position: &UITextPosition, direction: UITextStorageDirection ) -> NSWritingDirection
Available on crate feature
NSText
only.unsafe fn setBaseWritingDirection_forRange( &self, writing_direction: NSWritingDirection, range: &UITextRange )
Available on crate feature
NSText
only.unsafe fn firstRectForRange(&self, range: &UITextRange) -> CGRect
unsafe fn caretRectForPosition(&self, position: &UITextPosition) -> CGRect
unsafe fn selectionRectsForRange( &self, range: &UITextRange ) -> Retained<NSArray<UITextSelectionRect>>
unsafe fn closestPositionToPoint( &self, point: CGPoint ) -> Option<Retained<UITextPosition>>
unsafe fn closestPositionToPoint_withinRange( &self, point: CGPoint, range: &UITextRange ) -> Option<Retained<UITextPosition>>
unsafe fn characterRangeAtPoint( &self, point: CGPoint ) -> Option<Retained<UITextRange>>
unsafe fn shouldChangeTextInRange_replacementText( &self, range: &UITextRange, text: &NSString ) -> bool
unsafe fn textStylingAtPosition_inDirection( &self, position: &UITextPosition, direction: UITextStorageDirection ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>
unsafe fn positionWithinRange_atCharacterOffset( &self, range: &UITextRange, offset: NSInteger ) -> Option<Retained<UITextPosition>>
unsafe fn characterOffsetOfPosition_withinRange( &self, position: &UITextPosition, range: &UITextRange ) -> NSInteger
unsafe fn textInputView(&self) -> Retained<UIView>
Available on crate features
UIResponder
and UIView
only.unsafe fn selectionAffinity(&self) -> UITextStorageDirection
unsafe fn setSelectionAffinity( &self, selection_affinity: UITextStorageDirection )
unsafe fn insertDictationResult( &self, dictation_result: &NSArray<UIDictationPhrase> )
unsafe fn dictationRecordingDidEnd(&self)
unsafe fn dictationRecognitionFailed(&self)
unsafe fn insertDictationResultPlaceholder(&self) -> Retained<AnyObject>
unsafe fn frameForDictationResultPlaceholder( &self, placeholder: &AnyObject ) -> CGRect
unsafe fn removeDictationResultPlaceholder_willInsertResult( &self, placeholder: &AnyObject, will_insert_result: bool )
unsafe fn insertText_alternatives_style( &self, text: &NSString, alternatives: &NSArray<NSString>, style: UITextAlternativeStyle )
unsafe fn setAttributedMarkedText_selectedRange( &self, marked_text: Option<&NSAttributedString>, selected_range: NSRange )
unsafe fn insertTextPlaceholderWithSize( &self, size: CGSize ) -> Retained<UITextPlaceholder>
unsafe fn removeTextPlaceholder(&self, text_placeholder: &UITextPlaceholder)
unsafe fn beginFloatingCursorAtPoint(&self, point: CGPoint)
unsafe fn updateFloatingCursorAtPoint(&self, point: CGPoint)
unsafe fn endFloatingCursor(&self)
unsafe fn caretTransformForPosition( &self, position: &UITextPosition ) -> CGAffineTransform
unsafe fn editMenuForTextRange_suggestedActions( &self, text_range: &UITextRange, suggested_actions: &NSArray<UIMenuElement> ) -> Option<Retained<UIMenu>>
Available on crate features
UIMenu
and UIMenuElement
only.unsafe fn willPresentEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating> )
Available on crate feature
UIEditMenuInteraction
only.unsafe fn willDismissEditMenuWithAnimator( &self, animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating> )
Available on crate feature
UIEditMenuInteraction
only.Trait Implementations§
source§impl ProtocolType for dyn UITextInput
impl ProtocolType for dyn UITextInput
impl<T> ImplementedBy<T> for dyn UITextInput
Implementations on Foreign Types§
impl<T> UITextInput for ProtocolObject<T>where
T: ?Sized + UITextInput,
Implementors§
impl UITextInput for UISearchTextField
Available on crate features
UIControl
and UIResponder
and UITextField
and UIView
and UISearchTextField
only.impl UITextInput for UITextField
Available on crate features
UIControl
and UIResponder
and UIView
and UITextField
only.impl UITextInput for UITextView
Available on crate features
UIResponder
and UIScrollView
and UIView
and UITextView
only.