1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
13 #[thread_kind = MainThreadOnly]
14 #[derive(Debug, PartialEq, Eq, Hash)]
15 pub struct NSResponder;
16);
17
18extern_conformance!(
19 unsafe impl NSCoding for NSResponder {}
20);
21
22extern_conformance!(
23 unsafe impl NSObjectProtocol for NSResponder {}
24);
25
26impl NSResponder {
27 extern_methods!(
28 #[unsafe(method(init))]
29 #[unsafe(method_family = init)]
30 pub fn init(this: Allocated<Self>) -> Retained<Self>;
31
32 #[unsafe(method(initWithCoder:))]
36 #[unsafe(method_family = init)]
37 pub unsafe fn initWithCoder(
38 this: Allocated<Self>,
39 coder: &NSCoder,
40 ) -> Option<Retained<Self>>;
41
42 #[unsafe(method(nextResponder))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn nextResponder(&self) -> Option<Retained<NSResponder>>;
48
49 #[unsafe(method(setNextResponder:))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn setNextResponder(&self, next_responder: Option<&NSResponder>);
57
58 #[unsafe(method(tryToPerform:with:))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn tryToPerform_with(&self, action: Sel, object: Option<&AnyObject>) -> bool;
65
66 #[cfg(feature = "NSEvent")]
67 #[unsafe(method(performKeyEquivalent:))]
68 #[unsafe(method_family = none)]
69 pub fn performKeyEquivalent(&self, event: &NSEvent) -> bool;
70
71 #[cfg(feature = "NSPasteboard")]
72 #[unsafe(method(validRequestorForSendType:returnType:))]
73 #[unsafe(method_family = none)]
74 pub fn validRequestorForSendType_returnType(
75 &self,
76 send_type: Option<&NSPasteboardType>,
77 return_type: Option<&NSPasteboardType>,
78 ) -> Option<Retained<AnyObject>>;
79
80 #[cfg(feature = "NSEvent")]
81 #[unsafe(method(mouseDown:))]
82 #[unsafe(method_family = none)]
83 pub fn mouseDown(&self, event: &NSEvent);
84
85 #[cfg(feature = "NSEvent")]
86 #[unsafe(method(rightMouseDown:))]
87 #[unsafe(method_family = none)]
88 pub fn rightMouseDown(&self, event: &NSEvent);
89
90 #[cfg(feature = "NSEvent")]
91 #[unsafe(method(otherMouseDown:))]
92 #[unsafe(method_family = none)]
93 pub fn otherMouseDown(&self, event: &NSEvent);
94
95 #[cfg(feature = "NSEvent")]
96 #[unsafe(method(mouseUp:))]
97 #[unsafe(method_family = none)]
98 pub fn mouseUp(&self, event: &NSEvent);
99
100 #[cfg(feature = "NSEvent")]
101 #[unsafe(method(rightMouseUp:))]
102 #[unsafe(method_family = none)]
103 pub fn rightMouseUp(&self, event: &NSEvent);
104
105 #[cfg(feature = "NSEvent")]
106 #[unsafe(method(otherMouseUp:))]
107 #[unsafe(method_family = none)]
108 pub fn otherMouseUp(&self, event: &NSEvent);
109
110 #[cfg(feature = "NSEvent")]
111 #[unsafe(method(mouseMoved:))]
112 #[unsafe(method_family = none)]
113 pub fn mouseMoved(&self, event: &NSEvent);
114
115 #[cfg(feature = "NSEvent")]
116 #[unsafe(method(mouseDragged:))]
117 #[unsafe(method_family = none)]
118 pub fn mouseDragged(&self, event: &NSEvent);
119
120 #[cfg(feature = "NSEvent")]
121 #[unsafe(method(mouseCancelled:))]
122 #[unsafe(method_family = none)]
123 pub fn mouseCancelled(&self, event: &NSEvent);
124
125 #[cfg(feature = "NSEvent")]
126 #[unsafe(method(scrollWheel:))]
127 #[unsafe(method_family = none)]
128 pub fn scrollWheel(&self, event: &NSEvent);
129
130 #[cfg(feature = "NSEvent")]
131 #[unsafe(method(rightMouseDragged:))]
132 #[unsafe(method_family = none)]
133 pub fn rightMouseDragged(&self, event: &NSEvent);
134
135 #[cfg(feature = "NSEvent")]
136 #[unsafe(method(otherMouseDragged:))]
137 #[unsafe(method_family = none)]
138 pub fn otherMouseDragged(&self, event: &NSEvent);
139
140 #[cfg(feature = "NSEvent")]
141 #[unsafe(method(mouseEntered:))]
142 #[unsafe(method_family = none)]
143 pub fn mouseEntered(&self, event: &NSEvent);
144
145 #[cfg(feature = "NSEvent")]
146 #[unsafe(method(mouseExited:))]
147 #[unsafe(method_family = none)]
148 pub fn mouseExited(&self, event: &NSEvent);
149
150 #[cfg(feature = "NSEvent")]
151 #[unsafe(method(keyDown:))]
152 #[unsafe(method_family = none)]
153 pub fn keyDown(&self, event: &NSEvent);
154
155 #[cfg(feature = "NSEvent")]
156 #[unsafe(method(keyUp:))]
157 #[unsafe(method_family = none)]
158 pub fn keyUp(&self, event: &NSEvent);
159
160 #[cfg(feature = "NSEvent")]
161 #[unsafe(method(flagsChanged:))]
162 #[unsafe(method_family = none)]
163 pub fn flagsChanged(&self, event: &NSEvent);
164
165 #[cfg(feature = "NSEvent")]
166 #[unsafe(method(tabletPoint:))]
167 #[unsafe(method_family = none)]
168 pub fn tabletPoint(&self, event: &NSEvent);
169
170 #[cfg(feature = "NSEvent")]
171 #[unsafe(method(tabletProximity:))]
172 #[unsafe(method_family = none)]
173 pub fn tabletProximity(&self, event: &NSEvent);
174
175 #[cfg(feature = "NSEvent")]
176 #[unsafe(method(cursorUpdate:))]
177 #[unsafe(method_family = none)]
178 pub fn cursorUpdate(&self, event: &NSEvent);
179
180 #[cfg(feature = "NSEvent")]
181 #[unsafe(method(magnifyWithEvent:))]
182 #[unsafe(method_family = none)]
183 pub fn magnifyWithEvent(&self, event: &NSEvent);
184
185 #[cfg(feature = "NSEvent")]
186 #[unsafe(method(rotateWithEvent:))]
187 #[unsafe(method_family = none)]
188 pub fn rotateWithEvent(&self, event: &NSEvent);
189
190 #[cfg(feature = "NSEvent")]
191 #[unsafe(method(swipeWithEvent:))]
192 #[unsafe(method_family = none)]
193 pub fn swipeWithEvent(&self, event: &NSEvent);
194
195 #[cfg(feature = "NSEvent")]
196 #[unsafe(method(beginGestureWithEvent:))]
197 #[unsafe(method_family = none)]
198 pub fn beginGestureWithEvent(&self, event: &NSEvent);
199
200 #[cfg(feature = "NSEvent")]
201 #[unsafe(method(endGestureWithEvent:))]
202 #[unsafe(method_family = none)]
203 pub fn endGestureWithEvent(&self, event: &NSEvent);
204
205 #[cfg(feature = "NSEvent")]
206 #[unsafe(method(smartMagnifyWithEvent:))]
207 #[unsafe(method_family = none)]
208 pub fn smartMagnifyWithEvent(&self, event: &NSEvent);
209
210 #[cfg(feature = "NSEvent")]
211 #[unsafe(method(changeModeWithEvent:))]
212 #[unsafe(method_family = none)]
213 pub fn changeModeWithEvent(&self, event: &NSEvent);
214
215 #[cfg(feature = "NSEvent")]
216 #[unsafe(method(touchesBeganWithEvent:))]
217 #[unsafe(method_family = none)]
218 pub fn touchesBeganWithEvent(&self, event: &NSEvent);
219
220 #[cfg(feature = "NSEvent")]
221 #[unsafe(method(touchesMovedWithEvent:))]
222 #[unsafe(method_family = none)]
223 pub fn touchesMovedWithEvent(&self, event: &NSEvent);
224
225 #[cfg(feature = "NSEvent")]
226 #[unsafe(method(touchesEndedWithEvent:))]
227 #[unsafe(method_family = none)]
228 pub fn touchesEndedWithEvent(&self, event: &NSEvent);
229
230 #[cfg(feature = "NSEvent")]
231 #[unsafe(method(touchesCancelledWithEvent:))]
232 #[unsafe(method_family = none)]
233 pub fn touchesCancelledWithEvent(&self, event: &NSEvent);
234
235 #[cfg(feature = "NSEvent")]
236 #[unsafe(method(quickLookWithEvent:))]
237 #[unsafe(method_family = none)]
238 pub fn quickLookWithEvent(&self, event: &NSEvent);
239
240 #[cfg(feature = "NSEvent")]
241 #[unsafe(method(pressureChangeWithEvent:))]
242 #[unsafe(method_family = none)]
243 pub fn pressureChangeWithEvent(&self, event: &NSEvent);
244
245 #[cfg(feature = "NSEvent")]
246 #[unsafe(method(contextMenuKeyDown:))]
263 #[unsafe(method_family = none)]
264 pub fn contextMenuKeyDown(&self, event: &NSEvent);
265
266 #[unsafe(method(noResponderFor:))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn noResponderFor(&self, event_selector: Sel);
272
273 #[unsafe(method(acceptsFirstResponder))]
274 #[unsafe(method_family = none)]
275 pub fn acceptsFirstResponder(&self) -> bool;
276
277 #[unsafe(method(becomeFirstResponder))]
278 #[unsafe(method_family = none)]
279 pub fn becomeFirstResponder(&self) -> bool;
280
281 #[unsafe(method(resignFirstResponder))]
282 #[unsafe(method_family = none)]
283 pub fn resignFirstResponder(&self) -> bool;
284
285 #[cfg(feature = "NSEvent")]
286 #[unsafe(method(interpretKeyEvents:))]
287 #[unsafe(method_family = none)]
288 pub fn interpretKeyEvents(&self, event_array: &NSArray<NSEvent>);
289
290 #[unsafe(method(flushBufferedKeyEvents))]
291 #[unsafe(method_family = none)]
292 pub fn flushBufferedKeyEvents(&self);
293
294 #[cfg(feature = "NSMenu")]
295 #[unsafe(method(menu))]
296 #[unsafe(method_family = none)]
297 pub fn menu(&self) -> Option<Retained<NSMenu>>;
298
299 #[cfg(feature = "NSMenu")]
300 #[unsafe(method(setMenu:))]
302 #[unsafe(method_family = none)]
303 pub unsafe fn setMenu(&self, menu: Option<&NSMenu>);
304
305 #[unsafe(method(showContextHelp:))]
309 #[unsafe(method_family = none)]
310 pub unsafe fn showContextHelp(&self, sender: Option<&AnyObject>);
311
312 #[cfg(feature = "NSEvent")]
313 #[unsafe(method(helpRequested:))]
314 #[unsafe(method_family = none)]
315 pub fn helpRequested(&self, event_ptr: &NSEvent);
316
317 #[cfg(feature = "NSEvent")]
318 #[unsafe(method(shouldBeTreatedAsInkEvent:))]
319 #[unsafe(method_family = none)]
320 pub fn shouldBeTreatedAsInkEvent(&self, event: &NSEvent) -> bool;
321
322 #[cfg(feature = "NSEvent")]
323 #[unsafe(method(wantsScrollEventsForSwipeTrackingOnAxis:))]
324 #[unsafe(method_family = none)]
325 pub fn wantsScrollEventsForSwipeTrackingOnAxis(&self, axis: NSEventGestureAxis) -> bool;
326
327 #[cfg(feature = "NSEvent")]
328 #[unsafe(method(wantsForwardedScrollEventsForAxis:))]
329 #[unsafe(method_family = none)]
330 pub fn wantsForwardedScrollEventsForAxis(&self, axis: NSEventGestureAxis) -> bool;
331
332 #[unsafe(method(supplementalTargetForAction:sender:))]
337 #[unsafe(method_family = none)]
338 pub unsafe fn supplementalTargetForAction_sender(
339 &self,
340 action: Sel,
341 sender: Option<&AnyObject>,
342 ) -> Option<Retained<AnyObject>>;
343 );
344}
345
346impl NSResponder {
348 extern_methods!(
349 #[unsafe(method(new))]
350 #[unsafe(method_family = new)]
351 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
352 );
353}
354
355extern_protocol!(
356 pub unsafe trait NSStandardKeyBindingResponding:
358 NSObjectProtocol + MainThreadOnly
359 {
360 #[optional]
366 #[unsafe(method(insertText:))]
367 #[unsafe(method_family = none)]
368 unsafe fn insertText(&self, insert_string: &AnyObject);
369
370 #[optional]
374 #[unsafe(method(doCommandBySelector:))]
375 #[unsafe(method_family = none)]
376 unsafe fn doCommandBySelector(&self, selector: Sel);
377
378 #[optional]
384 #[unsafe(method(moveForward:))]
385 #[unsafe(method_family = none)]
386 unsafe fn moveForward(&self, sender: Option<&AnyObject>);
387
388 #[optional]
392 #[unsafe(method(moveRight:))]
393 #[unsafe(method_family = none)]
394 unsafe fn moveRight(&self, sender: Option<&AnyObject>);
395
396 #[optional]
400 #[unsafe(method(moveBackward:))]
401 #[unsafe(method_family = none)]
402 unsafe fn moveBackward(&self, sender: Option<&AnyObject>);
403
404 #[optional]
408 #[unsafe(method(moveLeft:))]
409 #[unsafe(method_family = none)]
410 unsafe fn moveLeft(&self, sender: Option<&AnyObject>);
411
412 #[optional]
416 #[unsafe(method(moveUp:))]
417 #[unsafe(method_family = none)]
418 unsafe fn moveUp(&self, sender: Option<&AnyObject>);
419
420 #[optional]
424 #[unsafe(method(moveDown:))]
425 #[unsafe(method_family = none)]
426 unsafe fn moveDown(&self, sender: Option<&AnyObject>);
427
428 #[optional]
432 #[unsafe(method(moveWordForward:))]
433 #[unsafe(method_family = none)]
434 unsafe fn moveWordForward(&self, sender: Option<&AnyObject>);
435
436 #[optional]
440 #[unsafe(method(moveWordBackward:))]
441 #[unsafe(method_family = none)]
442 unsafe fn moveWordBackward(&self, sender: Option<&AnyObject>);
443
444 #[optional]
448 #[unsafe(method(moveToBeginningOfLine:))]
449 #[unsafe(method_family = none)]
450 unsafe fn moveToBeginningOfLine(&self, sender: Option<&AnyObject>);
451
452 #[optional]
456 #[unsafe(method(moveToEndOfLine:))]
457 #[unsafe(method_family = none)]
458 unsafe fn moveToEndOfLine(&self, sender: Option<&AnyObject>);
459
460 #[optional]
464 #[unsafe(method(moveToBeginningOfParagraph:))]
465 #[unsafe(method_family = none)]
466 unsafe fn moveToBeginningOfParagraph(&self, sender: Option<&AnyObject>);
467
468 #[optional]
472 #[unsafe(method(moveToEndOfParagraph:))]
473 #[unsafe(method_family = none)]
474 unsafe fn moveToEndOfParagraph(&self, sender: Option<&AnyObject>);
475
476 #[optional]
480 #[unsafe(method(moveToEndOfDocument:))]
481 #[unsafe(method_family = none)]
482 unsafe fn moveToEndOfDocument(&self, sender: Option<&AnyObject>);
483
484 #[optional]
488 #[unsafe(method(moveToBeginningOfDocument:))]
489 #[unsafe(method_family = none)]
490 unsafe fn moveToBeginningOfDocument(&self, sender: Option<&AnyObject>);
491
492 #[optional]
496 #[unsafe(method(pageDown:))]
497 #[unsafe(method_family = none)]
498 unsafe fn pageDown(&self, sender: Option<&AnyObject>);
499
500 #[optional]
504 #[unsafe(method(pageUp:))]
505 #[unsafe(method_family = none)]
506 unsafe fn pageUp(&self, sender: Option<&AnyObject>);
507
508 #[optional]
512 #[unsafe(method(centerSelectionInVisibleArea:))]
513 #[unsafe(method_family = none)]
514 unsafe fn centerSelectionInVisibleArea(&self, sender: Option<&AnyObject>);
515
516 #[optional]
520 #[unsafe(method(moveBackwardAndModifySelection:))]
521 #[unsafe(method_family = none)]
522 unsafe fn moveBackwardAndModifySelection(&self, sender: Option<&AnyObject>);
523
524 #[optional]
528 #[unsafe(method(moveForwardAndModifySelection:))]
529 #[unsafe(method_family = none)]
530 unsafe fn moveForwardAndModifySelection(&self, sender: Option<&AnyObject>);
531
532 #[optional]
536 #[unsafe(method(moveWordForwardAndModifySelection:))]
537 #[unsafe(method_family = none)]
538 unsafe fn moveWordForwardAndModifySelection(&self, sender: Option<&AnyObject>);
539
540 #[optional]
544 #[unsafe(method(moveWordBackwardAndModifySelection:))]
545 #[unsafe(method_family = none)]
546 unsafe fn moveWordBackwardAndModifySelection(&self, sender: Option<&AnyObject>);
547
548 #[optional]
552 #[unsafe(method(moveUpAndModifySelection:))]
553 #[unsafe(method_family = none)]
554 unsafe fn moveUpAndModifySelection(&self, sender: Option<&AnyObject>);
555
556 #[optional]
560 #[unsafe(method(moveDownAndModifySelection:))]
561 #[unsafe(method_family = none)]
562 unsafe fn moveDownAndModifySelection(&self, sender: Option<&AnyObject>);
563
564 #[optional]
568 #[unsafe(method(moveToBeginningOfLineAndModifySelection:))]
569 #[unsafe(method_family = none)]
570 unsafe fn moveToBeginningOfLineAndModifySelection(&self, sender: Option<&AnyObject>);
571
572 #[optional]
576 #[unsafe(method(moveToEndOfLineAndModifySelection:))]
577 #[unsafe(method_family = none)]
578 unsafe fn moveToEndOfLineAndModifySelection(&self, sender: Option<&AnyObject>);
579
580 #[optional]
584 #[unsafe(method(moveToBeginningOfParagraphAndModifySelection:))]
585 #[unsafe(method_family = none)]
586 unsafe fn moveToBeginningOfParagraphAndModifySelection(&self, sender: Option<&AnyObject>);
587
588 #[optional]
592 #[unsafe(method(moveToEndOfParagraphAndModifySelection:))]
593 #[unsafe(method_family = none)]
594 unsafe fn moveToEndOfParagraphAndModifySelection(&self, sender: Option<&AnyObject>);
595
596 #[optional]
600 #[unsafe(method(moveToEndOfDocumentAndModifySelection:))]
601 #[unsafe(method_family = none)]
602 unsafe fn moveToEndOfDocumentAndModifySelection(&self, sender: Option<&AnyObject>);
603
604 #[optional]
608 #[unsafe(method(moveToBeginningOfDocumentAndModifySelection:))]
609 #[unsafe(method_family = none)]
610 unsafe fn moveToBeginningOfDocumentAndModifySelection(&self, sender: Option<&AnyObject>);
611
612 #[optional]
616 #[unsafe(method(pageDownAndModifySelection:))]
617 #[unsafe(method_family = none)]
618 unsafe fn pageDownAndModifySelection(&self, sender: Option<&AnyObject>);
619
620 #[optional]
624 #[unsafe(method(pageUpAndModifySelection:))]
625 #[unsafe(method_family = none)]
626 unsafe fn pageUpAndModifySelection(&self, sender: Option<&AnyObject>);
627
628 #[optional]
632 #[unsafe(method(moveParagraphForwardAndModifySelection:))]
633 #[unsafe(method_family = none)]
634 unsafe fn moveParagraphForwardAndModifySelection(&self, sender: Option<&AnyObject>);
635
636 #[optional]
640 #[unsafe(method(moveParagraphBackwardAndModifySelection:))]
641 #[unsafe(method_family = none)]
642 unsafe fn moveParagraphBackwardAndModifySelection(&self, sender: Option<&AnyObject>);
643
644 #[optional]
648 #[unsafe(method(moveWordRight:))]
649 #[unsafe(method_family = none)]
650 unsafe fn moveWordRight(&self, sender: Option<&AnyObject>);
651
652 #[optional]
656 #[unsafe(method(moveWordLeft:))]
657 #[unsafe(method_family = none)]
658 unsafe fn moveWordLeft(&self, sender: Option<&AnyObject>);
659
660 #[optional]
664 #[unsafe(method(moveRightAndModifySelection:))]
665 #[unsafe(method_family = none)]
666 unsafe fn moveRightAndModifySelection(&self, sender: Option<&AnyObject>);
667
668 #[optional]
672 #[unsafe(method(moveLeftAndModifySelection:))]
673 #[unsafe(method_family = none)]
674 unsafe fn moveLeftAndModifySelection(&self, sender: Option<&AnyObject>);
675
676 #[optional]
680 #[unsafe(method(moveWordRightAndModifySelection:))]
681 #[unsafe(method_family = none)]
682 unsafe fn moveWordRightAndModifySelection(&self, sender: Option<&AnyObject>);
683
684 #[optional]
688 #[unsafe(method(moveWordLeftAndModifySelection:))]
689 #[unsafe(method_family = none)]
690 unsafe fn moveWordLeftAndModifySelection(&self, sender: Option<&AnyObject>);
691
692 #[optional]
696 #[unsafe(method(moveToLeftEndOfLine:))]
697 #[unsafe(method_family = none)]
698 unsafe fn moveToLeftEndOfLine(&self, sender: Option<&AnyObject>);
699
700 #[optional]
704 #[unsafe(method(moveToRightEndOfLine:))]
705 #[unsafe(method_family = none)]
706 unsafe fn moveToRightEndOfLine(&self, sender: Option<&AnyObject>);
707
708 #[optional]
712 #[unsafe(method(moveToLeftEndOfLineAndModifySelection:))]
713 #[unsafe(method_family = none)]
714 unsafe fn moveToLeftEndOfLineAndModifySelection(&self, sender: Option<&AnyObject>);
715
716 #[optional]
720 #[unsafe(method(moveToRightEndOfLineAndModifySelection:))]
721 #[unsafe(method_family = none)]
722 unsafe fn moveToRightEndOfLineAndModifySelection(&self, sender: Option<&AnyObject>);
723
724 #[optional]
728 #[unsafe(method(scrollPageUp:))]
729 #[unsafe(method_family = none)]
730 unsafe fn scrollPageUp(&self, sender: Option<&AnyObject>);
731
732 #[optional]
736 #[unsafe(method(scrollPageDown:))]
737 #[unsafe(method_family = none)]
738 unsafe fn scrollPageDown(&self, sender: Option<&AnyObject>);
739
740 #[optional]
744 #[unsafe(method(scrollLineUp:))]
745 #[unsafe(method_family = none)]
746 unsafe fn scrollLineUp(&self, sender: Option<&AnyObject>);
747
748 #[optional]
752 #[unsafe(method(scrollLineDown:))]
753 #[unsafe(method_family = none)]
754 unsafe fn scrollLineDown(&self, sender: Option<&AnyObject>);
755
756 #[optional]
760 #[unsafe(method(scrollToBeginningOfDocument:))]
761 #[unsafe(method_family = none)]
762 unsafe fn scrollToBeginningOfDocument(&self, sender: Option<&AnyObject>);
763
764 #[optional]
768 #[unsafe(method(scrollToEndOfDocument:))]
769 #[unsafe(method_family = none)]
770 unsafe fn scrollToEndOfDocument(&self, sender: Option<&AnyObject>);
771
772 #[optional]
776 #[unsafe(method(transpose:))]
777 #[unsafe(method_family = none)]
778 unsafe fn transpose(&self, sender: Option<&AnyObject>);
779
780 #[optional]
784 #[unsafe(method(transposeWords:))]
785 #[unsafe(method_family = none)]
786 unsafe fn transposeWords(&self, sender: Option<&AnyObject>);
787
788 #[optional]
792 #[unsafe(method(selectAll:))]
793 #[unsafe(method_family = none)]
794 unsafe fn selectAll(&self, sender: Option<&AnyObject>);
795
796 #[optional]
800 #[unsafe(method(selectParagraph:))]
801 #[unsafe(method_family = none)]
802 unsafe fn selectParagraph(&self, sender: Option<&AnyObject>);
803
804 #[optional]
808 #[unsafe(method(selectLine:))]
809 #[unsafe(method_family = none)]
810 unsafe fn selectLine(&self, sender: Option<&AnyObject>);
811
812 #[optional]
816 #[unsafe(method(selectWord:))]
817 #[unsafe(method_family = none)]
818 unsafe fn selectWord(&self, sender: Option<&AnyObject>);
819
820 #[optional]
824 #[unsafe(method(indent:))]
825 #[unsafe(method_family = none)]
826 unsafe fn indent(&self, sender: Option<&AnyObject>);
827
828 #[optional]
832 #[unsafe(method(insertTab:))]
833 #[unsafe(method_family = none)]
834 unsafe fn insertTab(&self, sender: Option<&AnyObject>);
835
836 #[optional]
840 #[unsafe(method(insertBacktab:))]
841 #[unsafe(method_family = none)]
842 unsafe fn insertBacktab(&self, sender: Option<&AnyObject>);
843
844 #[optional]
848 #[unsafe(method(insertNewline:))]
849 #[unsafe(method_family = none)]
850 unsafe fn insertNewline(&self, sender: Option<&AnyObject>);
851
852 #[optional]
856 #[unsafe(method(insertParagraphSeparator:))]
857 #[unsafe(method_family = none)]
858 unsafe fn insertParagraphSeparator(&self, sender: Option<&AnyObject>);
859
860 #[optional]
864 #[unsafe(method(insertNewlineIgnoringFieldEditor:))]
865 #[unsafe(method_family = none)]
866 unsafe fn insertNewlineIgnoringFieldEditor(&self, sender: Option<&AnyObject>);
867
868 #[optional]
872 #[unsafe(method(insertTabIgnoringFieldEditor:))]
873 #[unsafe(method_family = none)]
874 unsafe fn insertTabIgnoringFieldEditor(&self, sender: Option<&AnyObject>);
875
876 #[optional]
880 #[unsafe(method(insertLineBreak:))]
881 #[unsafe(method_family = none)]
882 unsafe fn insertLineBreak(&self, sender: Option<&AnyObject>);
883
884 #[optional]
888 #[unsafe(method(insertContainerBreak:))]
889 #[unsafe(method_family = none)]
890 unsafe fn insertContainerBreak(&self, sender: Option<&AnyObject>);
891
892 #[optional]
896 #[unsafe(method(insertSingleQuoteIgnoringSubstitution:))]
897 #[unsafe(method_family = none)]
898 unsafe fn insertSingleQuoteIgnoringSubstitution(&self, sender: Option<&AnyObject>);
899
900 #[optional]
904 #[unsafe(method(insertDoubleQuoteIgnoringSubstitution:))]
905 #[unsafe(method_family = none)]
906 unsafe fn insertDoubleQuoteIgnoringSubstitution(&self, sender: Option<&AnyObject>);
907
908 #[optional]
912 #[unsafe(method(changeCaseOfLetter:))]
913 #[unsafe(method_family = none)]
914 unsafe fn changeCaseOfLetter(&self, sender: Option<&AnyObject>);
915
916 #[optional]
920 #[unsafe(method(uppercaseWord:))]
921 #[unsafe(method_family = none)]
922 unsafe fn uppercaseWord(&self, sender: Option<&AnyObject>);
923
924 #[optional]
928 #[unsafe(method(lowercaseWord:))]
929 #[unsafe(method_family = none)]
930 unsafe fn lowercaseWord(&self, sender: Option<&AnyObject>);
931
932 #[optional]
936 #[unsafe(method(capitalizeWord:))]
937 #[unsafe(method_family = none)]
938 unsafe fn capitalizeWord(&self, sender: Option<&AnyObject>);
939
940 #[optional]
944 #[unsafe(method(deleteForward:))]
945 #[unsafe(method_family = none)]
946 unsafe fn deleteForward(&self, sender: Option<&AnyObject>);
947
948 #[optional]
952 #[unsafe(method(deleteBackward:))]
953 #[unsafe(method_family = none)]
954 unsafe fn deleteBackward(&self, sender: Option<&AnyObject>);
955
956 #[optional]
960 #[unsafe(method(deleteBackwardByDecomposingPreviousCharacter:))]
961 #[unsafe(method_family = none)]
962 unsafe fn deleteBackwardByDecomposingPreviousCharacter(&self, sender: Option<&AnyObject>);
963
964 #[optional]
968 #[unsafe(method(deleteWordForward:))]
969 #[unsafe(method_family = none)]
970 unsafe fn deleteWordForward(&self, sender: Option<&AnyObject>);
971
972 #[optional]
976 #[unsafe(method(deleteWordBackward:))]
977 #[unsafe(method_family = none)]
978 unsafe fn deleteWordBackward(&self, sender: Option<&AnyObject>);
979
980 #[optional]
984 #[unsafe(method(deleteToBeginningOfLine:))]
985 #[unsafe(method_family = none)]
986 unsafe fn deleteToBeginningOfLine(&self, sender: Option<&AnyObject>);
987
988 #[optional]
992 #[unsafe(method(deleteToEndOfLine:))]
993 #[unsafe(method_family = none)]
994 unsafe fn deleteToEndOfLine(&self, sender: Option<&AnyObject>);
995
996 #[optional]
1000 #[unsafe(method(deleteToBeginningOfParagraph:))]
1001 #[unsafe(method_family = none)]
1002 unsafe fn deleteToBeginningOfParagraph(&self, sender: Option<&AnyObject>);
1003
1004 #[optional]
1008 #[unsafe(method(deleteToEndOfParagraph:))]
1009 #[unsafe(method_family = none)]
1010 unsafe fn deleteToEndOfParagraph(&self, sender: Option<&AnyObject>);
1011
1012 #[optional]
1016 #[unsafe(method(yank:))]
1017 #[unsafe(method_family = none)]
1018 unsafe fn yank(&self, sender: Option<&AnyObject>);
1019
1020 #[optional]
1024 #[unsafe(method(complete:))]
1025 #[unsafe(method_family = none)]
1026 unsafe fn complete(&self, sender: Option<&AnyObject>);
1027
1028 #[optional]
1032 #[unsafe(method(setMark:))]
1033 #[unsafe(method_family = none)]
1034 unsafe fn setMark(&self, sender: Option<&AnyObject>);
1035
1036 #[optional]
1040 #[unsafe(method(deleteToMark:))]
1041 #[unsafe(method_family = none)]
1042 unsafe fn deleteToMark(&self, sender: Option<&AnyObject>);
1043
1044 #[optional]
1048 #[unsafe(method(selectToMark:))]
1049 #[unsafe(method_family = none)]
1050 unsafe fn selectToMark(&self, sender: Option<&AnyObject>);
1051
1052 #[optional]
1056 #[unsafe(method(swapWithMark:))]
1057 #[unsafe(method_family = none)]
1058 unsafe fn swapWithMark(&self, sender: Option<&AnyObject>);
1059
1060 #[optional]
1064 #[unsafe(method(cancelOperation:))]
1065 #[unsafe(method_family = none)]
1066 unsafe fn cancelOperation(&self, sender: Option<&AnyObject>);
1067
1068 #[optional]
1072 #[unsafe(method(makeBaseWritingDirectionNatural:))]
1073 #[unsafe(method_family = none)]
1074 unsafe fn makeBaseWritingDirectionNatural(&self, sender: Option<&AnyObject>);
1075
1076 #[optional]
1080 #[unsafe(method(makeBaseWritingDirectionLeftToRight:))]
1081 #[unsafe(method_family = none)]
1082 unsafe fn makeBaseWritingDirectionLeftToRight(&self, sender: Option<&AnyObject>);
1083
1084 #[optional]
1088 #[unsafe(method(makeBaseWritingDirectionRightToLeft:))]
1089 #[unsafe(method_family = none)]
1090 unsafe fn makeBaseWritingDirectionRightToLeft(&self, sender: Option<&AnyObject>);
1091
1092 #[optional]
1096 #[unsafe(method(makeTextWritingDirectionNatural:))]
1097 #[unsafe(method_family = none)]
1098 unsafe fn makeTextWritingDirectionNatural(&self, sender: Option<&AnyObject>);
1099
1100 #[optional]
1104 #[unsafe(method(makeTextWritingDirectionLeftToRight:))]
1105 #[unsafe(method_family = none)]
1106 unsafe fn makeTextWritingDirectionLeftToRight(&self, sender: Option<&AnyObject>);
1107
1108 #[optional]
1112 #[unsafe(method(makeTextWritingDirectionRightToLeft:))]
1113 #[unsafe(method_family = none)]
1114 unsafe fn makeTextWritingDirectionRightToLeft(&self, sender: Option<&AnyObject>);
1115
1116 #[optional]
1120 #[unsafe(method(quickLookPreviewItems:))]
1121 #[unsafe(method_family = none)]
1122 unsafe fn quickLookPreviewItems(&self, sender: Option<&AnyObject>);
1123
1124 #[optional]
1149 #[unsafe(method(showContextMenuForSelection:))]
1150 #[unsafe(method_family = none)]
1151 unsafe fn showContextMenuForSelection(&self, sender: Option<&AnyObject>);
1152 }
1153);
1154
1155impl NSResponder {
1157 extern_methods!();
1158}
1159
1160extern_conformance!(
1161 unsafe impl NSStandardKeyBindingResponding for NSResponder {}
1162);
1163
1164impl NSResponder {
1166 extern_methods!(
1167 #[unsafe(method(undoManager))]
1168 #[unsafe(method_family = none)]
1169 pub fn undoManager(&self) -> Option<Retained<NSUndoManager>>;
1170 );
1171}
1172
1173impl NSResponder {
1175 extern_methods!(
1176 #[cfg(feature = "NSEvent")]
1177 #[unsafe(method(validateProposedFirstResponder:forEvent:))]
1178 #[unsafe(method_family = none)]
1179 pub fn validateProposedFirstResponder_forEvent(
1180 &self,
1181 responder: &NSResponder,
1182 event: Option<&NSEvent>,
1183 ) -> bool;
1184 );
1185}
1186
1187impl NSResponder {
1189 extern_methods!(
1190 #[cfg(feature = "NSWindow")]
1191 #[unsafe(method(presentError:modalForWindow:delegate:didPresentSelector:contextInfo:))]
1197 #[unsafe(method_family = none)]
1198 pub unsafe fn presentError_modalForWindow_delegate_didPresentSelector_contextInfo(
1199 &self,
1200 error: &NSError,
1201 window: &NSWindow,
1202 delegate: Option<&AnyObject>,
1203 did_present_selector: Option<Sel>,
1204 context_info: *mut c_void,
1205 );
1206
1207 #[unsafe(method(presentError:))]
1208 #[unsafe(method_family = none)]
1209 pub fn presentError(&self, error: &NSError) -> bool;
1210
1211 #[unsafe(method(willPresentError:))]
1212 #[unsafe(method_family = none)]
1213 pub fn willPresentError(&self, error: &NSError) -> Retained<NSError>;
1214 );
1215}
1216
1217impl NSResponder {
1219 extern_methods!(
1220 #[unsafe(method(performTextFinderAction:))]
1224 #[unsafe(method_family = none)]
1225 pub unsafe fn performTextFinderAction(&self, sender: Option<&AnyObject>);
1226 );
1227}
1228
1229impl NSResponder {
1231 extern_methods!(
1232 #[unsafe(method(newWindowForTab:))]
1236 #[unsafe(method_family = none)]
1237 pub unsafe fn newWindowForTab(&self, sender: Option<&AnyObject>);
1238 );
1239}
1240
1241impl NSResponder {
1243 extern_methods!(
1244 #[unsafe(method(showWritingTools:))]
1248 #[unsafe(method_family = none)]
1249 pub unsafe fn showWritingTools(&self, sender: Option<&AnyObject>);
1250 );
1251}
1252
1253impl NSResponder {
1255 extern_methods!(
1256 #[deprecated = "This has always returned NO and had no effect on macOS"]
1257 #[unsafe(method(performMnemonic:))]
1258 #[unsafe(method_family = none)]
1259 pub fn performMnemonic(&self, string: &NSString) -> bool;
1260 );
1261}