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
10use crate::*;
11
12#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSSelectionGranularity(pub NSUInteger);
17impl NSSelectionGranularity {
18 #[doc(alias = "NSSelectByCharacter")]
19 pub const SelectByCharacter: Self = Self(0);
20 #[doc(alias = "NSSelectByWord")]
21 pub const SelectByWord: Self = Self(1);
22 #[doc(alias = "NSSelectByParagraph")]
23 pub const SelectByParagraph: Self = Self(2);
24}
25
26unsafe impl Encode for NSSelectionGranularity {
27 const ENCODING: Encoding = NSUInteger::ENCODING;
28}
29
30unsafe impl RefEncode for NSSelectionGranularity {
31 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34#[repr(transparent)]
37#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
38pub struct NSSelectionAffinity(pub NSUInteger);
39impl NSSelectionAffinity {
40 #[doc(alias = "NSSelectionAffinityUpstream")]
41 pub const Upstream: Self = Self(0);
42 #[doc(alias = "NSSelectionAffinityDownstream")]
43 pub const Downstream: Self = Self(1);
44}
45
46unsafe impl Encode for NSSelectionAffinity {
47 const ENCODING: Encoding = NSUInteger::ENCODING;
48}
49
50unsafe impl RefEncode for NSSelectionAffinity {
51 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
52}
53
54extern "C" {
55 pub static NSAllRomanInputSourcesLocaleIdentifier: &'static NSString;
57}
58
59extern_class!(
60 #[unsafe(super(NSText, NSView, NSResponder, NSObject))]
62 #[derive(Debug, PartialEq, Eq, Hash)]
63 #[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
64 pub struct NSTextView;
65);
66
67#[cfg(all(
68 feature = "NSAccessibilityProtocols",
69 feature = "NSResponder",
70 feature = "NSText",
71 feature = "NSView"
72))]
73extern_conformance!(
74 unsafe impl NSAccessibility for NSTextView {}
75);
76
77#[cfg(all(
78 feature = "NSAccessibilityProtocols",
79 feature = "NSResponder",
80 feature = "NSText",
81 feature = "NSView"
82))]
83extern_conformance!(
84 unsafe impl NSAccessibilityElementProtocol for NSTextView {}
85);
86
87#[cfg(all(
88 feature = "NSAccessibilityProtocols",
89 feature = "NSResponder",
90 feature = "NSText",
91 feature = "NSView"
92))]
93extern_conformance!(
94 unsafe impl NSAccessibilityNavigableStaticText for NSTextView {}
95);
96
97#[cfg(all(
98 feature = "NSAccessibilityProtocols",
99 feature = "NSResponder",
100 feature = "NSText",
101 feature = "NSView"
102))]
103extern_conformance!(
104 unsafe impl NSAccessibilityStaticText for NSTextView {}
105);
106
107#[cfg(all(
108 feature = "NSAnimation",
109 feature = "NSResponder",
110 feature = "NSText",
111 feature = "NSView"
112))]
113extern_conformance!(
114 unsafe impl NSAnimatablePropertyContainer for NSTextView {}
115);
116
117#[cfg(all(
118 feature = "NSAppearance",
119 feature = "NSResponder",
120 feature = "NSText",
121 feature = "NSView"
122))]
123extern_conformance!(
124 unsafe impl NSAppearanceCustomization for NSTextView {}
125);
126
127#[cfg(all(
128 feature = "NSResponder",
129 feature = "NSSpellProtocol",
130 feature = "NSText",
131 feature = "NSView"
132))]
133extern_conformance!(
134 unsafe impl NSChangeSpelling for NSTextView {}
135);
136
137#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
138extern_conformance!(
139 unsafe impl NSCoding for NSTextView {}
140);
141
142#[cfg(all(
143 feature = "NSColorPanel",
144 feature = "NSResponder",
145 feature = "NSText",
146 feature = "NSView"
147))]
148extern_conformance!(
149 unsafe impl NSColorChanging for NSTextView {}
150);
151
152#[cfg(all(
153 feature = "NSDragging",
154 feature = "NSResponder",
155 feature = "NSText",
156 feature = "NSView"
157))]
158extern_conformance!(
159 unsafe impl NSDraggingDestination for NSTextView {}
160);
161
162#[cfg(all(
163 feature = "NSDragging",
164 feature = "NSResponder",
165 feature = "NSText",
166 feature = "NSView"
167))]
168extern_conformance!(
169 unsafe impl NSDraggingSource for NSTextView {}
170);
171
172#[cfg(all(
173 feature = "NSResponder",
174 feature = "NSSpellProtocol",
175 feature = "NSText",
176 feature = "NSView"
177))]
178extern_conformance!(
179 unsafe impl NSIgnoreMisspelledWords for NSTextView {}
180);
181
182#[cfg(all(
183 feature = "NSMenu",
184 feature = "NSResponder",
185 feature = "NSText",
186 feature = "NSView"
187))]
188extern_conformance!(
189 unsafe impl NSMenuItemValidation for NSTextView {}
190);
191
192#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
193extern_conformance!(
194 unsafe impl NSObjectProtocol for NSTextView {}
195);
196
197#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
198extern_conformance!(
199 unsafe impl NSStandardKeyBindingResponding for NSTextView {}
200);
201
202#[cfg(all(
203 feature = "NSResponder",
204 feature = "NSText",
205 feature = "NSTextContent",
206 feature = "NSView"
207))]
208extern_conformance!(
209 unsafe impl NSTextContent for NSTextView {}
210);
211
212#[cfg(all(
213 feature = "NSInputManager",
214 feature = "NSResponder",
215 feature = "NSText",
216 feature = "NSView"
217))]
218extern_conformance!(
219 unsafe impl NSTextInput for NSTextView {}
220);
221
222#[cfg(all(
223 feature = "NSResponder",
224 feature = "NSText",
225 feature = "NSTextInputClient",
226 feature = "NSView"
227))]
228extern_conformance!(
229 unsafe impl NSTextInputClient for NSTextView {}
230);
231
232#[cfg(all(
233 feature = "NSLayoutManager",
234 feature = "NSResponder",
235 feature = "NSText",
236 feature = "NSView"
237))]
238extern_conformance!(
239 unsafe impl NSTextLayoutOrientationProvider for NSTextView {}
240);
241
242#[cfg(all(
243 feature = "NSResponder",
244 feature = "NSText",
245 feature = "NSUserInterfaceItemIdentification",
246 feature = "NSView"
247))]
248extern_conformance!(
249 unsafe impl NSUserInterfaceItemIdentification for NSTextView {}
250);
251
252#[cfg(all(
253 feature = "NSResponder",
254 feature = "NSText",
255 feature = "NSUserInterfaceValidation",
256 feature = "NSView"
257))]
258extern_conformance!(
259 unsafe impl NSUserInterfaceValidations for NSTextView {}
260);
261
262#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
263impl NSTextView {
264 extern_methods!(
265 #[cfg(feature = "NSTextContainer")]
266 #[unsafe(method(initWithFrame:textContainer:))]
268 #[unsafe(method_family = init)]
269 pub unsafe fn initWithFrame_textContainer(
270 this: Allocated<Self>,
271 frame_rect: NSRect,
272 container: Option<&NSTextContainer>,
273 ) -> Retained<Self>;
274
275 #[unsafe(method(initWithCoder:))]
276 #[unsafe(method_family = init)]
277 pub unsafe fn initWithCoder(
278 this: Allocated<Self>,
279 coder: &NSCoder,
280 ) -> Option<Retained<Self>>;
281
282 #[unsafe(method(initWithFrame:))]
283 #[unsafe(method_family = init)]
284 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
285
286 #[unsafe(method(initUsingTextLayoutManager:))]
287 #[unsafe(method_family = init)]
288 pub unsafe fn initUsingTextLayoutManager(
289 this: Allocated<Self>,
290 using_text_layout_manager: bool,
291 ) -> Retained<Self>;
292
293 #[unsafe(method(textViewUsingTextLayoutManager:))]
294 #[unsafe(method_family = none)]
295 pub unsafe fn textViewUsingTextLayoutManager(
296 using_text_layout_manager: bool,
297 mtm: MainThreadMarker,
298 ) -> Retained<Self>;
299
300 #[cfg(feature = "NSTextContainer")]
301 #[unsafe(method(textContainer))]
303 #[unsafe(method_family = none)]
304 pub unsafe fn textContainer(&self) -> Option<Retained<NSTextContainer>>;
305
306 #[cfg(feature = "NSTextContainer")]
307 #[unsafe(method(setTextContainer:))]
309 #[unsafe(method_family = none)]
310 pub unsafe fn setTextContainer(&self, text_container: Option<&NSTextContainer>);
311
312 #[cfg(feature = "NSTextContainer")]
313 #[unsafe(method(replaceTextContainer:))]
314 #[unsafe(method_family = none)]
315 pub unsafe fn replaceTextContainer(&self, new_container: &NSTextContainer);
316
317 #[unsafe(method(textContainerInset))]
318 #[unsafe(method_family = none)]
319 pub unsafe fn textContainerInset(&self) -> NSSize;
320
321 #[unsafe(method(setTextContainerInset:))]
323 #[unsafe(method_family = none)]
324 pub unsafe fn setTextContainerInset(&self, text_container_inset: NSSize);
325
326 #[unsafe(method(textContainerOrigin))]
327 #[unsafe(method_family = none)]
328 pub unsafe fn textContainerOrigin(&self) -> NSPoint;
329
330 #[unsafe(method(invalidateTextContainerOrigin))]
331 #[unsafe(method_family = none)]
332 pub unsafe fn invalidateTextContainerOrigin(&self);
333
334 #[cfg(feature = "NSLayoutManager")]
335 #[unsafe(method(layoutManager))]
336 #[unsafe(method_family = none)]
337 pub unsafe fn layoutManager(&self) -> Option<Retained<NSLayoutManager>>;
338
339 #[cfg(feature = "NSTextStorage")]
340 #[unsafe(method(textStorage))]
341 #[unsafe(method_family = none)]
342 pub unsafe fn textStorage(&self) -> Option<Retained<NSTextStorage>>;
343
344 #[cfg(feature = "NSTextLayoutManager")]
345 #[unsafe(method(textLayoutManager))]
346 #[unsafe(method_family = none)]
347 pub unsafe fn textLayoutManager(&self) -> Option<Retained<NSTextLayoutManager>>;
348
349 #[cfg(feature = "NSTextContentManager")]
350 #[unsafe(method(textContentStorage))]
351 #[unsafe(method_family = none)]
352 pub unsafe fn textContentStorage(&self) -> Option<Retained<NSTextContentStorage>>;
353
354 #[deprecated = "Use -insertText:replacementRange: from NSTextInputClient instead. Since the method is designed to be used solely by the input system, the message should never be sent to a text view from applications. Any content modifications should be via either NSTextStorage or NSText methods."]
356 #[unsafe(method(insertText:))]
357 #[unsafe(method_family = none)]
358 pub unsafe fn insertText(&self, insert_string: &AnyObject);
359
360 #[unsafe(method(setConstrainedFrameSize:))]
362 #[unsafe(method_family = none)]
363 pub unsafe fn setConstrainedFrameSize(&self, desired_size: NSSize);
364
365 #[unsafe(method(setAlignment:range:))]
366 #[unsafe(method_family = none)]
367 pub unsafe fn setAlignment_range(&self, alignment: NSTextAlignment, range: NSRange);
368
369 #[unsafe(method(setBaseWritingDirection:range:))]
370 #[unsafe(method_family = none)]
371 pub unsafe fn setBaseWritingDirection_range(
372 &self,
373 writing_direction: NSWritingDirection,
374 range: NSRange,
375 );
376
377 #[unsafe(method(turnOffKerning:))]
379 #[unsafe(method_family = none)]
380 pub unsafe fn turnOffKerning(&self, sender: Option<&AnyObject>);
381
382 #[unsafe(method(tightenKerning:))]
383 #[unsafe(method_family = none)]
384 pub unsafe fn tightenKerning(&self, sender: Option<&AnyObject>);
385
386 #[unsafe(method(loosenKerning:))]
387 #[unsafe(method_family = none)]
388 pub unsafe fn loosenKerning(&self, sender: Option<&AnyObject>);
389
390 #[unsafe(method(useStandardKerning:))]
391 #[unsafe(method_family = none)]
392 pub unsafe fn useStandardKerning(&self, sender: Option<&AnyObject>);
393
394 #[unsafe(method(turnOffLigatures:))]
395 #[unsafe(method_family = none)]
396 pub unsafe fn turnOffLigatures(&self, sender: Option<&AnyObject>);
397
398 #[unsafe(method(useStandardLigatures:))]
399 #[unsafe(method_family = none)]
400 pub unsafe fn useStandardLigatures(&self, sender: Option<&AnyObject>);
401
402 #[unsafe(method(useAllLigatures:))]
403 #[unsafe(method_family = none)]
404 pub unsafe fn useAllLigatures(&self, sender: Option<&AnyObject>);
405
406 #[unsafe(method(raiseBaseline:))]
407 #[unsafe(method_family = none)]
408 pub unsafe fn raiseBaseline(&self, sender: Option<&AnyObject>);
409
410 #[unsafe(method(lowerBaseline:))]
411 #[unsafe(method_family = none)]
412 pub unsafe fn lowerBaseline(&self, sender: Option<&AnyObject>);
413
414 #[deprecated = "Use the traditional shaped characters encoded in the Unicode standard. Access the characters via the character palette."]
415 #[unsafe(method(toggleTraditionalCharacterShape:))]
416 #[unsafe(method_family = none)]
417 pub unsafe fn toggleTraditionalCharacterShape(&self, sender: Option<&AnyObject>);
418
419 #[unsafe(method(outline:))]
420 #[unsafe(method_family = none)]
421 pub unsafe fn outline(&self, sender: Option<&AnyObject>);
422
423 #[unsafe(method(performFindPanelAction:))]
425 #[unsafe(method_family = none)]
426 pub unsafe fn performFindPanelAction(&self, sender: Option<&AnyObject>);
427
428 #[unsafe(method(alignJustified:))]
430 #[unsafe(method_family = none)]
431 pub unsafe fn alignJustified(&self, sender: Option<&AnyObject>);
432
433 #[unsafe(method(changeColor:))]
434 #[unsafe(method_family = none)]
435 pub unsafe fn changeColor(&self, sender: Option<&AnyObject>);
436
437 #[unsafe(method(changeAttributes:))]
438 #[unsafe(method_family = none)]
439 pub unsafe fn changeAttributes(&self, sender: Option<&AnyObject>);
440
441 #[unsafe(method(changeDocumentBackgroundColor:))]
442 #[unsafe(method_family = none)]
443 pub unsafe fn changeDocumentBackgroundColor(&self, sender: Option<&AnyObject>);
444
445 #[unsafe(method(orderFrontSpacingPanel:))]
446 #[unsafe(method_family = none)]
447 pub unsafe fn orderFrontSpacingPanel(&self, sender: Option<&AnyObject>);
448
449 #[unsafe(method(orderFrontLinkPanel:))]
450 #[unsafe(method_family = none)]
451 pub unsafe fn orderFrontLinkPanel(&self, sender: Option<&AnyObject>);
452
453 #[unsafe(method(orderFrontListPanel:))]
454 #[unsafe(method_family = none)]
455 pub unsafe fn orderFrontListPanel(&self, sender: Option<&AnyObject>);
456
457 #[unsafe(method(orderFrontTablePanel:))]
458 #[unsafe(method_family = none)]
459 pub unsafe fn orderFrontTablePanel(&self, sender: Option<&AnyObject>);
460
461 #[cfg(all(feature = "NSRulerMarker", feature = "NSRulerView"))]
462 #[unsafe(method(rulerView:didMoveMarker:))]
464 #[unsafe(method_family = none)]
465 pub unsafe fn rulerView_didMoveMarker(&self, ruler: &NSRulerView, marker: &NSRulerMarker);
466
467 #[cfg(all(feature = "NSRulerMarker", feature = "NSRulerView"))]
468 #[unsafe(method(rulerView:didRemoveMarker:))]
469 #[unsafe(method_family = none)]
470 pub unsafe fn rulerView_didRemoveMarker(&self, ruler: &NSRulerView, marker: &NSRulerMarker);
471
472 #[cfg(all(feature = "NSRulerMarker", feature = "NSRulerView"))]
473 #[unsafe(method(rulerView:didAddMarker:))]
474 #[unsafe(method_family = none)]
475 pub unsafe fn rulerView_didAddMarker(&self, ruler: &NSRulerView, marker: &NSRulerMarker);
476
477 #[cfg(all(feature = "NSRulerMarker", feature = "NSRulerView"))]
478 #[unsafe(method(rulerView:shouldMoveMarker:))]
479 #[unsafe(method_family = none)]
480 pub unsafe fn rulerView_shouldMoveMarker(
481 &self,
482 ruler: &NSRulerView,
483 marker: &NSRulerMarker,
484 ) -> bool;
485
486 #[cfg(all(feature = "NSRulerMarker", feature = "NSRulerView"))]
487 #[unsafe(method(rulerView:shouldAddMarker:))]
488 #[unsafe(method_family = none)]
489 pub unsafe fn rulerView_shouldAddMarker(
490 &self,
491 ruler: &NSRulerView,
492 marker: &NSRulerMarker,
493 ) -> bool;
494
495 #[cfg(all(
496 feature = "NSRulerMarker",
497 feature = "NSRulerView",
498 feature = "objc2-core-foundation"
499 ))]
500 #[unsafe(method(rulerView:willMoveMarker:toLocation:))]
501 #[unsafe(method_family = none)]
502 pub unsafe fn rulerView_willMoveMarker_toLocation(
503 &self,
504 ruler: &NSRulerView,
505 marker: &NSRulerMarker,
506 location: CGFloat,
507 ) -> CGFloat;
508
509 #[cfg(all(feature = "NSRulerMarker", feature = "NSRulerView"))]
510 #[unsafe(method(rulerView:shouldRemoveMarker:))]
511 #[unsafe(method_family = none)]
512 pub unsafe fn rulerView_shouldRemoveMarker(
513 &self,
514 ruler: &NSRulerView,
515 marker: &NSRulerMarker,
516 ) -> bool;
517
518 #[cfg(all(
519 feature = "NSRulerMarker",
520 feature = "NSRulerView",
521 feature = "objc2-core-foundation"
522 ))]
523 #[unsafe(method(rulerView:willAddMarker:atLocation:))]
524 #[unsafe(method_family = none)]
525 pub unsafe fn rulerView_willAddMarker_atLocation(
526 &self,
527 ruler: &NSRulerView,
528 marker: &NSRulerMarker,
529 location: CGFloat,
530 ) -> CGFloat;
531
532 #[cfg(all(feature = "NSEvent", feature = "NSRulerView"))]
533 #[unsafe(method(rulerView:handleMouseDown:))]
534 #[unsafe(method_family = none)]
535 pub unsafe fn rulerView_handleMouseDown(&self, ruler: &NSRulerView, event: &NSEvent);
536
537 #[unsafe(method(setNeedsDisplayInRect:avoidAdditionalLayout:))]
539 #[unsafe(method_family = none)]
540 pub unsafe fn setNeedsDisplayInRect_avoidAdditionalLayout(&self, rect: NSRect, flag: bool);
541
542 #[unsafe(method(shouldDrawInsertionPoint))]
543 #[unsafe(method_family = none)]
544 pub unsafe fn shouldDrawInsertionPoint(&self) -> bool;
545
546 #[cfg(feature = "NSColor")]
547 #[unsafe(method(drawInsertionPointInRect:color:turnedOn:))]
548 #[unsafe(method_family = none)]
549 pub unsafe fn drawInsertionPointInRect_color_turnedOn(
550 &self,
551 rect: NSRect,
552 color: &NSColor,
553 flag: bool,
554 );
555
556 #[unsafe(method(drawViewBackgroundInRect:))]
557 #[unsafe(method_family = none)]
558 pub unsafe fn drawViewBackgroundInRect(&self, rect: NSRect);
559
560 #[unsafe(method(updateRuler))]
562 #[unsafe(method_family = none)]
563 pub unsafe fn updateRuler(&self);
564
565 #[unsafe(method(updateFontPanel))]
566 #[unsafe(method_family = none)]
567 pub unsafe fn updateFontPanel(&self);
568
569 #[unsafe(method(updateDragTypeRegistration))]
570 #[unsafe(method_family = none)]
571 pub unsafe fn updateDragTypeRegistration(&self);
572
573 #[unsafe(method(selectionRangeForProposedRange:granularity:))]
574 #[unsafe(method_family = none)]
575 pub unsafe fn selectionRangeForProposedRange_granularity(
576 &self,
577 proposed_char_range: NSRange,
578 granularity: NSSelectionGranularity,
579 ) -> NSRange;
580
581 #[unsafe(method(clickedOnLink:atIndex:))]
583 #[unsafe(method_family = none)]
584 pub unsafe fn clickedOnLink_atIndex(&self, link: &AnyObject, char_index: NSUInteger);
585
586 #[unsafe(method(startSpeaking:))]
588 #[unsafe(method_family = none)]
589 pub unsafe fn startSpeaking(&self, sender: Option<&AnyObject>);
590
591 #[unsafe(method(stopSpeaking:))]
592 #[unsafe(method_family = none)]
593 pub unsafe fn stopSpeaking(&self, sender: Option<&AnyObject>);
594
595 #[cfg(feature = "NSLayoutManager")]
596 #[unsafe(method(setLayoutOrientation:))]
597 #[unsafe(method_family = none)]
598 pub unsafe fn setLayoutOrientation(&self, orientation: NSTextLayoutOrientation);
599
600 #[unsafe(method(changeLayoutOrientation:))]
601 #[unsafe(method_family = none)]
602 pub unsafe fn changeLayoutOrientation(&self, sender: Option<&AnyObject>);
603
604 #[unsafe(method(characterIndexForInsertionAtPoint:))]
606 #[unsafe(method_family = none)]
607 pub unsafe fn characterIndexForInsertionAtPoint(&self, point: NSPoint) -> NSUInteger;
608
609 #[unsafe(method(stronglyReferencesTextStorage))]
611 #[unsafe(method_family = none)]
612 pub unsafe fn stronglyReferencesTextStorage(mtm: MainThreadMarker) -> bool;
613
614 #[unsafe(method(performValidatedReplacementInRange:withAttributedString:))]
615 #[unsafe(method_family = none)]
616 pub unsafe fn performValidatedReplacementInRange_withAttributedString(
617 &self,
618 range: NSRange,
619 attributed_string: &NSAttributedString,
620 ) -> bool;
621
622 #[unsafe(method(usesAdaptiveColorMappingForDarkAppearance))]
623 #[unsafe(method_family = none)]
624 pub unsafe fn usesAdaptiveColorMappingForDarkAppearance(&self) -> bool;
625
626 #[unsafe(method(setUsesAdaptiveColorMappingForDarkAppearance:))]
628 #[unsafe(method_family = none)]
629 pub unsafe fn setUsesAdaptiveColorMappingForDarkAppearance(
630 &self,
631 uses_adaptive_color_mapping_for_dark_appearance: bool,
632 );
633 );
634}
635
636#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
638impl NSTextView {
639 extern_methods!(
640 #[unsafe(method(init))]
641 #[unsafe(method_family = init)]
642 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
643 );
644}
645
646#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
648impl NSTextView {
649 extern_methods!(
650 #[unsafe(method(new))]
651 #[unsafe(method_family = new)]
652 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
653 );
654}
655
656#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
658impl NSTextView {
659 extern_methods!(
660 #[unsafe(method(complete:))]
662 #[unsafe(method_family = none)]
663 pub unsafe fn complete(&self, sender: Option<&AnyObject>);
664
665 #[unsafe(method(rangeForUserCompletion))]
666 #[unsafe(method_family = none)]
667 pub unsafe fn rangeForUserCompletion(&self) -> NSRange;
668
669 #[unsafe(method(completionsForPartialWordRange:indexOfSelectedItem:))]
670 #[unsafe(method_family = none)]
671 pub unsafe fn completionsForPartialWordRange_indexOfSelectedItem(
672 &self,
673 char_range: NSRange,
674 index: NonNull<NSInteger>,
675 ) -> Option<Retained<NSArray<NSString>>>;
676
677 #[unsafe(method(insertCompletion:forPartialWordRange:movement:isFinal:))]
678 #[unsafe(method_family = none)]
679 pub unsafe fn insertCompletion_forPartialWordRange_movement_isFinal(
680 &self,
681 word: &NSString,
682 char_range: NSRange,
683 movement: NSInteger,
684 flag: bool,
685 );
686 );
687}
688
689#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
691impl NSTextView {
692 extern_methods!(
693 #[cfg(feature = "NSPasteboard")]
694 #[unsafe(method(writablePasteboardTypes))]
696 #[unsafe(method_family = none)]
697 pub unsafe fn writablePasteboardTypes(&self) -> Retained<NSArray<NSPasteboardType>>;
698
699 #[cfg(feature = "NSPasteboard")]
700 #[unsafe(method(writeSelectionToPasteboard:type:))]
701 #[unsafe(method_family = none)]
702 pub unsafe fn writeSelectionToPasteboard_type(
703 &self,
704 pboard: &NSPasteboard,
705 r#type: &NSPasteboardType,
706 ) -> bool;
707
708 #[cfg(feature = "NSPasteboard")]
709 #[unsafe(method(writeSelectionToPasteboard:types:))]
710 #[unsafe(method_family = none)]
711 pub unsafe fn writeSelectionToPasteboard_types(
712 &self,
713 pboard: &NSPasteboard,
714 types: &NSArray<NSPasteboardType>,
715 ) -> bool;
716
717 #[cfg(feature = "NSPasteboard")]
718 #[unsafe(method(readablePasteboardTypes))]
719 #[unsafe(method_family = none)]
720 pub unsafe fn readablePasteboardTypes(&self) -> Retained<NSArray<NSPasteboardType>>;
721
722 #[cfg(feature = "NSPasteboard")]
723 #[unsafe(method(preferredPasteboardTypeFromArray:restrictedToTypesFromArray:))]
724 #[unsafe(method_family = none)]
725 pub unsafe fn preferredPasteboardTypeFromArray_restrictedToTypesFromArray(
726 &self,
727 available_types: &NSArray<NSPasteboardType>,
728 allowed_types: Option<&NSArray<NSPasteboardType>>,
729 ) -> Option<Retained<NSPasteboardType>>;
730
731 #[cfg(feature = "NSPasteboard")]
732 #[unsafe(method(readSelectionFromPasteboard:type:))]
733 #[unsafe(method_family = none)]
734 pub unsafe fn readSelectionFromPasteboard_type(
735 &self,
736 pboard: &NSPasteboard,
737 r#type: &NSPasteboardType,
738 ) -> bool;
739
740 #[cfg(feature = "NSPasteboard")]
741 #[unsafe(method(readSelectionFromPasteboard:))]
742 #[unsafe(method_family = none)]
743 pub unsafe fn readSelectionFromPasteboard(&self, pboard: &NSPasteboard) -> bool;
744
745 #[unsafe(method(registerForServices))]
746 #[unsafe(method_family = none)]
747 pub unsafe fn registerForServices(mtm: MainThreadMarker);
748
749 #[cfg(feature = "NSPasteboard")]
750 #[unsafe(method(validRequestorForSendType:returnType:))]
751 #[unsafe(method_family = none)]
752 pub unsafe fn validRequestorForSendType_returnType(
753 &self,
754 send_type: Option<&NSPasteboardType>,
755 return_type: Option<&NSPasteboardType>,
756 ) -> Option<Retained<AnyObject>>;
757
758 #[unsafe(method(pasteAsPlainText:))]
759 #[unsafe(method_family = none)]
760 pub unsafe fn pasteAsPlainText(&self, sender: Option<&AnyObject>);
761
762 #[unsafe(method(pasteAsRichText:))]
763 #[unsafe(method_family = none)]
764 pub unsafe fn pasteAsRichText(&self, sender: Option<&AnyObject>);
765 );
766}
767
768#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
770impl NSTextView {
771 extern_methods!(
772 #[cfg(feature = "NSEvent")]
773 #[unsafe(method(dragSelectionWithEvent:offset:slideBack:))]
774 #[unsafe(method_family = none)]
775 pub unsafe fn dragSelectionWithEvent_offset_slideBack(
776 &self,
777 event: &NSEvent,
778 mouse_offset: NSSize,
779 slide_back: bool,
780 ) -> bool;
781
782 #[cfg(all(feature = "NSEvent", feature = "NSImage"))]
783 #[unsafe(method(dragImageForSelectionWithEvent:origin:))]
784 #[unsafe(method_family = none)]
785 pub unsafe fn dragImageForSelectionWithEvent_origin(
786 &self,
787 event: &NSEvent,
788 origin: NSPointPointer,
789 ) -> Option<Retained<NSImage>>;
790
791 #[cfg(feature = "NSPasteboard")]
792 #[unsafe(method(acceptableDragTypes))]
793 #[unsafe(method_family = none)]
794 pub unsafe fn acceptableDragTypes(&self) -> Retained<NSArray<NSPasteboardType>>;
795
796 #[cfg(all(feature = "NSDragging", feature = "NSPasteboard"))]
797 #[unsafe(method(dragOperationForDraggingInfo:type:))]
798 #[unsafe(method_family = none)]
799 pub unsafe fn dragOperationForDraggingInfo_type(
800 &self,
801 drag_info: &ProtocolObject<dyn NSDraggingInfo>,
802 r#type: &NSPasteboardType,
803 ) -> NSDragOperation;
804
805 #[unsafe(method(cleanUpAfterDragOperation))]
806 #[unsafe(method_family = none)]
807 pub unsafe fn cleanUpAfterDragOperation(&self);
808 );
809}
810
811#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
813impl NSTextView {
814 extern_methods!(
815 #[unsafe(method(selectedRanges))]
817 #[unsafe(method_family = none)]
818 pub unsafe fn selectedRanges(&self) -> Retained<NSArray<NSValue>>;
819
820 #[unsafe(method(setSelectedRanges:))]
822 #[unsafe(method_family = none)]
823 pub unsafe fn setSelectedRanges(&self, selected_ranges: &NSArray<NSValue>);
824
825 #[unsafe(method(setSelectedRanges:affinity:stillSelecting:))]
826 #[unsafe(method_family = none)]
827 pub unsafe fn setSelectedRanges_affinity_stillSelecting(
828 &self,
829 ranges: &NSArray<NSValue>,
830 affinity: NSSelectionAffinity,
831 still_selecting_flag: bool,
832 );
833
834 #[unsafe(method(setSelectedRange:affinity:stillSelecting:))]
835 #[unsafe(method_family = none)]
836 pub unsafe fn setSelectedRange_affinity_stillSelecting(
837 &self,
838 char_range: NSRange,
839 affinity: NSSelectionAffinity,
840 still_selecting_flag: bool,
841 );
842
843 #[unsafe(method(selectionAffinity))]
844 #[unsafe(method_family = none)]
845 pub unsafe fn selectionAffinity(&self) -> NSSelectionAffinity;
846
847 #[unsafe(method(selectionGranularity))]
848 #[unsafe(method_family = none)]
849 pub unsafe fn selectionGranularity(&self) -> NSSelectionGranularity;
850
851 #[unsafe(method(setSelectionGranularity:))]
853 #[unsafe(method_family = none)]
854 pub unsafe fn setSelectionGranularity(&self, selection_granularity: NSSelectionGranularity);
855
856 #[unsafe(method(selectedTextAttributes))]
857 #[unsafe(method_family = none)]
858 pub unsafe fn selectedTextAttributes(
859 &self,
860 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
861
862 #[unsafe(method(setSelectedTextAttributes:))]
864 #[unsafe(method_family = none)]
865 pub unsafe fn setSelectedTextAttributes(
866 &self,
867 selected_text_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
868 );
869
870 #[cfg(feature = "NSColor")]
871 #[unsafe(method(insertionPointColor))]
872 #[unsafe(method_family = none)]
873 pub unsafe fn insertionPointColor(&self) -> Retained<NSColor>;
874
875 #[cfg(feature = "NSColor")]
876 #[unsafe(method(setInsertionPointColor:))]
878 #[unsafe(method_family = none)]
879 pub unsafe fn setInsertionPointColor(&self, insertion_point_color: Option<&NSColor>);
880
881 #[unsafe(method(updateInsertionPointStateAndRestartTimer:))]
882 #[unsafe(method_family = none)]
883 pub unsafe fn updateInsertionPointStateAndRestartTimer(&self, restart_flag: bool);
884
885 #[unsafe(method(markedTextAttributes))]
886 #[unsafe(method_family = none)]
887 pub unsafe fn markedTextAttributes(
888 &self,
889 ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;
890
891 #[unsafe(method(setMarkedTextAttributes:))]
893 #[unsafe(method_family = none)]
894 pub unsafe fn setMarkedTextAttributes(
895 &self,
896 marked_text_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
897 );
898
899 #[unsafe(method(linkTextAttributes))]
900 #[unsafe(method_family = none)]
901 pub unsafe fn linkTextAttributes(
902 &self,
903 ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;
904
905 #[unsafe(method(setLinkTextAttributes:))]
907 #[unsafe(method_family = none)]
908 pub unsafe fn setLinkTextAttributes(
909 &self,
910 link_text_attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
911 );
912
913 #[unsafe(method(displaysLinkToolTips))]
914 #[unsafe(method_family = none)]
915 pub unsafe fn displaysLinkToolTips(&self) -> bool;
916
917 #[unsafe(method(setDisplaysLinkToolTips:))]
919 #[unsafe(method_family = none)]
920 pub unsafe fn setDisplaysLinkToolTips(&self, displays_link_tool_tips: bool);
921
922 #[unsafe(method(acceptsGlyphInfo))]
924 #[unsafe(method_family = none)]
925 pub unsafe fn acceptsGlyphInfo(&self) -> bool;
926
927 #[unsafe(method(setAcceptsGlyphInfo:))]
929 #[unsafe(method_family = none)]
930 pub unsafe fn setAcceptsGlyphInfo(&self, accepts_glyph_info: bool);
931
932 #[unsafe(method(usesRuler))]
934 #[unsafe(method_family = none)]
935 pub unsafe fn usesRuler(&self) -> bool;
936
937 #[unsafe(method(setUsesRuler:))]
939 #[unsafe(method_family = none)]
940 pub unsafe fn setUsesRuler(&self, uses_ruler: bool);
941
942 #[unsafe(method(usesInspectorBar))]
943 #[unsafe(method_family = none)]
944 pub unsafe fn usesInspectorBar(&self) -> bool;
945
946 #[unsafe(method(setUsesInspectorBar:))]
948 #[unsafe(method_family = none)]
949 pub unsafe fn setUsesInspectorBar(&self, uses_inspector_bar: bool);
950
951 #[unsafe(method(isContinuousSpellCheckingEnabled))]
952 #[unsafe(method_family = none)]
953 pub unsafe fn isContinuousSpellCheckingEnabled(&self) -> bool;
954
955 #[unsafe(method(setContinuousSpellCheckingEnabled:))]
957 #[unsafe(method_family = none)]
958 pub unsafe fn setContinuousSpellCheckingEnabled(
959 &self,
960 continuous_spell_checking_enabled: bool,
961 );
962
963 #[unsafe(method(toggleContinuousSpellChecking:))]
964 #[unsafe(method_family = none)]
965 pub unsafe fn toggleContinuousSpellChecking(&self, sender: Option<&AnyObject>);
966
967 #[unsafe(method(spellCheckerDocumentTag))]
968 #[unsafe(method_family = none)]
969 pub unsafe fn spellCheckerDocumentTag(&self) -> NSInteger;
970
971 #[unsafe(method(isGrammarCheckingEnabled))]
972 #[unsafe(method_family = none)]
973 pub unsafe fn isGrammarCheckingEnabled(&self) -> bool;
974
975 #[unsafe(method(setGrammarCheckingEnabled:))]
977 #[unsafe(method_family = none)]
978 pub unsafe fn setGrammarCheckingEnabled(&self, grammar_checking_enabled: bool);
979
980 #[unsafe(method(toggleGrammarChecking:))]
981 #[unsafe(method_family = none)]
982 pub unsafe fn toggleGrammarChecking(&self, sender: Option<&AnyObject>);
983
984 #[unsafe(method(setSpellingState:range:))]
985 #[unsafe(method_family = none)]
986 pub unsafe fn setSpellingState_range(&self, value: NSInteger, char_range: NSRange);
987
988 #[unsafe(method(typingAttributes))]
989 #[unsafe(method_family = none)]
990 pub unsafe fn typingAttributes(
991 &self,
992 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
993
994 #[unsafe(method(setTypingAttributes:))]
996 #[unsafe(method_family = none)]
997 pub unsafe fn setTypingAttributes(
998 &self,
999 typing_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
1000 );
1001
1002 #[unsafe(method(shouldChangeTextInRanges:replacementStrings:))]
1003 #[unsafe(method_family = none)]
1004 pub unsafe fn shouldChangeTextInRanges_replacementStrings(
1005 &self,
1006 affected_ranges: &NSArray<NSValue>,
1007 replacement_strings: Option<&NSArray<NSString>>,
1008 ) -> bool;
1009
1010 #[unsafe(method(rangesForUserTextChange))]
1011 #[unsafe(method_family = none)]
1012 pub unsafe fn rangesForUserTextChange(&self) -> Option<Retained<NSArray<NSValue>>>;
1013
1014 #[unsafe(method(rangesForUserCharacterAttributeChange))]
1015 #[unsafe(method_family = none)]
1016 pub unsafe fn rangesForUserCharacterAttributeChange(
1017 &self,
1018 ) -> Option<Retained<NSArray<NSValue>>>;
1019
1020 #[unsafe(method(rangesForUserParagraphAttributeChange))]
1021 #[unsafe(method_family = none)]
1022 pub unsafe fn rangesForUserParagraphAttributeChange(
1023 &self,
1024 ) -> Option<Retained<NSArray<NSValue>>>;
1025
1026 #[unsafe(method(shouldChangeTextInRange:replacementString:))]
1027 #[unsafe(method_family = none)]
1028 pub unsafe fn shouldChangeTextInRange_replacementString(
1029 &self,
1030 affected_char_range: NSRange,
1031 replacement_string: Option<&NSString>,
1032 ) -> bool;
1033
1034 #[unsafe(method(didChangeText))]
1035 #[unsafe(method_family = none)]
1036 pub unsafe fn didChangeText(&self);
1037
1038 #[unsafe(method(rangeForUserTextChange))]
1039 #[unsafe(method_family = none)]
1040 pub unsafe fn rangeForUserTextChange(&self) -> NSRange;
1041
1042 #[unsafe(method(rangeForUserCharacterAttributeChange))]
1043 #[unsafe(method_family = none)]
1044 pub unsafe fn rangeForUserCharacterAttributeChange(&self) -> NSRange;
1045
1046 #[unsafe(method(rangeForUserParagraphAttributeChange))]
1047 #[unsafe(method_family = none)]
1048 pub unsafe fn rangeForUserParagraphAttributeChange(&self) -> NSRange;
1049
1050 #[unsafe(method(allowsDocumentBackgroundColorChange))]
1051 #[unsafe(method_family = none)]
1052 pub unsafe fn allowsDocumentBackgroundColorChange(&self) -> bool;
1053
1054 #[unsafe(method(setAllowsDocumentBackgroundColorChange:))]
1056 #[unsafe(method_family = none)]
1057 pub unsafe fn setAllowsDocumentBackgroundColorChange(
1058 &self,
1059 allows_document_background_color_change: bool,
1060 );
1061
1062 #[cfg(feature = "NSParagraphStyle")]
1063 #[unsafe(method(defaultParagraphStyle))]
1064 #[unsafe(method_family = none)]
1065 pub unsafe fn defaultParagraphStyle(&self) -> Option<Retained<NSParagraphStyle>>;
1066
1067 #[cfg(feature = "NSParagraphStyle")]
1068 #[unsafe(method(setDefaultParagraphStyle:))]
1070 #[unsafe(method_family = none)]
1071 pub unsafe fn setDefaultParagraphStyle(
1072 &self,
1073 default_paragraph_style: Option<&NSParagraphStyle>,
1074 );
1075
1076 #[unsafe(method(allowsUndo))]
1077 #[unsafe(method_family = none)]
1078 pub unsafe fn allowsUndo(&self) -> bool;
1079
1080 #[unsafe(method(setAllowsUndo:))]
1082 #[unsafe(method_family = none)]
1083 pub unsafe fn setAllowsUndo(&self, allows_undo: bool);
1084
1085 #[unsafe(method(breakUndoCoalescing))]
1086 #[unsafe(method_family = none)]
1087 pub unsafe fn breakUndoCoalescing(&self);
1088
1089 #[unsafe(method(isCoalescingUndo))]
1090 #[unsafe(method_family = none)]
1091 pub unsafe fn isCoalescingUndo(&self) -> bool;
1092
1093 #[unsafe(method(allowsImageEditing))]
1094 #[unsafe(method_family = none)]
1095 pub unsafe fn allowsImageEditing(&self) -> bool;
1096
1097 #[unsafe(method(setAllowsImageEditing:))]
1099 #[unsafe(method_family = none)]
1100 pub unsafe fn setAllowsImageEditing(&self, allows_image_editing: bool);
1101
1102 #[unsafe(method(showFindIndicatorForRange:))]
1103 #[unsafe(method_family = none)]
1104 pub unsafe fn showFindIndicatorForRange(&self, char_range: NSRange);
1105
1106 #[unsafe(method(usesRolloverButtonForSelection))]
1107 #[unsafe(method_family = none)]
1108 pub unsafe fn usesRolloverButtonForSelection(&self) -> bool;
1109
1110 #[unsafe(method(setUsesRolloverButtonForSelection:))]
1112 #[unsafe(method_family = none)]
1113 pub unsafe fn setUsesRolloverButtonForSelection(
1114 &self,
1115 uses_rollover_button_for_selection: bool,
1116 );
1117
1118 #[unsafe(method(delegate))]
1120 #[unsafe(method_family = none)]
1121 pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSTextViewDelegate>>>;
1122
1123 #[unsafe(method(setDelegate:))]
1126 #[unsafe(method_family = none)]
1127 pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSTextViewDelegate>>);
1128
1129 #[unsafe(method(isEditable))]
1130 #[unsafe(method_family = none)]
1131 pub unsafe fn isEditable(&self) -> bool;
1132
1133 #[unsafe(method(setEditable:))]
1135 #[unsafe(method_family = none)]
1136 pub unsafe fn setEditable(&self, editable: bool);
1137
1138 #[unsafe(method(isSelectable))]
1139 #[unsafe(method_family = none)]
1140 pub unsafe fn isSelectable(&self) -> bool;
1141
1142 #[unsafe(method(setSelectable:))]
1144 #[unsafe(method_family = none)]
1145 pub unsafe fn setSelectable(&self, selectable: bool);
1146
1147 #[unsafe(method(isRichText))]
1148 #[unsafe(method_family = none)]
1149 pub unsafe fn isRichText(&self) -> bool;
1150
1151 #[unsafe(method(setRichText:))]
1153 #[unsafe(method_family = none)]
1154 pub unsafe fn setRichText(&self, rich_text: bool);
1155
1156 #[unsafe(method(importsGraphics))]
1157 #[unsafe(method_family = none)]
1158 pub unsafe fn importsGraphics(&self) -> bool;
1159
1160 #[unsafe(method(setImportsGraphics:))]
1162 #[unsafe(method_family = none)]
1163 pub unsafe fn setImportsGraphics(&self, imports_graphics: bool);
1164
1165 #[unsafe(method(drawsBackground))]
1166 #[unsafe(method_family = none)]
1167 pub unsafe fn drawsBackground(&self) -> bool;
1168
1169 #[unsafe(method(setDrawsBackground:))]
1171 #[unsafe(method_family = none)]
1172 pub unsafe fn setDrawsBackground(&self, draws_background: bool);
1173
1174 #[cfg(feature = "NSColor")]
1175 #[unsafe(method(backgroundColor))]
1176 #[unsafe(method_family = none)]
1177 pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
1178
1179 #[cfg(feature = "NSColor")]
1180 #[unsafe(method(setBackgroundColor:))]
1182 #[unsafe(method_family = none)]
1183 pub unsafe fn setBackgroundColor(&self, background_color: &NSColor);
1184
1185 #[unsafe(method(isFieldEditor))]
1186 #[unsafe(method_family = none)]
1187 pub unsafe fn isFieldEditor(&self) -> bool;
1188
1189 #[unsafe(method(setFieldEditor:))]
1191 #[unsafe(method_family = none)]
1192 pub unsafe fn setFieldEditor(&self, field_editor: bool);
1193
1194 #[unsafe(method(usesFontPanel))]
1195 #[unsafe(method_family = none)]
1196 pub unsafe fn usesFontPanel(&self) -> bool;
1197
1198 #[unsafe(method(setUsesFontPanel:))]
1200 #[unsafe(method_family = none)]
1201 pub unsafe fn setUsesFontPanel(&self, uses_font_panel: bool);
1202
1203 #[unsafe(method(isRulerVisible))]
1204 #[unsafe(method_family = none)]
1205 pub unsafe fn isRulerVisible(&self) -> bool;
1206
1207 #[unsafe(method(setRulerVisible:))]
1209 #[unsafe(method_family = none)]
1210 pub unsafe fn setRulerVisible(&self, ruler_visible: bool);
1211
1212 #[unsafe(method(setSelectedRange:))]
1213 #[unsafe(method_family = none)]
1214 pub unsafe fn setSelectedRange(&self, char_range: NSRange);
1215
1216 #[unsafe(method(allowedInputSourceLocales))]
1218 #[unsafe(method_family = none)]
1219 pub unsafe fn allowedInputSourceLocales(&self) -> Option<Retained<NSArray<NSString>>>;
1220
1221 #[unsafe(method(setAllowedInputSourceLocales:))]
1223 #[unsafe(method_family = none)]
1224 pub unsafe fn setAllowedInputSourceLocales(
1225 &self,
1226 allowed_input_source_locales: Option<&NSArray<NSString>>,
1227 );
1228
1229 #[unsafe(method(isWritingToolsActive))]
1230 #[unsafe(method_family = none)]
1231 pub unsafe fn isWritingToolsActive(&self) -> bool;
1232
1233 #[cfg(feature = "NSTextCheckingClient")]
1234 #[unsafe(method(writingToolsBehavior))]
1235 #[unsafe(method_family = none)]
1236 pub unsafe fn writingToolsBehavior(&self) -> NSWritingToolsBehavior;
1237
1238 #[cfg(feature = "NSTextCheckingClient")]
1239 #[unsafe(method(setWritingToolsBehavior:))]
1241 #[unsafe(method_family = none)]
1242 pub unsafe fn setWritingToolsBehavior(
1243 &self,
1244 writing_tools_behavior: NSWritingToolsBehavior,
1245 );
1246
1247 #[cfg(feature = "NSTextCheckingClient")]
1248 #[unsafe(method(allowedWritingToolsResultOptions))]
1249 #[unsafe(method_family = none)]
1250 pub unsafe fn allowedWritingToolsResultOptions(&self) -> NSWritingToolsResultOptions;
1251
1252 #[cfg(feature = "NSTextCheckingClient")]
1253 #[unsafe(method(setAllowedWritingToolsResultOptions:))]
1255 #[unsafe(method_family = none)]
1256 pub unsafe fn setAllowedWritingToolsResultOptions(
1257 &self,
1258 allowed_writing_tools_result_options: NSWritingToolsResultOptions,
1259 );
1260 );
1261}
1262
1263#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
1265impl NSTextView {
1266 extern_methods!(
1267 #[unsafe(method(smartInsertDeleteEnabled))]
1269 #[unsafe(method_family = none)]
1270 pub unsafe fn smartInsertDeleteEnabled(&self) -> bool;
1271
1272 #[unsafe(method(setSmartInsertDeleteEnabled:))]
1274 #[unsafe(method_family = none)]
1275 pub unsafe fn setSmartInsertDeleteEnabled(&self, smart_insert_delete_enabled: bool);
1276
1277 #[unsafe(method(smartDeleteRangeForProposedRange:))]
1278 #[unsafe(method_family = none)]
1279 pub unsafe fn smartDeleteRangeForProposedRange(
1280 &self,
1281 proposed_char_range: NSRange,
1282 ) -> NSRange;
1283
1284 #[unsafe(method(toggleSmartInsertDelete:))]
1285 #[unsafe(method_family = none)]
1286 pub unsafe fn toggleSmartInsertDelete(&self, sender: Option<&AnyObject>);
1287
1288 #[unsafe(method(smartInsertForString:replacingRange:beforeString:afterString:))]
1289 #[unsafe(method_family = none)]
1290 pub unsafe fn smartInsertForString_replacingRange_beforeString_afterString(
1291 &self,
1292 paste_string: &NSString,
1293 char_range_to_replace: NSRange,
1294 before_string: Option<&mut Option<Retained<NSString>>>,
1295 after_string: Option<&mut Option<Retained<NSString>>>,
1296 );
1297
1298 #[unsafe(method(smartInsertBeforeStringForString:replacingRange:))]
1299 #[unsafe(method_family = none)]
1300 pub unsafe fn smartInsertBeforeStringForString_replacingRange(
1301 &self,
1302 paste_string: &NSString,
1303 char_range_to_replace: NSRange,
1304 ) -> Option<Retained<NSString>>;
1305
1306 #[unsafe(method(smartInsertAfterStringForString:replacingRange:))]
1307 #[unsafe(method_family = none)]
1308 pub unsafe fn smartInsertAfterStringForString_replacingRange(
1309 &self,
1310 paste_string: &NSString,
1311 char_range_to_replace: NSRange,
1312 ) -> Option<Retained<NSString>>;
1313
1314 #[unsafe(method(isAutomaticQuoteSubstitutionEnabled))]
1315 #[unsafe(method_family = none)]
1316 pub unsafe fn isAutomaticQuoteSubstitutionEnabled(&self) -> bool;
1317
1318 #[unsafe(method(setAutomaticQuoteSubstitutionEnabled:))]
1320 #[unsafe(method_family = none)]
1321 pub unsafe fn setAutomaticQuoteSubstitutionEnabled(
1322 &self,
1323 automatic_quote_substitution_enabled: bool,
1324 );
1325
1326 #[unsafe(method(toggleAutomaticQuoteSubstitution:))]
1327 #[unsafe(method_family = none)]
1328 pub unsafe fn toggleAutomaticQuoteSubstitution(&self, sender: Option<&AnyObject>);
1329
1330 #[unsafe(method(isAutomaticLinkDetectionEnabled))]
1331 #[unsafe(method_family = none)]
1332 pub unsafe fn isAutomaticLinkDetectionEnabled(&self) -> bool;
1333
1334 #[unsafe(method(setAutomaticLinkDetectionEnabled:))]
1336 #[unsafe(method_family = none)]
1337 pub unsafe fn setAutomaticLinkDetectionEnabled(
1338 &self,
1339 automatic_link_detection_enabled: bool,
1340 );
1341
1342 #[unsafe(method(toggleAutomaticLinkDetection:))]
1343 #[unsafe(method_family = none)]
1344 pub unsafe fn toggleAutomaticLinkDetection(&self, sender: Option<&AnyObject>);
1345
1346 #[unsafe(method(isAutomaticDataDetectionEnabled))]
1347 #[unsafe(method_family = none)]
1348 pub unsafe fn isAutomaticDataDetectionEnabled(&self) -> bool;
1349
1350 #[unsafe(method(setAutomaticDataDetectionEnabled:))]
1352 #[unsafe(method_family = none)]
1353 pub unsafe fn setAutomaticDataDetectionEnabled(
1354 &self,
1355 automatic_data_detection_enabled: bool,
1356 );
1357
1358 #[unsafe(method(toggleAutomaticDataDetection:))]
1359 #[unsafe(method_family = none)]
1360 pub unsafe fn toggleAutomaticDataDetection(&self, sender: Option<&AnyObject>);
1361
1362 #[unsafe(method(isAutomaticDashSubstitutionEnabled))]
1363 #[unsafe(method_family = none)]
1364 pub unsafe fn isAutomaticDashSubstitutionEnabled(&self) -> bool;
1365
1366 #[unsafe(method(setAutomaticDashSubstitutionEnabled:))]
1368 #[unsafe(method_family = none)]
1369 pub unsafe fn setAutomaticDashSubstitutionEnabled(
1370 &self,
1371 automatic_dash_substitution_enabled: bool,
1372 );
1373
1374 #[unsafe(method(toggleAutomaticDashSubstitution:))]
1375 #[unsafe(method_family = none)]
1376 pub unsafe fn toggleAutomaticDashSubstitution(&self, sender: Option<&AnyObject>);
1377
1378 #[unsafe(method(isAutomaticTextReplacementEnabled))]
1379 #[unsafe(method_family = none)]
1380 pub unsafe fn isAutomaticTextReplacementEnabled(&self) -> bool;
1381
1382 #[unsafe(method(setAutomaticTextReplacementEnabled:))]
1384 #[unsafe(method_family = none)]
1385 pub unsafe fn setAutomaticTextReplacementEnabled(
1386 &self,
1387 automatic_text_replacement_enabled: bool,
1388 );
1389
1390 #[unsafe(method(toggleAutomaticTextReplacement:))]
1391 #[unsafe(method_family = none)]
1392 pub unsafe fn toggleAutomaticTextReplacement(&self, sender: Option<&AnyObject>);
1393
1394 #[unsafe(method(isAutomaticSpellingCorrectionEnabled))]
1395 #[unsafe(method_family = none)]
1396 pub unsafe fn isAutomaticSpellingCorrectionEnabled(&self) -> bool;
1397
1398 #[unsafe(method(setAutomaticSpellingCorrectionEnabled:))]
1400 #[unsafe(method_family = none)]
1401 pub unsafe fn setAutomaticSpellingCorrectionEnabled(
1402 &self,
1403 automatic_spelling_correction_enabled: bool,
1404 );
1405
1406 #[unsafe(method(toggleAutomaticSpellingCorrection:))]
1407 #[unsafe(method_family = none)]
1408 pub unsafe fn toggleAutomaticSpellingCorrection(&self, sender: Option<&AnyObject>);
1409
1410 #[unsafe(method(enabledTextCheckingTypes))]
1411 #[unsafe(method_family = none)]
1412 pub unsafe fn enabledTextCheckingTypes(&self) -> NSTextCheckingTypes;
1413
1414 #[unsafe(method(setEnabledTextCheckingTypes:))]
1416 #[unsafe(method_family = none)]
1417 pub unsafe fn setEnabledTextCheckingTypes(
1418 &self,
1419 enabled_text_checking_types: NSTextCheckingTypes,
1420 );
1421
1422 #[cfg(feature = "NSSpellChecker")]
1423 #[unsafe(method(checkTextInRange:types:options:))]
1424 #[unsafe(method_family = none)]
1425 pub unsafe fn checkTextInRange_types_options(
1426 &self,
1427 range: NSRange,
1428 checking_types: NSTextCheckingTypes,
1429 options: &NSDictionary<NSTextCheckingOptionKey, AnyObject>,
1430 );
1431
1432 #[cfg(feature = "NSSpellChecker")]
1433 #[unsafe(method(handleTextCheckingResults:forRange:types:options:orthography:wordCount:))]
1434 #[unsafe(method_family = none)]
1435 pub unsafe fn handleTextCheckingResults_forRange_types_options_orthography_wordCount(
1436 &self,
1437 results: &NSArray<NSTextCheckingResult>,
1438 range: NSRange,
1439 checking_types: NSTextCheckingTypes,
1440 options: &NSDictionary<NSTextCheckingOptionKey, AnyObject>,
1441 orthography: &NSOrthography,
1442 word_count: NSInteger,
1443 );
1444
1445 #[unsafe(method(orderFrontSubstitutionsPanel:))]
1446 #[unsafe(method_family = none)]
1447 pub unsafe fn orderFrontSubstitutionsPanel(&self, sender: Option<&AnyObject>);
1448
1449 #[unsafe(method(checkTextInSelection:))]
1450 #[unsafe(method_family = none)]
1451 pub unsafe fn checkTextInSelection(&self, sender: Option<&AnyObject>);
1452
1453 #[unsafe(method(checkTextInDocument:))]
1454 #[unsafe(method_family = none)]
1455 pub unsafe fn checkTextInDocument(&self, sender: Option<&AnyObject>);
1456
1457 #[unsafe(method(usesFindPanel))]
1458 #[unsafe(method_family = none)]
1459 pub unsafe fn usesFindPanel(&self) -> bool;
1460
1461 #[unsafe(method(setUsesFindPanel:))]
1463 #[unsafe(method_family = none)]
1464 pub unsafe fn setUsesFindPanel(&self, uses_find_panel: bool);
1465
1466 #[unsafe(method(usesFindBar))]
1467 #[unsafe(method_family = none)]
1468 pub unsafe fn usesFindBar(&self) -> bool;
1469
1470 #[unsafe(method(setUsesFindBar:))]
1472 #[unsafe(method_family = none)]
1473 pub unsafe fn setUsesFindBar(&self, uses_find_bar: bool);
1474
1475 #[unsafe(method(isIncrementalSearchingEnabled))]
1476 #[unsafe(method_family = none)]
1477 pub unsafe fn isIncrementalSearchingEnabled(&self) -> bool;
1478
1479 #[unsafe(method(setIncrementalSearchingEnabled:))]
1481 #[unsafe(method_family = none)]
1482 pub unsafe fn setIncrementalSearchingEnabled(&self, incremental_searching_enabled: bool);
1483
1484 #[cfg(feature = "NSTextCheckingClient")]
1485 #[unsafe(method(inlinePredictionType))]
1486 #[unsafe(method_family = none)]
1487 pub unsafe fn inlinePredictionType(&self) -> NSTextInputTraitType;
1488
1489 #[cfg(feature = "NSTextCheckingClient")]
1490 #[unsafe(method(setInlinePredictionType:))]
1492 #[unsafe(method_family = none)]
1493 pub unsafe fn setInlinePredictionType(&self, inline_prediction_type: NSTextInputTraitType);
1494
1495 #[cfg(feature = "NSTextCheckingClient")]
1496 #[unsafe(method(mathExpressionCompletionType))]
1497 #[unsafe(method_family = none)]
1498 pub unsafe fn mathExpressionCompletionType(&self) -> NSTextInputTraitType;
1499
1500 #[cfg(feature = "NSTextCheckingClient")]
1501 #[unsafe(method(setMathExpressionCompletionType:))]
1503 #[unsafe(method_family = none)]
1504 pub unsafe fn setMathExpressionCompletionType(
1505 &self,
1506 math_expression_completion_type: NSTextInputTraitType,
1507 );
1508 );
1509}
1510
1511#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
1513impl NSTextView {
1514 extern_methods!(
1515 #[unsafe(method(toggleQuickLookPreviewPanel:))]
1517 #[unsafe(method_family = none)]
1518 pub unsafe fn toggleQuickLookPreviewPanel(&self, sender: Option<&AnyObject>);
1519
1520 #[unsafe(method(updateQuickLookPreviewPanel))]
1521 #[unsafe(method_family = none)]
1522 pub unsafe fn updateQuickLookPreviewPanel(&self);
1523 );
1524}
1525
1526#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
1528impl NSTextView {
1529 extern_methods!(
1530 #[unsafe(method(orderFrontSharingServicePicker:))]
1532 #[unsafe(method_family = none)]
1533 pub unsafe fn orderFrontSharingServicePicker(&self, sender: Option<&AnyObject>);
1534 );
1535}
1536
1537#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
1539impl NSTextView {
1540 extern_methods!(
1541 #[unsafe(method(isAutomaticTextCompletionEnabled))]
1542 #[unsafe(method_family = none)]
1543 pub unsafe fn isAutomaticTextCompletionEnabled(&self) -> bool;
1544
1545 #[unsafe(method(setAutomaticTextCompletionEnabled:))]
1547 #[unsafe(method_family = none)]
1548 pub unsafe fn setAutomaticTextCompletionEnabled(
1549 &self,
1550 automatic_text_completion_enabled: bool,
1551 );
1552
1553 #[unsafe(method(toggleAutomaticTextCompletion:))]
1554 #[unsafe(method_family = none)]
1555 pub unsafe fn toggleAutomaticTextCompletion(&self, sender: Option<&AnyObject>);
1556
1557 #[unsafe(method(allowsCharacterPickerTouchBarItem))]
1558 #[unsafe(method_family = none)]
1559 pub unsafe fn allowsCharacterPickerTouchBarItem(&self) -> bool;
1560
1561 #[unsafe(method(setAllowsCharacterPickerTouchBarItem:))]
1563 #[unsafe(method_family = none)]
1564 pub unsafe fn setAllowsCharacterPickerTouchBarItem(
1565 &self,
1566 allows_character_picker_touch_bar_item: bool,
1567 );
1568
1569 #[unsafe(method(updateTouchBarItemIdentifiers))]
1570 #[unsafe(method_family = none)]
1571 pub unsafe fn updateTouchBarItemIdentifiers(&self);
1572
1573 #[unsafe(method(updateTextTouchBarItems))]
1574 #[unsafe(method_family = none)]
1575 pub unsafe fn updateTextTouchBarItems(&self);
1576
1577 #[unsafe(method(updateCandidates))]
1578 #[unsafe(method_family = none)]
1579 pub unsafe fn updateCandidates(&self);
1580
1581 #[cfg(all(feature = "NSCandidateListTouchBarItem", feature = "NSTouchBarItem"))]
1582 #[unsafe(method(candidateListTouchBarItem))]
1583 #[unsafe(method_family = none)]
1584 pub unsafe fn candidateListTouchBarItem(
1585 &self,
1586 ) -> Option<Retained<NSCandidateListTouchBarItem>>;
1587 );
1588}
1589
1590#[cfg(all(
1591 feature = "NSCandidateListTouchBarItem",
1592 feature = "NSResponder",
1593 feature = "NSText",
1594 feature = "NSView"
1595))]
1596extern_conformance!(
1597 unsafe impl NSCandidateListTouchBarItemDelegate for NSTextView {}
1598);
1599
1600#[cfg(all(
1601 feature = "NSResponder",
1602 feature = "NSText",
1603 feature = "NSTouchBar",
1604 feature = "NSView"
1605))]
1606extern_conformance!(
1607 unsafe impl NSTouchBarDelegate for NSTextView {}
1608);
1609
1610#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
1612impl NSTextView {
1613 extern_methods!(
1614 #[cfg(feature = "NSScrollView")]
1615 #[unsafe(method(scrollableTextView))]
1616 #[unsafe(method_family = none)]
1617 pub unsafe fn scrollableTextView(mtm: MainThreadMarker) -> Retained<NSScrollView>;
1618
1619 #[unsafe(method(fieldEditor))]
1620 #[unsafe(method_family = none)]
1621 pub unsafe fn fieldEditor(mtm: MainThreadMarker) -> Retained<Self>;
1622
1623 #[cfg(feature = "NSScrollView")]
1624 #[unsafe(method(scrollableDocumentContentTextView))]
1625 #[unsafe(method_family = none)]
1626 pub unsafe fn scrollableDocumentContentTextView(
1627 mtm: MainThreadMarker,
1628 ) -> Retained<NSScrollView>;
1629
1630 #[cfg(feature = "NSScrollView")]
1631 #[unsafe(method(scrollablePlainDocumentContentTextView))]
1632 #[unsafe(method_family = none)]
1633 pub unsafe fn scrollablePlainDocumentContentTextView(
1634 mtm: MainThreadMarker,
1635 ) -> Retained<NSScrollView>;
1636 );
1637}
1638
1639#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
1641impl NSTextView {
1642 extern_methods!(
1643 #[unsafe(method(textHighlightAttributes))]
1645 #[unsafe(method_family = none)]
1646 pub unsafe fn textHighlightAttributes(
1647 &self,
1648 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
1649
1650 #[unsafe(method(setTextHighlightAttributes:))]
1652 #[unsafe(method_family = none)]
1653 pub unsafe fn setTextHighlightAttributes(
1654 &self,
1655 text_highlight_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
1656 );
1657
1658 #[cfg(feature = "NSTextRange")]
1659 #[unsafe(method(drawTextHighlightBackgroundForTextRange:origin:))]
1660 #[unsafe(method_family = none)]
1661 pub unsafe fn drawTextHighlightBackgroundForTextRange_origin(
1662 &self,
1663 text_range: &NSTextRange,
1664 origin: NSPoint,
1665 );
1666
1667 #[unsafe(method(highlight:))]
1670 #[unsafe(method_family = none)]
1671 pub unsafe fn highlight(&self, sender: Option<&AnyObject>);
1672 );
1673}
1674
1675#[cfg(all(feature = "NSResponder", feature = "NSText", feature = "NSView"))]
1677impl NSTextView {
1678 extern_methods!(
1679 #[deprecated = "Use NSResponder's makeBaseWritingDirectionNatural:, makeBaseWritingDirectionLeftToRight:, and makeBaseWritingDirectionRightToLeft: instead"]
1680 #[unsafe(method(toggleBaseWritingDirection:))]
1681 #[unsafe(method_family = none)]
1682 pub unsafe fn toggleBaseWritingDirection(&self, sender: Option<&AnyObject>);
1683 );
1684}
1685
1686extern_protocol!(
1687 #[cfg(feature = "NSText")]
1689 pub unsafe trait NSTextViewDelegate: NSTextDelegate {
1690 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1691 #[optional]
1692 #[unsafe(method(textView:clickedOnLink:atIndex:))]
1693 #[unsafe(method_family = none)]
1694 unsafe fn textView_clickedOnLink_atIndex(
1695 &self,
1696 text_view: &NSTextView,
1697 link: &AnyObject,
1698 char_index: NSUInteger,
1699 ) -> bool;
1700
1701 #[cfg(all(
1702 feature = "NSResponder",
1703 feature = "NSTextAttachmentCell",
1704 feature = "NSView"
1705 ))]
1706 #[optional]
1707 #[unsafe(method(textView:clickedOnCell:inRect:atIndex:))]
1708 #[unsafe(method_family = none)]
1709 unsafe fn textView_clickedOnCell_inRect_atIndex(
1710 &self,
1711 text_view: &NSTextView,
1712 cell: &ProtocolObject<dyn NSTextAttachmentCellProtocol>,
1713 cell_frame: NSRect,
1714 char_index: NSUInteger,
1715 );
1716
1717 #[cfg(all(
1718 feature = "NSResponder",
1719 feature = "NSTextAttachmentCell",
1720 feature = "NSView"
1721 ))]
1722 #[optional]
1723 #[unsafe(method(textView:doubleClickedOnCell:inRect:atIndex:))]
1724 #[unsafe(method_family = none)]
1725 unsafe fn textView_doubleClickedOnCell_inRect_atIndex(
1726 &self,
1727 text_view: &NSTextView,
1728 cell: &ProtocolObject<dyn NSTextAttachmentCellProtocol>,
1729 cell_frame: NSRect,
1730 char_index: NSUInteger,
1731 );
1732
1733 #[cfg(all(
1734 feature = "NSEvent",
1735 feature = "NSResponder",
1736 feature = "NSTextAttachmentCell",
1737 feature = "NSView"
1738 ))]
1739 #[optional]
1740 #[unsafe(method(textView:draggedCell:inRect:event:atIndex:))]
1741 #[unsafe(method_family = none)]
1742 unsafe fn textView_draggedCell_inRect_event_atIndex(
1743 &self,
1744 view: &NSTextView,
1745 cell: &ProtocolObject<dyn NSTextAttachmentCellProtocol>,
1746 rect: NSRect,
1747 event: &NSEvent,
1748 char_index: NSUInteger,
1749 );
1750
1751 #[cfg(all(
1752 feature = "NSPasteboard",
1753 feature = "NSResponder",
1754 feature = "NSTextAttachmentCell",
1755 feature = "NSView"
1756 ))]
1757 #[optional]
1758 #[unsafe(method(textView:writablePasteboardTypesForCell:atIndex:))]
1759 #[unsafe(method_family = none)]
1760 unsafe fn textView_writablePasteboardTypesForCell_atIndex(
1761 &self,
1762 view: &NSTextView,
1763 cell: &ProtocolObject<dyn NSTextAttachmentCellProtocol>,
1764 char_index: NSUInteger,
1765 ) -> Retained<NSArray<NSPasteboardType>>;
1766
1767 #[cfg(all(
1768 feature = "NSPasteboard",
1769 feature = "NSResponder",
1770 feature = "NSTextAttachmentCell",
1771 feature = "NSView"
1772 ))]
1773 #[optional]
1774 #[unsafe(method(textView:writeCell:atIndex:toPasteboard:type:))]
1775 #[unsafe(method_family = none)]
1776 unsafe fn textView_writeCell_atIndex_toPasteboard_type(
1777 &self,
1778 view: &NSTextView,
1779 cell: &ProtocolObject<dyn NSTextAttachmentCellProtocol>,
1780 char_index: NSUInteger,
1781 pboard: &NSPasteboard,
1782 r#type: &NSPasteboardType,
1783 ) -> bool;
1784
1785 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1786 #[optional]
1787 #[unsafe(method(textView:willChangeSelectionFromCharacterRange:toCharacterRange:))]
1788 #[unsafe(method_family = none)]
1789 unsafe fn textView_willChangeSelectionFromCharacterRange_toCharacterRange(
1790 &self,
1791 text_view: &NSTextView,
1792 old_selected_char_range: NSRange,
1793 new_selected_char_range: NSRange,
1794 ) -> NSRange;
1795
1796 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1797 #[optional]
1798 #[unsafe(method(textView:willChangeSelectionFromCharacterRanges:toCharacterRanges:))]
1799 #[unsafe(method_family = none)]
1800 unsafe fn textView_willChangeSelectionFromCharacterRanges_toCharacterRanges(
1801 &self,
1802 text_view: &NSTextView,
1803 old_selected_char_ranges: &NSArray<NSValue>,
1804 new_selected_char_ranges: &NSArray<NSValue>,
1805 ) -> Retained<NSArray<NSValue>>;
1806
1807 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1808 #[optional]
1809 #[unsafe(method(textView:shouldChangeTextInRanges:replacementStrings:))]
1810 #[unsafe(method_family = none)]
1811 unsafe fn textView_shouldChangeTextInRanges_replacementStrings(
1812 &self,
1813 text_view: &NSTextView,
1814 affected_ranges: &NSArray<NSValue>,
1815 replacement_strings: Option<&NSArray<NSString>>,
1816 ) -> bool;
1817
1818 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1819 #[optional]
1820 #[unsafe(method(textView:shouldChangeTypingAttributes:toAttributes:))]
1821 #[unsafe(method_family = none)]
1822 unsafe fn textView_shouldChangeTypingAttributes_toAttributes(
1823 &self,
1824 text_view: &NSTextView,
1825 old_typing_attributes: &NSDictionary<NSString, AnyObject>,
1826 new_typing_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
1827 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
1828
1829 #[optional]
1830 #[unsafe(method(textViewDidChangeSelection:))]
1831 #[unsafe(method_family = none)]
1832 unsafe fn textViewDidChangeSelection(&self, notification: &NSNotification);
1833
1834 #[optional]
1835 #[unsafe(method(textViewDidChangeTypingAttributes:))]
1836 #[unsafe(method_family = none)]
1837 unsafe fn textViewDidChangeTypingAttributes(&self, notification: &NSNotification);
1838
1839 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1840 #[optional]
1841 #[unsafe(method(textView:willDisplayToolTip:forCharacterAtIndex:))]
1842 #[unsafe(method_family = none)]
1843 unsafe fn textView_willDisplayToolTip_forCharacterAtIndex(
1844 &self,
1845 text_view: &NSTextView,
1846 tooltip: &NSString,
1847 character_index: NSUInteger,
1848 ) -> Option<Retained<NSString>>;
1849
1850 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1851 #[optional]
1852 #[unsafe(method(textView:completions:forPartialWordRange:indexOfSelectedItem:))]
1853 #[unsafe(method_family = none)]
1854 unsafe fn textView_completions_forPartialWordRange_indexOfSelectedItem(
1855 &self,
1856 text_view: &NSTextView,
1857 words: &NSArray<NSString>,
1858 char_range: NSRange,
1859 index: *mut NSInteger,
1860 ) -> Retained<NSArray<NSString>>;
1861
1862 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1863 #[optional]
1864 #[unsafe(method(textView:shouldChangeTextInRange:replacementString:))]
1865 #[unsafe(method_family = none)]
1866 unsafe fn textView_shouldChangeTextInRange_replacementString(
1867 &self,
1868 text_view: &NSTextView,
1869 affected_char_range: NSRange,
1870 replacement_string: Option<&NSString>,
1871 ) -> bool;
1872
1873 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1874 #[optional]
1875 #[unsafe(method(textView:doCommandBySelector:))]
1876 #[unsafe(method_family = none)]
1877 unsafe fn textView_doCommandBySelector(
1878 &self,
1879 text_view: &NSTextView,
1880 command_selector: Sel,
1881 ) -> bool;
1882
1883 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1884 #[optional]
1885 #[unsafe(method(textView:shouldSetSpellingState:range:))]
1886 #[unsafe(method_family = none)]
1887 unsafe fn textView_shouldSetSpellingState_range(
1888 &self,
1889 text_view: &NSTextView,
1890 value: NSInteger,
1891 affected_char_range: NSRange,
1892 ) -> NSInteger;
1893
1894 #[cfg(all(
1895 feature = "NSEvent",
1896 feature = "NSMenu",
1897 feature = "NSResponder",
1898 feature = "NSView"
1899 ))]
1900 #[optional]
1901 #[unsafe(method(textView:menu:forEvent:atIndex:))]
1902 #[unsafe(method_family = none)]
1903 unsafe fn textView_menu_forEvent_atIndex(
1904 &self,
1905 view: &NSTextView,
1906 menu: &NSMenu,
1907 event: &NSEvent,
1908 char_index: NSUInteger,
1909 ) -> Option<Retained<NSMenu>>;
1910
1911 #[cfg(all(
1912 feature = "NSResponder",
1913 feature = "NSSpellChecker",
1914 feature = "NSView"
1915 ))]
1916 #[optional]
1917 #[unsafe(method(textView:willCheckTextInRange:options:types:))]
1918 #[unsafe(method_family = none)]
1919 unsafe fn textView_willCheckTextInRange_options_types(
1920 &self,
1921 view: &NSTextView,
1922 range: NSRange,
1923 options: &NSDictionary<NSTextCheckingOptionKey, AnyObject>,
1924 checking_types: NonNull<NSTextCheckingTypes>,
1925 ) -> Retained<NSDictionary<NSTextCheckingOptionKey, AnyObject>>;
1926
1927 #[cfg(all(
1928 feature = "NSResponder",
1929 feature = "NSSpellChecker",
1930 feature = "NSView"
1931 ))]
1932 #[optional]
1933 #[unsafe(method(textView:didCheckTextInRange:types:options:results:orthography:wordCount:))]
1934 #[unsafe(method_family = none)]
1935 unsafe fn textView_didCheckTextInRange_types_options_results_orthography_wordCount(
1936 &self,
1937 view: &NSTextView,
1938 range: NSRange,
1939 checking_types: NSTextCheckingTypes,
1940 options: &NSDictionary<NSTextCheckingOptionKey, AnyObject>,
1941 results: &NSArray<NSTextCheckingResult>,
1942 orthography: &NSOrthography,
1943 word_count: NSInteger,
1944 ) -> Retained<NSArray<NSTextCheckingResult>>;
1945
1946 #[cfg(all(
1947 feature = "NSResponder",
1948 feature = "NSTextAttachment",
1949 feature = "NSView"
1950 ))]
1951 #[optional]
1952 #[unsafe(method(textView:URLForContentsOfTextAttachment:atIndex:))]
1953 #[unsafe(method_family = none)]
1954 unsafe fn textView_URLForContentsOfTextAttachment_atIndex(
1955 &self,
1956 text_view: &NSTextView,
1957 text_attachment: &NSTextAttachment,
1958 char_index: NSUInteger,
1959 ) -> Option<Retained<NSURL>>;
1960
1961 #[cfg(all(
1962 feature = "NSResponder",
1963 feature = "NSSharingService",
1964 feature = "NSView"
1965 ))]
1966 #[optional]
1967 #[unsafe(method(textView:willShowSharingServicePicker:forItems:))]
1968 #[unsafe(method_family = none)]
1969 unsafe fn textView_willShowSharingServicePicker_forItems(
1970 &self,
1971 text_view: &NSTextView,
1972 service_picker: &NSSharingServicePicker,
1973 items: &NSArray,
1974 ) -> Option<Retained<NSSharingServicePicker>>;
1975
1976 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1977 #[optional]
1978 #[unsafe(method(undoManagerForTextView:))]
1979 #[unsafe(method_family = none)]
1980 unsafe fn undoManagerForTextView(
1981 &self,
1982 view: &NSTextView,
1983 ) -> Option<Retained<NSUndoManager>>;
1984
1985 #[cfg(all(
1986 feature = "NSResponder",
1987 feature = "NSTouchBarItem",
1988 feature = "NSView"
1989 ))]
1990 #[optional]
1991 #[unsafe(method(textView:shouldUpdateTouchBarItemIdentifiers:))]
1992 #[unsafe(method_family = none)]
1993 unsafe fn textView_shouldUpdateTouchBarItemIdentifiers(
1994 &self,
1995 text_view: &NSTextView,
1996 identifiers: &NSArray<NSTouchBarItemIdentifier>,
1997 ) -> Retained<NSArray<NSTouchBarItemIdentifier>>;
1998
1999 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
2000 #[optional]
2001 #[unsafe(method(textView:candidatesForSelectedRange:))]
2002 #[unsafe(method_family = none)]
2003 unsafe fn textView_candidatesForSelectedRange(
2004 &self,
2005 text_view: &NSTextView,
2006 selected_range: NSRange,
2007 ) -> Option<Retained<NSArray>>;
2008
2009 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
2010 #[optional]
2011 #[unsafe(method(textView:candidates:forSelectedRange:))]
2012 #[unsafe(method_family = none)]
2013 unsafe fn textView_candidates_forSelectedRange(
2014 &self,
2015 text_view: &NSTextView,
2016 candidates: &NSArray<NSTextCheckingResult>,
2017 selected_range: NSRange,
2018 ) -> Retained<NSArray<NSTextCheckingResult>>;
2019
2020 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
2021 #[optional]
2022 #[unsafe(method(textView:shouldSelectCandidateAtIndex:))]
2023 #[unsafe(method_family = none)]
2024 unsafe fn textView_shouldSelectCandidateAtIndex(
2025 &self,
2026 text_view: &NSTextView,
2027 index: NSUInteger,
2028 ) -> bool;
2029
2030 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
2031 #[optional]
2032 #[unsafe(method(textViewWritingToolsWillBegin:))]
2033 #[unsafe(method_family = none)]
2034 unsafe fn textViewWritingToolsWillBegin(&self, text_view: &NSTextView);
2035
2036 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
2037 #[optional]
2038 #[unsafe(method(textViewWritingToolsDidEnd:))]
2039 #[unsafe(method_family = none)]
2040 unsafe fn textViewWritingToolsDidEnd(&self, text_view: &NSTextView);
2041
2042 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
2043 #[optional]
2044 #[unsafe(method(textView:writingToolsIgnoredRangesInEnclosingRange:))]
2045 #[unsafe(method_family = none)]
2046 unsafe fn textView_writingToolsIgnoredRangesInEnclosingRange(
2047 &self,
2048 text_view: &NSTextView,
2049 enclosing_range: NSRange,
2050 ) -> Retained<NSArray<NSValue>>;
2051
2052 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
2053 #[deprecated = "Use -textView:clickedOnLink:atIndex: instead"]
2054 #[optional]
2055 #[unsafe(method(textView:clickedOnLink:))]
2056 #[unsafe(method_family = none)]
2057 unsafe fn textView_clickedOnLink(
2058 &self,
2059 text_view: &NSTextView,
2060 link: Option<&AnyObject>,
2061 ) -> bool;
2062
2063 #[cfg(all(
2064 feature = "NSResponder",
2065 feature = "NSTextAttachmentCell",
2066 feature = "NSView"
2067 ))]
2068 #[deprecated = "Use -textView:clickedOnCell:inRect:atIndex: instead"]
2069 #[optional]
2070 #[unsafe(method(textView:clickedOnCell:inRect:))]
2071 #[unsafe(method_family = none)]
2072 unsafe fn textView_clickedOnCell_inRect(
2073 &self,
2074 text_view: &NSTextView,
2075 cell: Option<&ProtocolObject<dyn NSTextAttachmentCellProtocol>>,
2076 cell_frame: NSRect,
2077 );
2078
2079 #[cfg(all(
2080 feature = "NSResponder",
2081 feature = "NSTextAttachmentCell",
2082 feature = "NSView"
2083 ))]
2084 #[deprecated = "Use -textView:doubleClickedOnCell:inRect:atIndex: instead"]
2085 #[optional]
2086 #[unsafe(method(textView:doubleClickedOnCell:inRect:))]
2087 #[unsafe(method_family = none)]
2088 unsafe fn textView_doubleClickedOnCell_inRect(
2089 &self,
2090 text_view: &NSTextView,
2091 cell: Option<&ProtocolObject<dyn NSTextAttachmentCellProtocol>>,
2092 cell_frame: NSRect,
2093 );
2094
2095 #[cfg(all(
2096 feature = "NSEvent",
2097 feature = "NSResponder",
2098 feature = "NSTextAttachmentCell",
2099 feature = "NSView"
2100 ))]
2101 #[deprecated = "Use -textView:draggedCell:inRect:event:atIndex: instead"]
2102 #[optional]
2103 #[unsafe(method(textView:draggedCell:inRect:event:))]
2104 #[unsafe(method_family = none)]
2105 unsafe fn textView_draggedCell_inRect_event(
2106 &self,
2107 view: &NSTextView,
2108 cell: Option<&ProtocolObject<dyn NSTextAttachmentCellProtocol>>,
2109 rect: NSRect,
2110 event: Option<&NSEvent>,
2111 );
2112 }
2113);
2114
2115extern "C" {
2116 #[cfg(feature = "NSTouchBarItem")]
2118 pub static NSTouchBarItemIdentifierCharacterPicker: &'static NSTouchBarItemIdentifier;
2119}
2120
2121extern "C" {
2122 #[cfg(feature = "NSTouchBarItem")]
2124 pub static NSTouchBarItemIdentifierTextColorPicker: &'static NSTouchBarItemIdentifier;
2125}
2126
2127extern "C" {
2128 #[cfg(feature = "NSTouchBarItem")]
2130 pub static NSTouchBarItemIdentifierTextStyle: &'static NSTouchBarItemIdentifier;
2131}
2132
2133extern "C" {
2134 #[cfg(feature = "NSTouchBarItem")]
2136 pub static NSTouchBarItemIdentifierTextAlignment: &'static NSTouchBarItemIdentifier;
2137}
2138
2139extern "C" {
2140 #[cfg(feature = "NSTouchBarItem")]
2142 pub static NSTouchBarItemIdentifierTextList: &'static NSTouchBarItemIdentifier;
2143}
2144
2145extern "C" {
2146 #[cfg(feature = "NSTouchBarItem")]
2148 pub static NSTouchBarItemIdentifierTextFormat: &'static NSTouchBarItemIdentifier;
2149}
2150
2151extern "C" {
2152 pub static NSTextViewWillChangeNotifyingTextViewNotification: &'static NSNotificationName;
2154}
2155
2156extern "C" {
2157 pub static NSTextViewDidChangeSelectionNotification: &'static NSNotificationName;
2159}
2160
2161extern "C" {
2162 pub static NSTextViewDidChangeTypingAttributesNotification: &'static NSNotificationName;
2164}
2165
2166extern "C" {
2167 pub static NSTextViewWillSwitchToNSLayoutManagerNotification: &'static NSNotificationName;
2169}
2170
2171extern "C" {
2172 pub static NSTextViewDidSwitchToNSLayoutManagerNotification: &'static NSNotificationName;
2174}
2175
2176#[repr(transparent)]
2179#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2180pub struct NSFindPanelAction(pub NSUInteger);
2181impl NSFindPanelAction {
2182 #[doc(alias = "NSFindPanelActionShowFindPanel")]
2183 pub const ShowFindPanel: Self = Self(1);
2184 #[doc(alias = "NSFindPanelActionNext")]
2185 pub const Next: Self = Self(2);
2186 #[doc(alias = "NSFindPanelActionPrevious")]
2187 pub const Previous: Self = Self(3);
2188 #[doc(alias = "NSFindPanelActionReplaceAll")]
2189 pub const ReplaceAll: Self = Self(4);
2190 #[doc(alias = "NSFindPanelActionReplace")]
2191 pub const Replace: Self = Self(5);
2192 #[doc(alias = "NSFindPanelActionReplaceAndFind")]
2193 pub const ReplaceAndFind: Self = Self(6);
2194 #[doc(alias = "NSFindPanelActionSetFindString")]
2195 pub const SetFindString: Self = Self(7);
2196 #[doc(alias = "NSFindPanelActionReplaceAllInSelection")]
2197 pub const ReplaceAllInSelection: Self = Self(8);
2198 #[doc(alias = "NSFindPanelActionSelectAll")]
2199 pub const SelectAll: Self = Self(9);
2200 #[doc(alias = "NSFindPanelActionSelectAllInSelection")]
2201 pub const SelectAllInSelection: Self = Self(10);
2202}
2203
2204unsafe impl Encode for NSFindPanelAction {
2205 const ENCODING: Encoding = NSUInteger::ENCODING;
2206}
2207
2208unsafe impl RefEncode for NSFindPanelAction {
2209 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2210}
2211
2212extern "C" {
2213 #[cfg(feature = "NSPasteboard")]
2215 pub static NSFindPanelSearchOptionsPboardType: &'static NSPasteboardType;
2216}
2217
2218pub type NSPasteboardTypeFindPanelSearchOptionKey = NSString;
2221
2222extern "C" {
2223 pub static NSFindPanelCaseInsensitiveSearch: &'static NSPasteboardTypeFindPanelSearchOptionKey;
2225}
2226
2227extern "C" {
2228 pub static NSFindPanelSubstringMatch: &'static NSPasteboardTypeFindPanelSearchOptionKey;
2230}
2231
2232#[repr(transparent)]
2235#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
2236pub struct NSFindPanelSubstringMatchType(pub NSUInteger);
2237impl NSFindPanelSubstringMatchType {
2238 #[doc(alias = "NSFindPanelSubstringMatchTypeContains")]
2239 pub const Contains: Self = Self(0);
2240 #[doc(alias = "NSFindPanelSubstringMatchTypeStartsWith")]
2241 pub const StartsWith: Self = Self(1);
2242 #[doc(alias = "NSFindPanelSubstringMatchTypeFullWord")]
2243 pub const FullWord: Self = Self(2);
2244 #[doc(alias = "NSFindPanelSubstringMatchTypeEndsWith")]
2245 pub const EndsWith: Self = Self(3);
2246}
2247
2248unsafe impl Encode for NSFindPanelSubstringMatchType {
2249 const ENCODING: Encoding = NSUInteger::ENCODING;
2250}
2251
2252unsafe impl RefEncode for NSFindPanelSubstringMatchType {
2253 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
2254}