1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15extern_protocol!(
16 #[cfg(feature = "UIScrollView")]
18 pub unsafe trait UITextViewDelegate:
19 NSObjectProtocol + UIScrollViewDelegate + MainThreadOnly
20 {
21 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
22 #[optional]
23 #[unsafe(method(textViewShouldBeginEditing:))]
24 #[unsafe(method_family = none)]
25 fn textViewShouldBeginEditing(&self, text_view: &UITextView) -> bool;
26
27 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
28 #[optional]
29 #[unsafe(method(textViewShouldEndEditing:))]
30 #[unsafe(method_family = none)]
31 fn textViewShouldEndEditing(&self, text_view: &UITextView) -> bool;
32
33 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
34 #[optional]
35 #[unsafe(method(textViewDidBeginEditing:))]
36 #[unsafe(method_family = none)]
37 fn textViewDidBeginEditing(&self, text_view: &UITextView);
38
39 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
40 #[optional]
41 #[unsafe(method(textViewDidEndEditing:))]
42 #[unsafe(method_family = none)]
43 fn textViewDidEndEditing(&self, text_view: &UITextView);
44
45 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
46 #[deprecated]
47 #[optional]
48 #[unsafe(method(textView:shouldChangeTextInRange:replacementText:))]
49 #[unsafe(method_family = none)]
50 fn textView_shouldChangeTextInRange_replacementText(
51 &self,
52 text_view: &UITextView,
53 range: NSRange,
54 text: &NSString,
55 ) -> bool;
56
57 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
58 #[optional]
73 #[unsafe(method(textView:shouldChangeTextInRanges:replacementText:))]
74 #[unsafe(method_family = none)]
75 fn textView_shouldChangeTextInRanges_replacementText(
76 &self,
77 text_view: &UITextView,
78 ranges: &NSArray<NSValue>,
79 text: &NSString,
80 ) -> bool;
81
82 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
83 #[optional]
84 #[unsafe(method(textViewDidChange:))]
85 #[unsafe(method_family = none)]
86 fn textViewDidChange(&self, text_view: &UITextView);
87
88 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
89 #[optional]
90 #[unsafe(method(textViewDidChangeSelection:))]
91 #[unsafe(method_family = none)]
92 fn textViewDidChangeSelection(&self, text_view: &UITextView);
93
94 #[cfg(all(
95 feature = "UIMenu",
96 feature = "UIMenuElement",
97 feature = "UIResponder",
98 feature = "UIView"
99 ))]
100 #[deprecated]
113 #[optional]
114 #[unsafe(method(textView:editMenuForTextInRange:suggestedActions:))]
115 #[unsafe(method_family = none)]
116 fn textView_editMenuForTextInRange_suggestedActions(
117 &self,
118 text_view: &UITextView,
119 range: NSRange,
120 suggested_actions: &NSArray<UIMenuElement>,
121 ) -> Option<Retained<UIMenu>>;
122
123 #[cfg(all(
124 feature = "UIMenu",
125 feature = "UIMenuElement",
126 feature = "UIResponder",
127 feature = "UIView"
128 ))]
129 #[optional]
145 #[unsafe(method(textView:editMenuForTextInRanges:suggestedActions:))]
146 #[unsafe(method_family = none)]
147 fn textView_editMenuForTextInRanges_suggestedActions(
148 &self,
149 text_view: &UITextView,
150 ranges: &NSArray<NSValue>,
151 suggested_actions: &NSArray<UIMenuElement>,
152 ) -> Option<Retained<UIMenu>>;
153
154 #[cfg(all(
155 feature = "UIEditMenuInteraction",
156 feature = "UIResponder",
157 feature = "UIView"
158 ))]
159 #[optional]
166 #[unsafe(method(textView:willPresentEditMenuWithAnimator:))]
167 #[unsafe(method_family = none)]
168 fn textView_willPresentEditMenuWithAnimator(
169 &self,
170 text_view: &UITextView,
171 animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
172 );
173
174 #[cfg(all(
175 feature = "UIEditMenuInteraction",
176 feature = "UIResponder",
177 feature = "UIView"
178 ))]
179 #[optional]
186 #[unsafe(method(textView:willDismissEditMenuWithAnimator:))]
187 #[unsafe(method_family = none)]
188 fn textView_willDismissEditMenuWithAnimator(
189 &self,
190 text_view: &UITextView,
191 animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
192 );
193
194 #[cfg(all(
195 feature = "UIAction",
196 feature = "UIMenuElement",
197 feature = "UIResponder",
198 feature = "UITextItem",
199 feature = "UIView"
200 ))]
201 #[optional]
215 #[unsafe(method(textView:primaryActionForTextItem:defaultAction:))]
216 #[unsafe(method_family = none)]
217 fn textView_primaryActionForTextItem_defaultAction(
218 &self,
219 text_view: &UITextView,
220 text_item: &UITextItem,
221 default_action: &UIAction,
222 ) -> Option<Retained<UIAction>>;
223
224 #[cfg(all(
225 feature = "UIMenu",
226 feature = "UIMenuElement",
227 feature = "UIResponder",
228 feature = "UITextItem",
229 feature = "UIView"
230 ))]
231 #[optional]
244 #[unsafe(method(textView:menuConfigurationForTextItem:defaultMenu:))]
245 #[unsafe(method_family = none)]
246 fn textView_menuConfigurationForTextItem_defaultMenu(
247 &self,
248 text_view: &UITextView,
249 text_item: &UITextItem,
250 default_menu: &UIMenu,
251 ) -> Option<Retained<UITextItemMenuConfiguration>>;
252
253 #[cfg(all(
254 feature = "UIContextMenuInteraction",
255 feature = "UIResponder",
256 feature = "UITextItem",
257 feature = "UIView"
258 ))]
259 #[optional]
268 #[unsafe(method(textView:textItemMenuWillDisplayForTextItem:animator:))]
269 #[unsafe(method_family = none)]
270 fn textView_textItemMenuWillDisplayForTextItem_animator(
271 &self,
272 text_view: &UITextView,
273 text_item: &UITextItem,
274 animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>,
275 );
276
277 #[cfg(all(
278 feature = "UIContextMenuInteraction",
279 feature = "UIResponder",
280 feature = "UITextItem",
281 feature = "UIView"
282 ))]
283 #[optional]
292 #[unsafe(method(textView:textItemMenuWillEndForTextItem:animator:))]
293 #[unsafe(method_family = none)]
294 fn textView_textItemMenuWillEndForTextItem_animator(
295 &self,
296 text_view: &UITextView,
297 text_item: &UITextItem,
298 animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>,
299 );
300
301 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
302 #[optional]
307 #[unsafe(method(textViewWritingToolsWillBegin:))]
308 #[unsafe(method_family = none)]
309 fn textViewWritingToolsWillBegin(&self, text_view: &UITextView);
310
311 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
312 #[optional]
317 #[unsafe(method(textViewWritingToolsDidEnd:))]
318 #[unsafe(method_family = none)]
319 fn textViewWritingToolsDidEnd(&self, text_view: &UITextView);
320
321 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
322 #[optional]
331 #[unsafe(method(textView:writingToolsIgnoredRangesInEnclosingRange:))]
332 #[unsafe(method_family = none)]
333 fn textView_writingToolsIgnoredRangesInEnclosingRange(
334 &self,
335 text_view: &UITextView,
336 enclosing_range: NSRange,
337 ) -> Retained<NSArray<NSValue>>;
338
339 #[cfg(all(
340 feature = "UIResponder",
341 feature = "UITextItemInteraction",
342 feature = "UIView"
343 ))]
344 #[deprecated = "Replaced by primaryActionForTextItem: and menuConfigurationForTextItem: for additional customization options."]
345 #[optional]
346 #[unsafe(method(textView:shouldInteractWithURL:inRange:interaction:))]
347 #[unsafe(method_family = none)]
348 fn textView_shouldInteractWithURL_inRange_interaction(
349 &self,
350 text_view: &UITextView,
351 url: &NSURL,
352 character_range: NSRange,
353 interaction: UITextItemInteraction,
354 ) -> bool;
355
356 #[cfg(all(
357 feature = "NSTextAttachment",
358 feature = "UIResponder",
359 feature = "UITextItemInteraction",
360 feature = "UIView"
361 ))]
362 #[deprecated = "Replaced by primaryActionForTextItem: and menuConfigurationForTextItem: for additional customization options."]
363 #[optional]
364 #[unsafe(method(textView:shouldInteractWithTextAttachment:inRange:interaction:))]
365 #[unsafe(method_family = none)]
366 fn textView_shouldInteractWithTextAttachment_inRange_interaction(
367 &self,
368 text_view: &UITextView,
369 text_attachment: &NSTextAttachment,
370 character_range: NSRange,
371 interaction: UITextItemInteraction,
372 ) -> bool;
373
374 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
375 #[deprecated]
376 #[optional]
377 #[unsafe(method(textView:shouldInteractWithURL:inRange:))]
378 #[unsafe(method_family = none)]
379 fn textView_shouldInteractWithURL_inRange(
380 &self,
381 text_view: &UITextView,
382 url: &NSURL,
383 character_range: NSRange,
384 ) -> bool;
385
386 #[cfg(all(
387 feature = "NSTextAttachment",
388 feature = "UIResponder",
389 feature = "UIView"
390 ))]
391 #[deprecated]
392 #[optional]
393 #[unsafe(method(textView:shouldInteractWithTextAttachment:inRange:))]
394 #[unsafe(method_family = none)]
395 fn textView_shouldInteractWithTextAttachment_inRange(
396 &self,
397 text_view: &UITextView,
398 text_attachment: &NSTextAttachment,
399 character_range: NSRange,
400 ) -> bool;
401
402 #[cfg(all(
403 feature = "UIResponder",
404 feature = "UITextFormattingViewController",
405 feature = "UIView",
406 feature = "UIViewController"
407 ))]
408 #[optional]
413 #[unsafe(method(textView:willBeginFormattingWithViewController:))]
414 #[unsafe(method_family = none)]
415 fn textView_willBeginFormattingWithViewController(
416 &self,
417 text_view: &UITextView,
418 view_controller: &UITextFormattingViewController,
419 );
420
421 #[cfg(all(
422 feature = "UIResponder",
423 feature = "UITextFormattingViewController",
424 feature = "UIView",
425 feature = "UIViewController"
426 ))]
427 #[optional]
432 #[unsafe(method(textView:didBeginFormattingWithViewController:))]
433 #[unsafe(method_family = none)]
434 fn textView_didBeginFormattingWithViewController(
435 &self,
436 text_view: &UITextView,
437 view_controller: &UITextFormattingViewController,
438 );
439
440 #[cfg(all(
441 feature = "UIResponder",
442 feature = "UITextFormattingViewController",
443 feature = "UIView",
444 feature = "UIViewController"
445 ))]
446 #[optional]
451 #[unsafe(method(textView:willEndFormattingWithViewController:))]
452 #[unsafe(method_family = none)]
453 fn textView_willEndFormattingWithViewController(
454 &self,
455 text_view: &UITextView,
456 view_controller: &UITextFormattingViewController,
457 );
458
459 #[cfg(all(
460 feature = "UIResponder",
461 feature = "UITextFormattingViewController",
462 feature = "UIView",
463 feature = "UIViewController"
464 ))]
465 #[optional]
470 #[unsafe(method(textView:didEndFormattingWithViewController:))]
471 #[unsafe(method_family = none)]
472 fn textView_didEndFormattingWithViewController(
473 &self,
474 text_view: &UITextView,
475 view_controller: &UITextFormattingViewController,
476 );
477
478 #[cfg(all(
479 feature = "UIInputSuggestion",
480 feature = "UIResponder",
481 feature = "UIView"
482 ))]
483 #[optional]
489 #[unsafe(method(textView:insertInputSuggestion:))]
490 #[unsafe(method_family = none)]
491 fn textView_insertInputSuggestion(
492 &self,
493 text_view: &UITextView,
494 input_suggestion: &UIInputSuggestion,
495 );
496 }
497);
498
499#[repr(transparent)]
504#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
505pub struct UITextViewBorderStyle(pub NSInteger);
506impl UITextViewBorderStyle {
507 #[doc(alias = "UITextViewBorderStyleNone")]
509 pub const None: Self = Self(0);
510 #[doc(alias = "UITextViewBorderStyleRoundedRect")]
512 pub const RoundedRect: Self = Self(1);
513}
514
515unsafe impl Encode for UITextViewBorderStyle {
516 const ENCODING: Encoding = NSInteger::ENCODING;
517}
518
519unsafe impl RefEncode for UITextViewBorderStyle {
520 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
521}
522
523extern_class!(
524 #[unsafe(super(UIScrollView, UIView, UIResponder, NSObject))]
526 #[thread_kind = MainThreadOnly]
527 #[derive(Debug, PartialEq, Eq, Hash)]
528 #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
529 pub struct UITextView;
530);
531
532#[cfg(all(
533 feature = "UIResponder",
534 feature = "UIScrollView",
535 feature = "UIView",
536 feature = "objc2-quartz-core"
537))]
538#[cfg(not(target_os = "watchos"))]
539extern_conformance!(
540 unsafe impl CALayerDelegate for UITextView {}
541);
542
543#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
544extern_conformance!(
545 unsafe impl NSCoding for UITextView {}
546);
547
548#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
549extern_conformance!(
550 unsafe impl NSObjectProtocol for UITextView {}
551);
552
553#[cfg(all(
554 feature = "UIAppearance",
555 feature = "UIResponder",
556 feature = "UIScrollView",
557 feature = "UIView"
558))]
559extern_conformance!(
560 unsafe impl UIAppearance for UITextView {}
561);
562
563#[cfg(all(
564 feature = "UIAppearance",
565 feature = "UIResponder",
566 feature = "UIScrollView",
567 feature = "UIView"
568))]
569extern_conformance!(
570 unsafe impl UIAppearanceContainer for UITextView {}
571);
572
573#[cfg(all(
574 feature = "UIContentSizeCategoryAdjusting",
575 feature = "UIResponder",
576 feature = "UIScrollView",
577 feature = "UIView"
578))]
579extern_conformance!(
580 unsafe impl UIContentSizeCategoryAdjusting for UITextView {}
581);
582
583#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
584extern_conformance!(
585 unsafe impl UICoordinateSpace for UITextView {}
586);
587
588#[cfg(all(
589 feature = "UIDynamicBehavior",
590 feature = "UIResponder",
591 feature = "UIScrollView",
592 feature = "UIView"
593))]
594extern_conformance!(
595 unsafe impl UIDynamicItem for UITextView {}
596);
597
598#[cfg(all(
599 feature = "UIFocus",
600 feature = "UIResponder",
601 feature = "UIScrollView",
602 feature = "UIView"
603))]
604extern_conformance!(
605 unsafe impl UIFocusEnvironment for UITextView {}
606);
607
608#[cfg(all(
609 feature = "UIFocus",
610 feature = "UIResponder",
611 feature = "UIScrollView",
612 feature = "UIView"
613))]
614extern_conformance!(
615 unsafe impl UIFocusItem for UITextView {}
616);
617
618#[cfg(all(
619 feature = "UIFocus",
620 feature = "UIResponder",
621 feature = "UIScrollView",
622 feature = "UIView"
623))]
624extern_conformance!(
625 unsafe impl UIFocusItemContainer for UITextView {}
626);
627
628#[cfg(all(
629 feature = "UIFocus",
630 feature = "UIResponder",
631 feature = "UIScrollView",
632 feature = "UIView"
633))]
634extern_conformance!(
635 unsafe impl UIFocusItemScrollableContainer for UITextView {}
636);
637
638#[cfg(all(
639 feature = "UIResponder",
640 feature = "UIScrollView",
641 feature = "UITextInput",
642 feature = "UITextInputTraits",
643 feature = "UIView"
644))]
645extern_conformance!(
646 unsafe impl UIKeyInput for UITextView {}
647);
648
649#[cfg(all(
650 feature = "UILetterformAwareAdjusting",
651 feature = "UIResponder",
652 feature = "UIScrollView",
653 feature = "UIView"
654))]
655extern_conformance!(
656 unsafe impl UILetterformAwareAdjusting for UITextView {}
657);
658
659#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
660extern_conformance!(
661 unsafe impl UIResponderStandardEditActions for UITextView {}
662);
663
664#[cfg(all(
665 feature = "UIResponder",
666 feature = "UIScrollView",
667 feature = "UITextInput",
668 feature = "UITextInputTraits",
669 feature = "UIView"
670))]
671extern_conformance!(
672 unsafe impl UITextInput for UITextView {}
673);
674
675#[cfg(all(
676 feature = "UIResponder",
677 feature = "UIScrollView",
678 feature = "UITextInputTraits",
679 feature = "UIView"
680))]
681extern_conformance!(
682 unsafe impl UITextInputTraits for UITextView {}
683);
684
685#[cfg(all(
686 feature = "UIResponder",
687 feature = "UIScrollView",
688 feature = "UITraitCollection",
689 feature = "UIView"
690))]
691extern_conformance!(
692 unsafe impl UITraitEnvironment for UITextView {}
693);
694
695#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
696impl UITextView {
697 extern_methods!(
698 #[unsafe(method(delegate))]
699 #[unsafe(method_family = none)]
700 pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UITextViewDelegate>>>;
701
702 #[unsafe(method(setDelegate:))]
706 #[unsafe(method_family = none)]
707 pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn UITextViewDelegate>>);
708
709 #[unsafe(method(text))]
710 #[unsafe(method_family = none)]
711 pub fn text(&self) -> Retained<NSString>;
712
713 #[unsafe(method(setText:))]
717 #[unsafe(method_family = none)]
718 pub fn setText(&self, text: Option<&NSString>);
719
720 #[cfg(feature = "UIFont")]
721 #[unsafe(method(font))]
722 #[unsafe(method_family = none)]
723 pub fn font(&self) -> Option<Retained<UIFont>>;
724
725 #[cfg(feature = "UIFont")]
726 #[unsafe(method(setFont:))]
728 #[unsafe(method_family = none)]
729 pub fn setFont(&self, font: Option<&UIFont>);
730
731 #[cfg(feature = "UIColor")]
732 #[unsafe(method(textColor))]
733 #[unsafe(method_family = none)]
734 pub fn textColor(&self) -> Option<Retained<UIColor>>;
735
736 #[cfg(feature = "UIColor")]
737 #[unsafe(method(setTextColor:))]
739 #[unsafe(method_family = none)]
740 pub fn setTextColor(&self, text_color: Option<&UIColor>);
741
742 #[cfg(feature = "NSText")]
743 #[unsafe(method(textAlignment))]
744 #[unsafe(method_family = none)]
745 pub fn textAlignment(&self) -> NSTextAlignment;
746
747 #[cfg(feature = "NSText")]
748 #[unsafe(method(setTextAlignment:))]
750 #[unsafe(method_family = none)]
751 pub fn setTextAlignment(&self, text_alignment: NSTextAlignment);
752
753 #[deprecated]
755 #[unsafe(method(selectedRange))]
756 #[unsafe(method_family = none)]
757 pub fn selectedRange(&self) -> NSRange;
758
759 #[deprecated]
761 #[unsafe(method(setSelectedRange:))]
762 #[unsafe(method_family = none)]
763 pub fn setSelectedRange(&self, selected_range: NSRange);
764
765 #[unsafe(method(selectedRanges))]
767 #[unsafe(method_family = none)]
768 pub fn selectedRanges(&self) -> Retained<NSArray<NSValue>>;
769
770 #[unsafe(method(setSelectedRanges:))]
774 #[unsafe(method_family = none)]
775 pub fn setSelectedRanges(&self, selected_ranges: &NSArray<NSValue>);
776
777 #[unsafe(method(isEditable))]
778 #[unsafe(method_family = none)]
779 pub fn isEditable(&self) -> bool;
780
781 #[unsafe(method(setEditable:))]
783 #[unsafe(method_family = none)]
784 pub fn setEditable(&self, editable: bool);
785
786 #[unsafe(method(isSelectable))]
787 #[unsafe(method_family = none)]
788 pub fn isSelectable(&self) -> bool;
789
790 #[unsafe(method(setSelectable:))]
792 #[unsafe(method_family = none)]
793 pub fn setSelectable(&self, selectable: bool);
794
795 #[cfg(feature = "UIDataDetectors")]
796 #[unsafe(method(dataDetectorTypes))]
797 #[unsafe(method_family = none)]
798 pub fn dataDetectorTypes(&self) -> UIDataDetectorTypes;
799
800 #[cfg(feature = "UIDataDetectors")]
801 #[unsafe(method(setDataDetectorTypes:))]
803 #[unsafe(method_family = none)]
804 pub fn setDataDetectorTypes(&self, data_detector_types: UIDataDetectorTypes);
805
806 #[unsafe(method(allowsEditingTextAttributes))]
807 #[unsafe(method_family = none)]
808 pub fn allowsEditingTextAttributes(&self) -> bool;
809
810 #[unsafe(method(setAllowsEditingTextAttributes:))]
812 #[unsafe(method_family = none)]
813 pub fn setAllowsEditingTextAttributes(&self, allows_editing_text_attributes: bool);
814
815 #[unsafe(method(attributedText))]
816 #[unsafe(method_family = none)]
817 pub fn attributedText(&self) -> Retained<NSAttributedString>;
818
819 #[unsafe(method(setAttributedText:))]
823 #[unsafe(method_family = none)]
824 pub fn setAttributedText(&self, attributed_text: Option<&NSAttributedString>);
825
826 #[unsafe(method(typingAttributes))]
827 #[unsafe(method_family = none)]
828 pub fn typingAttributes(&self) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
829
830 #[unsafe(method(setTypingAttributes:))]
838 #[unsafe(method_family = none)]
839 pub unsafe fn setTypingAttributes(
840 &self,
841 typing_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
842 );
843
844 #[unsafe(method(scrollRangeToVisible:))]
845 #[unsafe(method_family = none)]
846 pub fn scrollRangeToVisible(&self, range: NSRange);
847
848 #[unsafe(method(inputView))]
849 #[unsafe(method_family = none)]
850 pub fn inputView(&self) -> Option<Retained<UIView>>;
851
852 #[unsafe(method(setInputView:))]
854 #[unsafe(method_family = none)]
855 pub fn setInputView(&self, input_view: Option<&UIView>);
856
857 #[unsafe(method(inputAccessoryView))]
858 #[unsafe(method_family = none)]
859 pub fn inputAccessoryView(&self) -> Option<Retained<UIView>>;
860
861 #[unsafe(method(setInputAccessoryView:))]
863 #[unsafe(method_family = none)]
864 pub fn setInputAccessoryView(&self, input_accessory_view: Option<&UIView>);
865
866 #[unsafe(method(clearsOnInsertion))]
867 #[unsafe(method_family = none)]
868 pub fn clearsOnInsertion(&self) -> bool;
869
870 #[unsafe(method(setClearsOnInsertion:))]
872 #[unsafe(method_family = none)]
873 pub fn setClearsOnInsertion(&self, clears_on_insertion: bool);
874
875 #[cfg(all(feature = "NSTextContainer", feature = "objc2-core-foundation"))]
876 #[unsafe(method(initWithFrame:textContainer:))]
877 #[unsafe(method_family = init)]
878 pub fn initWithFrame_textContainer(
879 this: Allocated<Self>,
880 frame: CGRect,
881 text_container: Option<&NSTextContainer>,
882 ) -> Retained<Self>;
883
884 #[unsafe(method(textViewUsingTextLayoutManager:))]
885 #[unsafe(method_family = none)]
886 pub fn textViewUsingTextLayoutManager(
887 using_text_layout_manager: bool,
888 mtm: MainThreadMarker,
889 ) -> Retained<Self>;
890
891 #[unsafe(method(initWithCoder:))]
895 #[unsafe(method_family = init)]
896 pub unsafe fn initWithCoder(
897 this: Allocated<Self>,
898 coder: &NSCoder,
899 ) -> Option<Retained<Self>>;
900
901 #[cfg(feature = "NSTextContainer")]
902 #[unsafe(method(textContainer))]
903 #[unsafe(method_family = none)]
904 pub fn textContainer(&self) -> Retained<NSTextContainer>;
905
906 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
907 #[unsafe(method(textContainerInset))]
908 #[unsafe(method_family = none)]
909 pub fn textContainerInset(&self) -> UIEdgeInsets;
910
911 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
912 #[unsafe(method(setTextContainerInset:))]
914 #[unsafe(method_family = none)]
915 pub fn setTextContainerInset(&self, text_container_inset: UIEdgeInsets);
916
917 #[cfg(feature = "NSTextLayoutManager")]
918 #[unsafe(method(textLayoutManager))]
919 #[unsafe(method_family = none)]
920 pub fn textLayoutManager(&self) -> Option<Retained<NSTextLayoutManager>>;
921
922 #[cfg(feature = "NSLayoutManager")]
923 #[unsafe(method(layoutManager))]
924 #[unsafe(method_family = none)]
925 pub fn layoutManager(&self) -> Retained<NSLayoutManager>;
926
927 #[cfg(feature = "NSTextStorage")]
928 #[unsafe(method(textStorage))]
929 #[unsafe(method_family = none)]
930 pub fn textStorage(&self) -> Retained<NSTextStorage>;
931
932 #[unsafe(method(linkTextAttributes))]
933 #[unsafe(method_family = none)]
934 pub fn linkTextAttributes(
935 &self,
936 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
937
938 #[unsafe(method(setLinkTextAttributes:))]
946 #[unsafe(method_family = none)]
947 pub unsafe fn setLinkTextAttributes(
948 &self,
949 link_text_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
950 );
951
952 #[unsafe(method(usesStandardTextScaling))]
953 #[unsafe(method_family = none)]
954 pub fn usesStandardTextScaling(&self) -> bool;
955
956 #[unsafe(method(setUsesStandardTextScaling:))]
958 #[unsafe(method_family = none)]
959 pub fn setUsesStandardTextScaling(&self, uses_standard_text_scaling: bool);
960
961 #[cfg(feature = "UIFindInteraction")]
962 #[unsafe(method(findInteraction))]
964 #[unsafe(method_family = none)]
965 pub fn findInteraction(&self) -> Option<Retained<UIFindInteraction>>;
966
967 #[unsafe(method(isFindInteractionEnabled))]
969 #[unsafe(method_family = none)]
970 pub fn isFindInteractionEnabled(&self) -> bool;
971
972 #[unsafe(method(setFindInteractionEnabled:))]
974 #[unsafe(method_family = none)]
975 pub fn setFindInteractionEnabled(&self, find_interaction_enabled: bool);
976
977 #[unsafe(method(borderStyle))]
979 #[unsafe(method_family = none)]
980 pub fn borderStyle(&self) -> UITextViewBorderStyle;
981
982 #[unsafe(method(setBorderStyle:))]
984 #[unsafe(method_family = none)]
985 pub fn setBorderStyle(&self, border_style: UITextViewBorderStyle);
986
987 #[unsafe(method(textHighlightAttributes))]
988 #[unsafe(method_family = none)]
989 pub fn textHighlightAttributes(
990 &self,
991 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
992
993 #[unsafe(method(setTextHighlightAttributes:))]
1001 #[unsafe(method_family = none)]
1002 pub unsafe fn setTextHighlightAttributes(
1003 &self,
1004 text_highlight_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
1005 );
1006
1007 #[cfg(all(feature = "NSTextRange", feature = "objc2-core-foundation"))]
1008 #[unsafe(method(drawTextHighlightBackgroundForTextRange:origin:))]
1009 #[unsafe(method_family = none)]
1010 pub fn drawTextHighlightBackgroundForTextRange_origin(
1011 &self,
1012 text_range: &NSTextRange,
1013 origin: CGPoint,
1014 );
1015
1016 #[unsafe(method(isWritingToolsActive))]
1024 #[unsafe(method_family = none)]
1025 pub fn isWritingToolsActive(&self) -> bool;
1026
1027 #[cfg(feature = "UITextInputTraits")]
1028 #[unsafe(method(writingToolsBehavior))]
1029 #[unsafe(method_family = none)]
1030 pub fn writingToolsBehavior(&self) -> UIWritingToolsBehavior;
1031
1032 #[cfg(feature = "UITextInputTraits")]
1033 #[unsafe(method(setWritingToolsBehavior:))]
1035 #[unsafe(method_family = none)]
1036 pub fn setWritingToolsBehavior(&self, writing_tools_behavior: UIWritingToolsBehavior);
1037
1038 #[cfg(feature = "UITextInputTraits")]
1039 #[unsafe(method(allowedWritingToolsResultOptions))]
1040 #[unsafe(method_family = none)]
1041 pub fn allowedWritingToolsResultOptions(&self) -> UIWritingToolsResultOptions;
1042
1043 #[cfg(feature = "UITextInputTraits")]
1044 #[unsafe(method(setAllowedWritingToolsResultOptions:))]
1046 #[unsafe(method_family = none)]
1047 pub fn setAllowedWritingToolsResultOptions(
1048 &self,
1049 allowed_writing_tools_result_options: UIWritingToolsResultOptions,
1050 );
1051
1052 #[unsafe(method(subclassForWritingToolsCoordinator))]
1053 #[unsafe(method_family = none)]
1054 pub fn subclassForWritingToolsCoordinator(&self) -> &'static AnyClass;
1055
1056 #[cfg(feature = "UIWritingToolsCoordinator")]
1057 #[unsafe(method(writingToolsCoordinator))]
1058 #[unsafe(method_family = none)]
1059 pub fn writingToolsCoordinator(&self) -> Retained<UIWritingToolsCoordinator>;
1060
1061 #[cfg(feature = "UITextFormattingViewControllerConfiguration")]
1062 #[unsafe(method(textFormattingConfiguration))]
1068 #[unsafe(method_family = none)]
1069 pub fn textFormattingConfiguration(
1070 &self,
1071 ) -> Option<Retained<UITextFormattingViewControllerConfiguration>>;
1072
1073 #[cfg(feature = "UITextFormattingViewControllerConfiguration")]
1074 #[unsafe(method(setTextFormattingConfiguration:))]
1078 #[unsafe(method_family = none)]
1079 pub fn setTextFormattingConfiguration(
1080 &self,
1081 text_formatting_configuration: Option<&UITextFormattingViewControllerConfiguration>,
1082 );
1083 );
1084}
1085
1086#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1088impl UITextView {
1089 extern_methods!(
1090 #[cfg(feature = "objc2-core-foundation")]
1091 #[unsafe(method(initWithFrame:))]
1092 #[unsafe(method_family = init)]
1093 pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
1094
1095 #[unsafe(method(init))]
1096 #[unsafe(method_family = init)]
1097 pub fn init(this: Allocated<Self>) -> Retained<Self>;
1098 );
1099}
1100
1101#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1103impl UITextView {
1104 extern_methods!(
1105 #[unsafe(method(new))]
1106 #[unsafe(method_family = new)]
1107 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
1108 );
1109}
1110
1111#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1112impl UITextView {
1113 extern_methods!();
1114}
1115
1116#[cfg(all(
1117 feature = "UIFindInteraction",
1118 feature = "UIResponder",
1119 feature = "UIScrollView",
1120 feature = "UIView"
1121))]
1122extern_conformance!(
1123 unsafe impl UIFindInteractionDelegate for UITextView {}
1124);
1125
1126#[cfg(all(
1127 feature = "UIResponder",
1128 feature = "UIScrollView",
1129 feature = "UITextDragging",
1130 feature = "UITextInput",
1131 feature = "UITextInputTraits",
1132 feature = "UIView"
1133))]
1134extern_conformance!(
1135 unsafe impl UITextDraggable for UITextView {}
1136);
1137
1138#[cfg(all(
1139 feature = "UIPasteConfigurationSupporting",
1140 feature = "UIResponder",
1141 feature = "UIScrollView",
1142 feature = "UITextDropping",
1143 feature = "UITextInput",
1144 feature = "UITextInputTraits",
1145 feature = "UITextPasteConfigurationSupporting",
1146 feature = "UIView"
1147))]
1148extern_conformance!(
1149 unsafe impl UITextDroppable for UITextView {}
1150);
1151
1152#[cfg(all(
1153 feature = "UIPasteConfigurationSupporting",
1154 feature = "UIResponder",
1155 feature = "UIScrollView",
1156 feature = "UITextPasteConfigurationSupporting",
1157 feature = "UIView"
1158))]
1159extern_conformance!(
1160 unsafe impl UITextPasteConfigurationSupporting for UITextView {}
1161);
1162
1163#[cfg(all(
1164 feature = "UIResponder",
1165 feature = "UIScrollView",
1166 feature = "UITextSearching",
1167 feature = "UIView"
1168))]
1169extern_conformance!(
1170 unsafe impl UITextSearching for UITextView {}
1171);
1172
1173#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1175impl UITextView {
1176 extern_methods!(
1177 #[unsafe(method(interactionState))]
1178 #[unsafe(method_family = none)]
1179 pub fn interactionState(&self) -> Retained<AnyObject>;
1180
1181 #[unsafe(method(setInteractionState:))]
1189 #[unsafe(method_family = none)]
1190 pub unsafe fn setInteractionState(&self, interaction_state: &AnyObject);
1191 );
1192}
1193
1194extern "C" {
1195 pub static UITextViewTextDidBeginEditingNotification: &'static NSNotificationName;
1197}
1198
1199extern "C" {
1200 pub static UITextViewTextDidChangeNotification: &'static NSNotificationName;
1202}
1203
1204extern "C" {
1205 pub static UITextViewTextDidEndEditingNotification: &'static NSNotificationName;
1207}