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