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 unsafe 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 unsafe 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 unsafe 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 unsafe fn textViewDidEndEditing(&self, text_view: &UITextView);
44
45 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
46 #[optional]
47 #[unsafe(method(textView:shouldChangeTextInRange:replacementText:))]
48 #[unsafe(method_family = none)]
49 unsafe fn textView_shouldChangeTextInRange_replacementText(
50 &self,
51 text_view: &UITextView,
52 range: NSRange,
53 text: &NSString,
54 ) -> bool;
55
56 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
57 #[optional]
58 #[unsafe(method(textViewDidChange:))]
59 #[unsafe(method_family = none)]
60 unsafe fn textViewDidChange(&self, text_view: &UITextView);
61
62 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
63 #[optional]
64 #[unsafe(method(textViewDidChangeSelection:))]
65 #[unsafe(method_family = none)]
66 unsafe fn textViewDidChangeSelection(&self, text_view: &UITextView);
67
68 #[cfg(all(
69 feature = "UIMenu",
70 feature = "UIMenuElement",
71 feature = "UIResponder",
72 feature = "UIView"
73 ))]
74 #[optional]
87 #[unsafe(method(textView:editMenuForTextInRange:suggestedActions:))]
88 #[unsafe(method_family = none)]
89 unsafe fn textView_editMenuForTextInRange_suggestedActions(
90 &self,
91 text_view: &UITextView,
92 range: NSRange,
93 suggested_actions: &NSArray<UIMenuElement>,
94 ) -> Option<Retained<UIMenu>>;
95
96 #[cfg(all(
97 feature = "UIEditMenuInteraction",
98 feature = "UIResponder",
99 feature = "UIView"
100 ))]
101 #[optional]
108 #[unsafe(method(textView:willPresentEditMenuWithAnimator:))]
109 #[unsafe(method_family = none)]
110 unsafe fn textView_willPresentEditMenuWithAnimator(
111 &self,
112 text_view: &UITextView,
113 animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
114 );
115
116 #[cfg(all(
117 feature = "UIEditMenuInteraction",
118 feature = "UIResponder",
119 feature = "UIView"
120 ))]
121 #[optional]
128 #[unsafe(method(textView:willDismissEditMenuWithAnimator:))]
129 #[unsafe(method_family = none)]
130 unsafe fn textView_willDismissEditMenuWithAnimator(
131 &self,
132 text_view: &UITextView,
133 animator: &ProtocolObject<dyn UIEditMenuInteractionAnimating>,
134 );
135
136 #[cfg(all(
137 feature = "UIAction",
138 feature = "UIMenuElement",
139 feature = "UIResponder",
140 feature = "UITextItem",
141 feature = "UIView"
142 ))]
143 #[optional]
157 #[unsafe(method(textView:primaryActionForTextItem:defaultAction:))]
158 #[unsafe(method_family = none)]
159 unsafe fn textView_primaryActionForTextItem_defaultAction(
160 &self,
161 text_view: &UITextView,
162 text_item: &UITextItem,
163 default_action: &UIAction,
164 ) -> Option<Retained<UIAction>>;
165
166 #[cfg(all(
167 feature = "UIMenu",
168 feature = "UIMenuElement",
169 feature = "UIResponder",
170 feature = "UITextItem",
171 feature = "UIView"
172 ))]
173 #[optional]
186 #[unsafe(method(textView:menuConfigurationForTextItem:defaultMenu:))]
187 #[unsafe(method_family = none)]
188 unsafe fn textView_menuConfigurationForTextItem_defaultMenu(
189 &self,
190 text_view: &UITextView,
191 text_item: &UITextItem,
192 default_menu: &UIMenu,
193 ) -> Option<Retained<UITextItemMenuConfiguration>>;
194
195 #[cfg(all(
196 feature = "UIContextMenuInteraction",
197 feature = "UIResponder",
198 feature = "UITextItem",
199 feature = "UIView"
200 ))]
201 #[optional]
210 #[unsafe(method(textView:textItemMenuWillDisplayForTextItem:animator:))]
211 #[unsafe(method_family = none)]
212 unsafe fn textView_textItemMenuWillDisplayForTextItem_animator(
213 &self,
214 text_view: &UITextView,
215 text_item: &UITextItem,
216 animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>,
217 );
218
219 #[cfg(all(
220 feature = "UIContextMenuInteraction",
221 feature = "UIResponder",
222 feature = "UITextItem",
223 feature = "UIView"
224 ))]
225 #[optional]
234 #[unsafe(method(textView:textItemMenuWillEndForTextItem:animator:))]
235 #[unsafe(method_family = none)]
236 unsafe fn textView_textItemMenuWillEndForTextItem_animator(
237 &self,
238 text_view: &UITextView,
239 text_item: &UITextItem,
240 animator: &ProtocolObject<dyn UIContextMenuInteractionAnimating>,
241 );
242
243 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
244 #[optional]
249 #[unsafe(method(textViewWritingToolsWillBegin:))]
250 #[unsafe(method_family = none)]
251 unsafe fn textViewWritingToolsWillBegin(&self, text_view: &UITextView);
252
253 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
254 #[optional]
259 #[unsafe(method(textViewWritingToolsDidEnd:))]
260 #[unsafe(method_family = none)]
261 unsafe fn textViewWritingToolsDidEnd(&self, text_view: &UITextView);
262
263 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
264 #[optional]
273 #[unsafe(method(textView:writingToolsIgnoredRangesInEnclosingRange:))]
274 #[unsafe(method_family = none)]
275 unsafe fn textView_writingToolsIgnoredRangesInEnclosingRange(
276 &self,
277 text_view: &UITextView,
278 enclosing_range: NSRange,
279 ) -> Retained<NSArray<NSValue>>;
280
281 #[cfg(all(
282 feature = "UIResponder",
283 feature = "UITextItemInteraction",
284 feature = "UIView"
285 ))]
286 #[deprecated = "Replaced by primaryActionForTextItem: and menuConfigurationForTextItem: for additional customization options."]
287 #[optional]
288 #[unsafe(method(textView:shouldInteractWithURL:inRange:interaction:))]
289 #[unsafe(method_family = none)]
290 unsafe fn textView_shouldInteractWithURL_inRange_interaction(
291 &self,
292 text_view: &UITextView,
293 url: &NSURL,
294 character_range: NSRange,
295 interaction: UITextItemInteraction,
296 ) -> bool;
297
298 #[cfg(all(
299 feature = "NSTextAttachment",
300 feature = "UIResponder",
301 feature = "UITextItemInteraction",
302 feature = "UIView"
303 ))]
304 #[deprecated = "Replaced by primaryActionForTextItem: and menuConfigurationForTextItem: for additional customization options."]
305 #[optional]
306 #[unsafe(method(textView:shouldInteractWithTextAttachment:inRange:interaction:))]
307 #[unsafe(method_family = none)]
308 unsafe fn textView_shouldInteractWithTextAttachment_inRange_interaction(
309 &self,
310 text_view: &UITextView,
311 text_attachment: &NSTextAttachment,
312 character_range: NSRange,
313 interaction: UITextItemInteraction,
314 ) -> bool;
315
316 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
317 #[deprecated]
318 #[optional]
319 #[unsafe(method(textView:shouldInteractWithURL:inRange:))]
320 #[unsafe(method_family = none)]
321 unsafe fn textView_shouldInteractWithURL_inRange(
322 &self,
323 text_view: &UITextView,
324 url: &NSURL,
325 character_range: NSRange,
326 ) -> bool;
327
328 #[cfg(all(
329 feature = "NSTextAttachment",
330 feature = "UIResponder",
331 feature = "UIView"
332 ))]
333 #[deprecated]
334 #[optional]
335 #[unsafe(method(textView:shouldInteractWithTextAttachment:inRange:))]
336 #[unsafe(method_family = none)]
337 unsafe fn textView_shouldInteractWithTextAttachment_inRange(
338 &self,
339 text_view: &UITextView,
340 text_attachment: &NSTextAttachment,
341 character_range: NSRange,
342 ) -> bool;
343
344 #[cfg(all(
345 feature = "UIResponder",
346 feature = "UITextFormattingViewController",
347 feature = "UIView",
348 feature = "UIViewController"
349 ))]
350 #[optional]
355 #[unsafe(method(textView:willBeginFormattingWithViewController:))]
356 #[unsafe(method_family = none)]
357 unsafe fn textView_willBeginFormattingWithViewController(
358 &self,
359 text_view: &UITextView,
360 view_controller: &UITextFormattingViewController,
361 );
362
363 #[cfg(all(
364 feature = "UIResponder",
365 feature = "UITextFormattingViewController",
366 feature = "UIView",
367 feature = "UIViewController"
368 ))]
369 #[optional]
374 #[unsafe(method(textView:didBeginFormattingWithViewController:))]
375 #[unsafe(method_family = none)]
376 unsafe fn textView_didBeginFormattingWithViewController(
377 &self,
378 text_view: &UITextView,
379 view_controller: &UITextFormattingViewController,
380 );
381
382 #[cfg(all(
383 feature = "UIResponder",
384 feature = "UITextFormattingViewController",
385 feature = "UIView",
386 feature = "UIViewController"
387 ))]
388 #[optional]
393 #[unsafe(method(textView:willEndFormattingWithViewController:))]
394 #[unsafe(method_family = none)]
395 unsafe fn textView_willEndFormattingWithViewController(
396 &self,
397 text_view: &UITextView,
398 view_controller: &UITextFormattingViewController,
399 );
400
401 #[cfg(all(
402 feature = "UIResponder",
403 feature = "UITextFormattingViewController",
404 feature = "UIView",
405 feature = "UIViewController"
406 ))]
407 #[optional]
412 #[unsafe(method(textView:didEndFormattingWithViewController:))]
413 #[unsafe(method_family = none)]
414 unsafe fn textView_didEndFormattingWithViewController(
415 &self,
416 text_view: &UITextView,
417 view_controller: &UITextFormattingViewController,
418 );
419
420 #[cfg(all(
421 feature = "UIInputSuggestion",
422 feature = "UIResponder",
423 feature = "UIView"
424 ))]
425 #[optional]
431 #[unsafe(method(textView:insertInputSuggestion:))]
432 #[unsafe(method_family = none)]
433 unsafe fn textView_insertInputSuggestion(
434 &self,
435 text_view: &UITextView,
436 input_suggestion: &UIInputSuggestion,
437 );
438 }
439);
440
441#[repr(transparent)]
446#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
447pub struct UITextViewBorderStyle(pub NSInteger);
448impl UITextViewBorderStyle {
449 #[doc(alias = "UITextViewBorderStyleNone")]
451 pub const None: Self = Self(0);
452 #[doc(alias = "UITextViewBorderStyleRoundedRect")]
454 pub const RoundedRect: Self = Self(1);
455}
456
457unsafe impl Encode for UITextViewBorderStyle {
458 const ENCODING: Encoding = NSInteger::ENCODING;
459}
460
461unsafe impl RefEncode for UITextViewBorderStyle {
462 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
463}
464
465extern_class!(
466 #[unsafe(super(UIScrollView, UIView, UIResponder, NSObject))]
468 #[thread_kind = MainThreadOnly]
469 #[derive(Debug, PartialEq, Eq, Hash)]
470 #[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
471 pub struct UITextView;
472);
473
474#[cfg(all(
475 feature = "UIResponder",
476 feature = "UIScrollView",
477 feature = "UIView",
478 feature = "objc2-quartz-core"
479))]
480#[cfg(not(target_os = "watchos"))]
481extern_conformance!(
482 unsafe impl CALayerDelegate for UITextView {}
483);
484
485#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
486extern_conformance!(
487 unsafe impl NSCoding for UITextView {}
488);
489
490#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
491extern_conformance!(
492 unsafe impl NSObjectProtocol for UITextView {}
493);
494
495#[cfg(all(
496 feature = "UIAppearance",
497 feature = "UIResponder",
498 feature = "UIScrollView",
499 feature = "UIView"
500))]
501extern_conformance!(
502 unsafe impl UIAppearance for UITextView {}
503);
504
505#[cfg(all(
506 feature = "UIAppearance",
507 feature = "UIResponder",
508 feature = "UIScrollView",
509 feature = "UIView"
510))]
511extern_conformance!(
512 unsafe impl UIAppearanceContainer for UITextView {}
513);
514
515#[cfg(all(
516 feature = "UIContentSizeCategoryAdjusting",
517 feature = "UIResponder",
518 feature = "UIScrollView",
519 feature = "UIView"
520))]
521extern_conformance!(
522 unsafe impl UIContentSizeCategoryAdjusting for UITextView {}
523);
524
525#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
526extern_conformance!(
527 unsafe impl UICoordinateSpace for UITextView {}
528);
529
530#[cfg(all(
531 feature = "UIDynamicBehavior",
532 feature = "UIResponder",
533 feature = "UIScrollView",
534 feature = "UIView"
535))]
536extern_conformance!(
537 unsafe impl UIDynamicItem for UITextView {}
538);
539
540#[cfg(all(
541 feature = "UIFocus",
542 feature = "UIResponder",
543 feature = "UIScrollView",
544 feature = "UIView"
545))]
546extern_conformance!(
547 unsafe impl UIFocusEnvironment for UITextView {}
548);
549
550#[cfg(all(
551 feature = "UIFocus",
552 feature = "UIResponder",
553 feature = "UIScrollView",
554 feature = "UIView"
555))]
556extern_conformance!(
557 unsafe impl UIFocusItem for UITextView {}
558);
559
560#[cfg(all(
561 feature = "UIFocus",
562 feature = "UIResponder",
563 feature = "UIScrollView",
564 feature = "UIView"
565))]
566extern_conformance!(
567 unsafe impl UIFocusItemContainer for UITextView {}
568);
569
570#[cfg(all(
571 feature = "UIFocus",
572 feature = "UIResponder",
573 feature = "UIScrollView",
574 feature = "UIView"
575))]
576extern_conformance!(
577 unsafe impl UIFocusItemScrollableContainer for UITextView {}
578);
579
580#[cfg(all(
581 feature = "UIResponder",
582 feature = "UIScrollView",
583 feature = "UITextInput",
584 feature = "UITextInputTraits",
585 feature = "UIView"
586))]
587extern_conformance!(
588 unsafe impl UIKeyInput for UITextView {}
589);
590
591#[cfg(all(
592 feature = "UILetterformAwareAdjusting",
593 feature = "UIResponder",
594 feature = "UIScrollView",
595 feature = "UIView"
596))]
597extern_conformance!(
598 unsafe impl UILetterformAwareAdjusting for UITextView {}
599);
600
601#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
602extern_conformance!(
603 unsafe impl UIResponderStandardEditActions for UITextView {}
604);
605
606#[cfg(all(
607 feature = "UIResponder",
608 feature = "UIScrollView",
609 feature = "UITextInput",
610 feature = "UITextInputTraits",
611 feature = "UIView"
612))]
613extern_conformance!(
614 unsafe impl UITextInput for UITextView {}
615);
616
617#[cfg(all(
618 feature = "UIResponder",
619 feature = "UIScrollView",
620 feature = "UITextInputTraits",
621 feature = "UIView"
622))]
623extern_conformance!(
624 unsafe impl UITextInputTraits for UITextView {}
625);
626
627#[cfg(all(
628 feature = "UIResponder",
629 feature = "UIScrollView",
630 feature = "UITraitCollection",
631 feature = "UIView"
632))]
633extern_conformance!(
634 unsafe impl UITraitEnvironment for UITextView {}
635);
636
637#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
638impl UITextView {
639 extern_methods!(
640 #[unsafe(method(delegate))]
641 #[unsafe(method_family = none)]
642 pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UITextViewDelegate>>>;
643
644 #[unsafe(method(setDelegate:))]
647 #[unsafe(method_family = none)]
648 pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn UITextViewDelegate>>);
649
650 #[unsafe(method(text))]
651 #[unsafe(method_family = none)]
652 pub unsafe fn text(&self) -> Retained<NSString>;
653
654 #[unsafe(method(setText:))]
656 #[unsafe(method_family = none)]
657 pub unsafe fn setText(&self, text: Option<&NSString>);
658
659 #[cfg(feature = "UIFont")]
660 #[unsafe(method(font))]
661 #[unsafe(method_family = none)]
662 pub unsafe fn font(&self) -> Option<Retained<UIFont>>;
663
664 #[cfg(feature = "UIFont")]
665 #[unsafe(method(setFont:))]
667 #[unsafe(method_family = none)]
668 pub unsafe fn setFont(&self, font: Option<&UIFont>);
669
670 #[cfg(feature = "UIColor")]
671 #[unsafe(method(textColor))]
672 #[unsafe(method_family = none)]
673 pub unsafe fn textColor(&self) -> Option<Retained<UIColor>>;
674
675 #[cfg(feature = "UIColor")]
676 #[unsafe(method(setTextColor:))]
678 #[unsafe(method_family = none)]
679 pub unsafe fn setTextColor(&self, text_color: Option<&UIColor>);
680
681 #[cfg(feature = "NSText")]
682 #[unsafe(method(textAlignment))]
683 #[unsafe(method_family = none)]
684 pub unsafe fn textAlignment(&self) -> NSTextAlignment;
685
686 #[cfg(feature = "NSText")]
687 #[unsafe(method(setTextAlignment:))]
689 #[unsafe(method_family = none)]
690 pub unsafe fn setTextAlignment(&self, text_alignment: NSTextAlignment);
691
692 #[unsafe(method(selectedRange))]
693 #[unsafe(method_family = none)]
694 pub unsafe fn selectedRange(&self) -> NSRange;
695
696 #[unsafe(method(setSelectedRange:))]
698 #[unsafe(method_family = none)]
699 pub unsafe fn setSelectedRange(&self, selected_range: NSRange);
700
701 #[unsafe(method(isEditable))]
702 #[unsafe(method_family = none)]
703 pub unsafe fn isEditable(&self) -> bool;
704
705 #[unsafe(method(setEditable:))]
707 #[unsafe(method_family = none)]
708 pub unsafe fn setEditable(&self, editable: bool);
709
710 #[unsafe(method(isSelectable))]
711 #[unsafe(method_family = none)]
712 pub unsafe fn isSelectable(&self) -> bool;
713
714 #[unsafe(method(setSelectable:))]
716 #[unsafe(method_family = none)]
717 pub unsafe fn setSelectable(&self, selectable: bool);
718
719 #[cfg(feature = "UIDataDetectors")]
720 #[unsafe(method(dataDetectorTypes))]
721 #[unsafe(method_family = none)]
722 pub unsafe fn dataDetectorTypes(&self) -> UIDataDetectorTypes;
723
724 #[cfg(feature = "UIDataDetectors")]
725 #[unsafe(method(setDataDetectorTypes:))]
727 #[unsafe(method_family = none)]
728 pub unsafe fn setDataDetectorTypes(&self, data_detector_types: UIDataDetectorTypes);
729
730 #[unsafe(method(allowsEditingTextAttributes))]
731 #[unsafe(method_family = none)]
732 pub unsafe fn allowsEditingTextAttributes(&self) -> bool;
733
734 #[unsafe(method(setAllowsEditingTextAttributes:))]
736 #[unsafe(method_family = none)]
737 pub unsafe fn setAllowsEditingTextAttributes(&self, allows_editing_text_attributes: bool);
738
739 #[unsafe(method(attributedText))]
740 #[unsafe(method_family = none)]
741 pub unsafe fn attributedText(&self) -> Retained<NSAttributedString>;
742
743 #[unsafe(method(setAttributedText:))]
745 #[unsafe(method_family = none)]
746 pub unsafe fn setAttributedText(&self, attributed_text: Option<&NSAttributedString>);
747
748 #[unsafe(method(typingAttributes))]
749 #[unsafe(method_family = none)]
750 pub unsafe fn typingAttributes(
751 &self,
752 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
753
754 #[unsafe(method(setTypingAttributes:))]
756 #[unsafe(method_family = none)]
757 pub unsafe fn setTypingAttributes(
758 &self,
759 typing_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
760 );
761
762 #[unsafe(method(scrollRangeToVisible:))]
763 #[unsafe(method_family = none)]
764 pub unsafe fn scrollRangeToVisible(&self, range: NSRange);
765
766 #[unsafe(method(inputView))]
767 #[unsafe(method_family = none)]
768 pub unsafe fn inputView(&self) -> Option<Retained<UIView>>;
769
770 #[unsafe(method(setInputView:))]
772 #[unsafe(method_family = none)]
773 pub unsafe fn setInputView(&self, input_view: Option<&UIView>);
774
775 #[unsafe(method(inputAccessoryView))]
776 #[unsafe(method_family = none)]
777 pub unsafe fn inputAccessoryView(&self) -> Option<Retained<UIView>>;
778
779 #[unsafe(method(setInputAccessoryView:))]
781 #[unsafe(method_family = none)]
782 pub unsafe fn setInputAccessoryView(&self, input_accessory_view: Option<&UIView>);
783
784 #[unsafe(method(clearsOnInsertion))]
785 #[unsafe(method_family = none)]
786 pub unsafe fn clearsOnInsertion(&self) -> bool;
787
788 #[unsafe(method(setClearsOnInsertion:))]
790 #[unsafe(method_family = none)]
791 pub unsafe fn setClearsOnInsertion(&self, clears_on_insertion: bool);
792
793 #[cfg(all(feature = "NSTextContainer", feature = "objc2-core-foundation"))]
794 #[unsafe(method(initWithFrame:textContainer:))]
795 #[unsafe(method_family = init)]
796 pub unsafe fn initWithFrame_textContainer(
797 this: Allocated<Self>,
798 frame: CGRect,
799 text_container: Option<&NSTextContainer>,
800 ) -> Retained<Self>;
801
802 #[unsafe(method(textViewUsingTextLayoutManager:))]
803 #[unsafe(method_family = none)]
804 pub unsafe fn textViewUsingTextLayoutManager(
805 using_text_layout_manager: bool,
806 mtm: MainThreadMarker,
807 ) -> Retained<Self>;
808
809 #[unsafe(method(initWithCoder:))]
810 #[unsafe(method_family = init)]
811 pub unsafe fn initWithCoder(
812 this: Allocated<Self>,
813 coder: &NSCoder,
814 ) -> Option<Retained<Self>>;
815
816 #[cfg(feature = "NSTextContainer")]
817 #[unsafe(method(textContainer))]
818 #[unsafe(method_family = none)]
819 pub unsafe fn textContainer(&self) -> Retained<NSTextContainer>;
820
821 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
822 #[unsafe(method(textContainerInset))]
823 #[unsafe(method_family = none)]
824 pub unsafe fn textContainerInset(&self) -> UIEdgeInsets;
825
826 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
827 #[unsafe(method(setTextContainerInset:))]
829 #[unsafe(method_family = none)]
830 pub unsafe fn setTextContainerInset(&self, text_container_inset: UIEdgeInsets);
831
832 #[cfg(feature = "NSTextLayoutManager")]
833 #[unsafe(method(textLayoutManager))]
834 #[unsafe(method_family = none)]
835 pub unsafe fn textLayoutManager(&self) -> Option<Retained<NSTextLayoutManager>>;
836
837 #[cfg(feature = "NSLayoutManager")]
838 #[unsafe(method(layoutManager))]
839 #[unsafe(method_family = none)]
840 pub unsafe fn layoutManager(&self) -> Retained<NSLayoutManager>;
841
842 #[cfg(feature = "NSTextStorage")]
843 #[unsafe(method(textStorage))]
844 #[unsafe(method_family = none)]
845 pub unsafe fn textStorage(&self) -> Retained<NSTextStorage>;
846
847 #[unsafe(method(linkTextAttributes))]
848 #[unsafe(method_family = none)]
849 pub unsafe fn linkTextAttributes(
850 &self,
851 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
852
853 #[unsafe(method(setLinkTextAttributes:))]
855 #[unsafe(method_family = none)]
856 pub unsafe fn setLinkTextAttributes(
857 &self,
858 link_text_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
859 );
860
861 #[unsafe(method(usesStandardTextScaling))]
862 #[unsafe(method_family = none)]
863 pub unsafe fn usesStandardTextScaling(&self) -> bool;
864
865 #[unsafe(method(setUsesStandardTextScaling:))]
867 #[unsafe(method_family = none)]
868 pub unsafe fn setUsesStandardTextScaling(&self, uses_standard_text_scaling: bool);
869
870 #[cfg(feature = "UIFindInteraction")]
871 #[unsafe(method(findInteraction))]
873 #[unsafe(method_family = none)]
874 pub unsafe fn findInteraction(&self) -> Option<Retained<UIFindInteraction>>;
875
876 #[unsafe(method(isFindInteractionEnabled))]
878 #[unsafe(method_family = none)]
879 pub unsafe fn isFindInteractionEnabled(&self) -> bool;
880
881 #[unsafe(method(setFindInteractionEnabled:))]
883 #[unsafe(method_family = none)]
884 pub unsafe fn setFindInteractionEnabled(&self, find_interaction_enabled: bool);
885
886 #[unsafe(method(borderStyle))]
888 #[unsafe(method_family = none)]
889 pub unsafe fn borderStyle(&self) -> UITextViewBorderStyle;
890
891 #[unsafe(method(setBorderStyle:))]
893 #[unsafe(method_family = none)]
894 pub unsafe fn setBorderStyle(&self, border_style: UITextViewBorderStyle);
895
896 #[unsafe(method(textHighlightAttributes))]
897 #[unsafe(method_family = none)]
898 pub unsafe fn textHighlightAttributes(
899 &self,
900 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
901
902 #[unsafe(method(setTextHighlightAttributes:))]
904 #[unsafe(method_family = none)]
905 pub unsafe fn setTextHighlightAttributes(
906 &self,
907 text_highlight_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
908 );
909
910 #[cfg(all(feature = "NSTextRange", feature = "objc2-core-foundation"))]
911 #[unsafe(method(drawTextHighlightBackgroundForTextRange:origin:))]
912 #[unsafe(method_family = none)]
913 pub unsafe fn drawTextHighlightBackgroundForTextRange_origin(
914 &self,
915 text_range: &NSTextRange,
916 origin: CGPoint,
917 );
918
919 #[unsafe(method(isWritingToolsActive))]
927 #[unsafe(method_family = none)]
928 pub unsafe fn isWritingToolsActive(&self) -> bool;
929
930 #[cfg(feature = "UITextInputTraits")]
931 #[unsafe(method(writingToolsBehavior))]
932 #[unsafe(method_family = none)]
933 pub unsafe fn writingToolsBehavior(&self) -> UIWritingToolsBehavior;
934
935 #[cfg(feature = "UITextInputTraits")]
936 #[unsafe(method(setWritingToolsBehavior:))]
938 #[unsafe(method_family = none)]
939 pub unsafe fn setWritingToolsBehavior(
940 &self,
941 writing_tools_behavior: UIWritingToolsBehavior,
942 );
943
944 #[cfg(feature = "UITextInputTraits")]
945 #[unsafe(method(allowedWritingToolsResultOptions))]
946 #[unsafe(method_family = none)]
947 pub unsafe fn allowedWritingToolsResultOptions(&self) -> UIWritingToolsResultOptions;
948
949 #[cfg(feature = "UITextInputTraits")]
950 #[unsafe(method(setAllowedWritingToolsResultOptions:))]
952 #[unsafe(method_family = none)]
953 pub unsafe fn setAllowedWritingToolsResultOptions(
954 &self,
955 allowed_writing_tools_result_options: UIWritingToolsResultOptions,
956 );
957
958 #[unsafe(method(subclassForWritingToolsCoordinator))]
959 #[unsafe(method_family = none)]
960 pub unsafe fn subclassForWritingToolsCoordinator(&self) -> &'static AnyClass;
961
962 #[cfg(feature = "UIWritingToolsCoordinator")]
963 #[unsafe(method(writingToolsCoordinator))]
964 #[unsafe(method_family = none)]
965 pub unsafe fn writingToolsCoordinator(&self) -> Retained<UIWritingToolsCoordinator>;
966
967 #[cfg(feature = "UITextFormattingViewControllerConfiguration")]
968 #[unsafe(method(textFormattingConfiguration))]
974 #[unsafe(method_family = none)]
975 pub unsafe fn textFormattingConfiguration(
976 &self,
977 ) -> Option<Retained<UITextFormattingViewControllerConfiguration>>;
978
979 #[cfg(feature = "UITextFormattingViewControllerConfiguration")]
980 #[unsafe(method(setTextFormattingConfiguration:))]
982 #[unsafe(method_family = none)]
983 pub unsafe fn setTextFormattingConfiguration(
984 &self,
985 text_formatting_configuration: Option<&UITextFormattingViewControllerConfiguration>,
986 );
987 );
988}
989
990#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
992impl UITextView {
993 extern_methods!(
994 #[cfg(feature = "objc2-core-foundation")]
995 #[unsafe(method(initWithFrame:))]
996 #[unsafe(method_family = init)]
997 pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
998 );
999}
1000
1001#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1003impl UITextView {
1004 extern_methods!(
1005 #[unsafe(method(init))]
1006 #[unsafe(method_family = init)]
1007 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1008
1009 #[unsafe(method(new))]
1010 #[unsafe(method_family = new)]
1011 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
1012 );
1013}
1014
1015#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1016impl UITextView {
1017 extern_methods!();
1018}
1019
1020#[cfg(all(
1021 feature = "UIFindInteraction",
1022 feature = "UIResponder",
1023 feature = "UIScrollView",
1024 feature = "UIView"
1025))]
1026extern_conformance!(
1027 unsafe impl UIFindInteractionDelegate for UITextView {}
1028);
1029
1030#[cfg(all(
1031 feature = "UIResponder",
1032 feature = "UIScrollView",
1033 feature = "UITextDragging",
1034 feature = "UITextInput",
1035 feature = "UITextInputTraits",
1036 feature = "UIView"
1037))]
1038extern_conformance!(
1039 unsafe impl UITextDraggable for UITextView {}
1040);
1041
1042#[cfg(all(
1043 feature = "UIPasteConfigurationSupporting",
1044 feature = "UIResponder",
1045 feature = "UIScrollView",
1046 feature = "UITextDropping",
1047 feature = "UITextInput",
1048 feature = "UITextInputTraits",
1049 feature = "UITextPasteConfigurationSupporting",
1050 feature = "UIView"
1051))]
1052extern_conformance!(
1053 unsafe impl UITextDroppable for UITextView {}
1054);
1055
1056#[cfg(all(
1057 feature = "UIPasteConfigurationSupporting",
1058 feature = "UIResponder",
1059 feature = "UIScrollView",
1060 feature = "UITextPasteConfigurationSupporting",
1061 feature = "UIView"
1062))]
1063extern_conformance!(
1064 unsafe impl UITextPasteConfigurationSupporting for UITextView {}
1065);
1066
1067#[cfg(all(
1068 feature = "UIResponder",
1069 feature = "UIScrollView",
1070 feature = "UITextSearching",
1071 feature = "UIView"
1072))]
1073extern_conformance!(
1074 unsafe impl UITextSearching for UITextView {}
1075);
1076
1077#[cfg(all(feature = "UIResponder", feature = "UIScrollView", feature = "UIView"))]
1079impl UITextView {
1080 extern_methods!(
1081 #[unsafe(method(interactionState))]
1082 #[unsafe(method_family = none)]
1083 pub unsafe fn interactionState(&self) -> Retained<AnyObject>;
1084
1085 #[unsafe(method(setInteractionState:))]
1087 #[unsafe(method_family = none)]
1088 pub unsafe fn setInteractionState(&self, interaction_state: &AnyObject);
1089 );
1090}
1091
1092extern "C" {
1093 pub static UITextViewTextDidBeginEditingNotification: &'static NSNotificationName;
1095}
1096
1097extern "C" {
1098 pub static UITextViewTextDidChangeNotification: &'static NSNotificationName;
1100}
1101
1102extern "C" {
1103 pub static UITextViewTextDidEndEditingNotification: &'static NSNotificationName;
1105}