objc2_ui_kit/generated/
UIResponder.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextattributesconversionhandler?language=objc)
11#[cfg(feature = "block2")]
12pub type UITextAttributesConversionHandler = *mut block2::DynBlock<
13    dyn Fn(
14        NonNull<NSDictionary<NSAttributedStringKey, AnyObject>>,
15    ) -> NonNull<NSDictionary<NSAttributedStringKey, AnyObject>>,
16>;
17
18/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uieditinginteractionconfiguration?language=objc)
19// NS_ENUM
20#[repr(transparent)]
21#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
22pub struct UIEditingInteractionConfiguration(pub NSInteger);
23impl UIEditingInteractionConfiguration {
24    #[doc(alias = "UIEditingInteractionConfigurationNone")]
25    pub const None: Self = Self(0);
26    #[doc(alias = "UIEditingInteractionConfigurationDefault")]
27    pub const Default: Self = Self(1);
28}
29
30unsafe impl Encode for UIEditingInteractionConfiguration {
31    const ENCODING: Encoding = NSInteger::ENCODING;
32}
33
34unsafe impl RefEncode for UIEditingInteractionConfiguration {
35    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
36}
37
38extern_protocol!(
39    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiresponderstandardeditactions?language=objc)
40    pub unsafe trait UIResponderStandardEditActions:
41        NSObjectProtocol + MainThreadOnly
42    {
43        /// # Safety
44        ///
45        /// `sender` should be of the correct type.
46        #[optional]
47        #[unsafe(method(cut:))]
48        #[unsafe(method_family = none)]
49        unsafe fn cut(&self, sender: Option<&AnyObject>);
50
51        /// # Safety
52        ///
53        /// `sender` should be of the correct type.
54        #[optional]
55        #[unsafe(method(copy:))]
56        #[unsafe(method_family = none)]
57        unsafe fn copy(&self, sender: Option<&AnyObject>);
58
59        /// # Safety
60        ///
61        /// `sender` should be of the correct type.
62        #[optional]
63        #[unsafe(method(paste:))]
64        #[unsafe(method_family = none)]
65        unsafe fn paste(&self, sender: Option<&AnyObject>);
66
67        /// # Safety
68        ///
69        /// `sender` should be of the correct type.
70        #[optional]
71        #[unsafe(method(pasteAndMatchStyle:))]
72        #[unsafe(method_family = none)]
73        unsafe fn pasteAndMatchStyle(&self, sender: Option<&AnyObject>);
74
75        /// # Safety
76        ///
77        /// `sender` should be of the correct type.
78        #[optional]
79        #[unsafe(method(pasteAndGo:))]
80        #[unsafe(method_family = none)]
81        unsafe fn pasteAndGo(&self, sender: Option<&AnyObject>);
82
83        /// # Safety
84        ///
85        /// `sender` should be of the correct type.
86        #[optional]
87        #[unsafe(method(pasteAndSearch:))]
88        #[unsafe(method_family = none)]
89        unsafe fn pasteAndSearch(&self, sender: Option<&AnyObject>);
90
91        /// # Safety
92        ///
93        /// `sender` should be of the correct type.
94        #[optional]
95        #[unsafe(method(newFromPasteboard:))]
96        #[unsafe(method_family = none)]
97        unsafe fn newFromPasteboard(&self, sender: Option<&AnyObject>);
98
99        /// # Safety
100        ///
101        /// `sender` should be of the correct type.
102        #[optional]
103        #[unsafe(method(select:))]
104        #[unsafe(method_family = none)]
105        unsafe fn select(&self, sender: Option<&AnyObject>);
106
107        /// # Safety
108        ///
109        /// `sender` should be of the correct type.
110        #[optional]
111        #[unsafe(method(selectAll:))]
112        #[unsafe(method_family = none)]
113        unsafe fn selectAll(&self, sender: Option<&AnyObject>);
114
115        /// # Safety
116        ///
117        /// `sender` should be of the correct type.
118        #[optional]
119        #[unsafe(method(delete:))]
120        #[unsafe(method_family = none)]
121        unsafe fn delete(&self, sender: Option<&AnyObject>);
122
123        /// # Safety
124        ///
125        /// `sender` should be of the correct type.
126        #[optional]
127        #[unsafe(method(makeTextWritingDirectionLeftToRight:))]
128        #[unsafe(method_family = none)]
129        unsafe fn makeTextWritingDirectionLeftToRight(&self, sender: Option<&AnyObject>);
130
131        /// # Safety
132        ///
133        /// `sender` should be of the correct type.
134        #[optional]
135        #[unsafe(method(makeTextWritingDirectionRightToLeft:))]
136        #[unsafe(method_family = none)]
137        unsafe fn makeTextWritingDirectionRightToLeft(&self, sender: Option<&AnyObject>);
138
139        /// # Safety
140        ///
141        /// `sender` should be of the correct type.
142        #[optional]
143        #[unsafe(method(toggleBoldface:))]
144        #[unsafe(method_family = none)]
145        unsafe fn toggleBoldface(&self, sender: Option<&AnyObject>);
146
147        /// # Safety
148        ///
149        /// `sender` should be of the correct type.
150        #[optional]
151        #[unsafe(method(toggleItalics:))]
152        #[unsafe(method_family = none)]
153        unsafe fn toggleItalics(&self, sender: Option<&AnyObject>);
154
155        /// # Safety
156        ///
157        /// `sender` should be of the correct type.
158        #[optional]
159        #[unsafe(method(toggleUnderline:))]
160        #[unsafe(method_family = none)]
161        unsafe fn toggleUnderline(&self, sender: Option<&AnyObject>);
162
163        /// # Safety
164        ///
165        /// `sender` should be of the correct type.
166        #[optional]
167        #[unsafe(method(increaseSize:))]
168        #[unsafe(method_family = none)]
169        unsafe fn increaseSize(&self, sender: Option<&AnyObject>);
170
171        /// # Safety
172        ///
173        /// `sender` should be of the correct type.
174        #[optional]
175        #[unsafe(method(decreaseSize:))]
176        #[unsafe(method_family = none)]
177        unsafe fn decreaseSize(&self, sender: Option<&AnyObject>);
178
179        /// # Safety
180        ///
181        /// `sender` should be of the correct type.
182        #[optional]
183        #[unsafe(method(alignLeft:))]
184        #[unsafe(method_family = none)]
185        unsafe fn alignLeft(&self, sender: Option<&AnyObject>);
186
187        /// # Safety
188        ///
189        /// `sender` should be of the correct type.
190        #[optional]
191        #[unsafe(method(alignCenter:))]
192        #[unsafe(method_family = none)]
193        unsafe fn alignCenter(&self, sender: Option<&AnyObject>);
194
195        /// # Safety
196        ///
197        /// `sender` should be of the correct type.
198        #[optional]
199        #[unsafe(method(alignJustified:))]
200        #[unsafe(method_family = none)]
201        unsafe fn alignJustified(&self, sender: Option<&AnyObject>);
202
203        /// # Safety
204        ///
205        /// `sender` should be of the correct type.
206        #[optional]
207        #[unsafe(method(alignRight:))]
208        #[unsafe(method_family = none)]
209        unsafe fn alignRight(&self, sender: Option<&AnyObject>);
210
211        /// # Safety
212        ///
213        /// `sender` should be of the correct type.
214        #[optional]
215        #[unsafe(method(find:))]
216        #[unsafe(method_family = none)]
217        unsafe fn find(&self, sender: Option<&AnyObject>);
218
219        /// # Safety
220        ///
221        /// `sender` should be of the correct type.
222        #[optional]
223        #[unsafe(method(findAndReplace:))]
224        #[unsafe(method_family = none)]
225        unsafe fn findAndReplace(&self, sender: Option<&AnyObject>);
226
227        /// # Safety
228        ///
229        /// `sender` should be of the correct type.
230        #[optional]
231        #[unsafe(method(findNext:))]
232        #[unsafe(method_family = none)]
233        unsafe fn findNext(&self, sender: Option<&AnyObject>);
234
235        /// # Safety
236        ///
237        /// `sender` should be of the correct type.
238        #[optional]
239        #[unsafe(method(findPrevious:))]
240        #[unsafe(method_family = none)]
241        unsafe fn findPrevious(&self, sender: Option<&AnyObject>);
242
243        /// # Safety
244        ///
245        /// `sender` should be of the correct type.
246        #[optional]
247        #[unsafe(method(useSelectionForFind:))]
248        #[unsafe(method_family = none)]
249        unsafe fn useSelectionForFind(&self, sender: Option<&AnyObject>);
250
251        #[cfg(feature = "block2")]
252        /// # Safety
253        ///
254        /// `conversion_handler` must be a valid pointer.
255        #[optional]
256        #[unsafe(method(updateTextAttributesWithConversionHandler:))]
257        #[unsafe(method_family = none)]
258        unsafe fn updateTextAttributesWithConversionHandler(
259            &self,
260            conversion_handler: UITextAttributesConversionHandler,
261        );
262
263        /// # Safety
264        ///
265        /// `sender` should be of the correct type.
266        #[optional]
267        #[unsafe(method(print:))]
268        #[unsafe(method_family = none)]
269        unsafe fn print(&self, sender: Option<&AnyObject>);
270
271        /// # Safety
272        ///
273        /// `sender` should be of the correct type.
274        #[optional]
275        #[unsafe(method(rename:))]
276        #[unsafe(method_family = none)]
277        unsafe fn rename(&self, sender: Option<&AnyObject>);
278
279        /// # Safety
280        ///
281        /// `sender` should be of the correct type.
282        #[optional]
283        #[unsafe(method(duplicate:))]
284        #[unsafe(method_family = none)]
285        unsafe fn duplicate(&self, sender: Option<&AnyObject>);
286
287        /// # Safety
288        ///
289        /// `sender` should be of the correct type.
290        #[optional]
291        #[unsafe(method(move:))]
292        #[unsafe(method_family = none)]
293        unsafe fn r#move(&self, sender: Option<&AnyObject>);
294
295        /// # Safety
296        ///
297        /// `sender` should be of the correct type.
298        #[optional]
299        #[unsafe(method(export:))]
300        #[unsafe(method_family = none)]
301        unsafe fn export(&self, sender: Option<&AnyObject>);
302
303        /// # Safety
304        ///
305        /// `sender` should be of the correct type.
306        #[optional]
307        #[unsafe(method(toggleSidebar:))]
308        #[unsafe(method_family = none)]
309        unsafe fn toggleSidebar(&self, sender: Option<&AnyObject>);
310
311        /// # Safety
312        ///
313        /// `sender` should be of the correct type.
314        #[optional]
315        #[unsafe(method(toggleInspector:))]
316        #[unsafe(method_family = none)]
317        unsafe fn toggleInspector(&self, sender: Option<&AnyObject>);
318
319        /// # Safety
320        ///
321        /// `sender` should be of the correct type.
322        #[optional]
323        #[unsafe(method(performClose:))]
324        #[unsafe(method_family = none)]
325        unsafe fn performClose(&self, sender: Option<&AnyObject>);
326
327        /// # Safety
328        ///
329        /// `sender` should be of the correct type.
330        #[optional]
331        #[unsafe(method(showWritingTools:))]
332        #[unsafe(method_family = none)]
333        unsafe fn showWritingTools(&self, sender: &AnyObject);
334    }
335);
336
337extern_class!(
338    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiresponder?language=objc)
339    #[unsafe(super(NSObject))]
340    #[thread_kind = MainThreadOnly]
341    #[derive(Debug, PartialEq, Eq, Hash)]
342    pub struct UIResponder;
343);
344
345extern_conformance!(
346    unsafe impl NSObjectProtocol for UIResponder {}
347);
348
349extern_conformance!(
350    unsafe impl UIResponderStandardEditActions for UIResponder {}
351);
352
353impl UIResponder {
354    extern_methods!(
355        #[unsafe(method(nextResponder))]
356        #[unsafe(method_family = none)]
357        pub fn nextResponder(&self) -> Option<Retained<UIResponder>>;
358
359        #[unsafe(method(canBecomeFirstResponder))]
360        #[unsafe(method_family = none)]
361        pub fn canBecomeFirstResponder(&self) -> bool;
362
363        #[unsafe(method(becomeFirstResponder))]
364        #[unsafe(method_family = none)]
365        pub fn becomeFirstResponder(&self) -> bool;
366
367        #[unsafe(method(canResignFirstResponder))]
368        #[unsafe(method_family = none)]
369        pub fn canResignFirstResponder(&self) -> bool;
370
371        #[unsafe(method(resignFirstResponder))]
372        #[unsafe(method_family = none)]
373        pub fn resignFirstResponder(&self) -> bool;
374
375        #[unsafe(method(isFirstResponder))]
376        #[unsafe(method_family = none)]
377        pub fn isFirstResponder(&self) -> bool;
378
379        #[cfg(all(feature = "UIEvent", feature = "UITouch"))]
380        #[unsafe(method(touchesBegan:withEvent:))]
381        #[unsafe(method_family = none)]
382        pub fn touchesBegan_withEvent(&self, touches: &NSSet<UITouch>, event: Option<&UIEvent>);
383
384        #[cfg(all(feature = "UIEvent", feature = "UITouch"))]
385        #[unsafe(method(touchesMoved:withEvent:))]
386        #[unsafe(method_family = none)]
387        pub fn touchesMoved_withEvent(&self, touches: &NSSet<UITouch>, event: Option<&UIEvent>);
388
389        #[cfg(all(feature = "UIEvent", feature = "UITouch"))]
390        #[unsafe(method(touchesEnded:withEvent:))]
391        #[unsafe(method_family = none)]
392        pub fn touchesEnded_withEvent(&self, touches: &NSSet<UITouch>, event: Option<&UIEvent>);
393
394        #[cfg(all(feature = "UIEvent", feature = "UITouch"))]
395        #[unsafe(method(touchesCancelled:withEvent:))]
396        #[unsafe(method_family = none)]
397        pub fn touchesCancelled_withEvent(&self, touches: &NSSet<UITouch>, event: Option<&UIEvent>);
398
399        #[cfg(feature = "UITouch")]
400        #[unsafe(method(touchesEstimatedPropertiesUpdated:))]
401        #[unsafe(method_family = none)]
402        pub fn touchesEstimatedPropertiesUpdated(&self, touches: &NSSet<UITouch>);
403
404        #[cfg(all(feature = "UIEvent", feature = "UIPress", feature = "UIPressesEvent"))]
405        #[unsafe(method(pressesBegan:withEvent:))]
406        #[unsafe(method_family = none)]
407        pub fn pressesBegan_withEvent(
408            &self,
409            presses: &NSSet<UIPress>,
410            event: Option<&UIPressesEvent>,
411        );
412
413        #[cfg(all(feature = "UIEvent", feature = "UIPress", feature = "UIPressesEvent"))]
414        #[unsafe(method(pressesChanged:withEvent:))]
415        #[unsafe(method_family = none)]
416        pub fn pressesChanged_withEvent(
417            &self,
418            presses: &NSSet<UIPress>,
419            event: Option<&UIPressesEvent>,
420        );
421
422        #[cfg(all(feature = "UIEvent", feature = "UIPress", feature = "UIPressesEvent"))]
423        #[unsafe(method(pressesEnded:withEvent:))]
424        #[unsafe(method_family = none)]
425        pub fn pressesEnded_withEvent(
426            &self,
427            presses: &NSSet<UIPress>,
428            event: Option<&UIPressesEvent>,
429        );
430
431        #[cfg(all(feature = "UIEvent", feature = "UIPress", feature = "UIPressesEvent"))]
432        #[unsafe(method(pressesCancelled:withEvent:))]
433        #[unsafe(method_family = none)]
434        pub fn pressesCancelled_withEvent(
435            &self,
436            presses: &NSSet<UIPress>,
437            event: Option<&UIPressesEvent>,
438        );
439
440        #[cfg(feature = "UIEvent")]
441        #[unsafe(method(motionBegan:withEvent:))]
442        #[unsafe(method_family = none)]
443        pub fn motionBegan_withEvent(&self, motion: UIEventSubtype, event: Option<&UIEvent>);
444
445        #[cfg(feature = "UIEvent")]
446        #[unsafe(method(motionEnded:withEvent:))]
447        #[unsafe(method_family = none)]
448        pub fn motionEnded_withEvent(&self, motion: UIEventSubtype, event: Option<&UIEvent>);
449
450        #[cfg(feature = "UIEvent")]
451        #[unsafe(method(motionCancelled:withEvent:))]
452        #[unsafe(method_family = none)]
453        pub fn motionCancelled_withEvent(&self, motion: UIEventSubtype, event: Option<&UIEvent>);
454
455        #[cfg(feature = "UIEvent")]
456        #[unsafe(method(remoteControlReceivedWithEvent:))]
457        #[unsafe(method_family = none)]
458        pub fn remoteControlReceivedWithEvent(&self, event: Option<&UIEvent>);
459
460        /// # Safety
461        ///
462        /// - `action` must be a valid selector.
463        /// - `sender` should be of the correct type.
464        #[unsafe(method(canPerformAction:withSender:))]
465        #[unsafe(method_family = none)]
466        pub unsafe fn canPerformAction_withSender(
467            &self,
468            action: Sel,
469            sender: Option<&AnyObject>,
470        ) -> bool;
471
472        /// # Safety
473        ///
474        /// - `action` must be a valid selector.
475        /// - `sender` should be of the correct type.
476        #[unsafe(method(targetForAction:withSender:))]
477        #[unsafe(method_family = none)]
478        pub unsafe fn targetForAction_withSender(
479            &self,
480            action: Sel,
481            sender: Option<&AnyObject>,
482        ) -> Option<Retained<AnyObject>>;
483
484        #[cfg(feature = "UIMenuBuilder")]
485        #[unsafe(method(buildMenuWithBuilder:))]
486        #[unsafe(method_family = none)]
487        pub fn buildMenuWithBuilder(&self, builder: &ProtocolObject<dyn UIMenuBuilder>);
488
489        #[cfg(all(feature = "UICommand", feature = "UIMenuElement"))]
490        #[unsafe(method(validateCommand:))]
491        #[unsafe(method_family = none)]
492        pub fn validateCommand(&self, command: &UICommand);
493
494        #[cfg(all(feature = "UIDeferredMenuElement", feature = "UIMenuElement"))]
495        /// Asks the responder for an element provider to fulfill the given focus-based deferred element.
496        /// Check the `identifier` of the deferred element to identify which deferred element this is.
497        /// By default, this returns nil. Return a non-nil `provider` to make this responder responsible for providing
498        /// elements for this fulfillment of the deferred element.
499        #[unsafe(method(providerForDeferredMenuElement:))]
500        #[unsafe(method_family = none)]
501        pub fn providerForDeferredMenuElement(
502            &self,
503            deferred_element: &UIDeferredMenuElement,
504        ) -> Option<Retained<UIDeferredMenuElementProvider>>;
505
506        #[unsafe(method(undoManager))]
507        #[unsafe(method_family = none)]
508        pub fn undoManager(&self) -> Option<Retained<NSUndoManager>>;
509
510        #[unsafe(method(editingInteractionConfiguration))]
511        #[unsafe(method_family = none)]
512        pub fn editingInteractionConfiguration(&self) -> UIEditingInteractionConfiguration;
513    );
514}
515
516/// Methods declared on superclass `NSObject`.
517impl UIResponder {
518    extern_methods!(
519        #[unsafe(method(init))]
520        #[unsafe(method_family = init)]
521        pub fn init(this: Allocated<Self>) -> Retained<Self>;
522
523        #[unsafe(method(new))]
524        #[unsafe(method_family = new)]
525        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
526    );
527}
528
529/// UIResponderKeyCommands.
530impl UIResponder {
531    extern_methods!(
532        #[cfg(all(
533            feature = "UICommand",
534            feature = "UIKeyCommand",
535            feature = "UIMenuElement"
536        ))]
537        #[unsafe(method(keyCommands))]
538        #[unsafe(method_family = none)]
539        pub fn keyCommands(&self) -> Option<Retained<NSArray<UIKeyCommand>>>;
540    );
541}
542
543/// UIResponderInputViewAdditions.
544impl UIResponder {
545    extern_methods!(
546        #[cfg(feature = "UIView")]
547        #[unsafe(method(inputView))]
548        #[unsafe(method_family = none)]
549        pub fn inputView(&self) -> Option<Retained<UIView>>;
550
551        #[cfg(feature = "UIView")]
552        #[unsafe(method(inputAccessoryView))]
553        #[unsafe(method_family = none)]
554        pub fn inputAccessoryView(&self) -> Option<Retained<UIView>>;
555
556        #[cfg(feature = "UITextInput")]
557        /// This method is for clients that wish to put buttons on the Shortcuts Bar, shown on top of the keyboard.
558        /// You may modify the returned inputAssistantItem to add to or replace the existing items on the bar.
559        /// Modifications made to the returned UITextInputAssistantItem are reflected automatically.
560        /// This method should not be overridden. Goes up the responder chain.
561        #[unsafe(method(inputAssistantItem))]
562        #[unsafe(method_family = none)]
563        pub fn inputAssistantItem(&self) -> Retained<UITextInputAssistantItem>;
564
565        #[cfg(all(feature = "UIInputViewController", feature = "UIViewController"))]
566        #[unsafe(method(inputViewController))]
567        #[unsafe(method_family = none)]
568        pub fn inputViewController(&self) -> Option<Retained<UIInputViewController>>;
569
570        #[cfg(all(feature = "UIInputViewController", feature = "UIViewController"))]
571        #[unsafe(method(inputAccessoryViewController))]
572        #[unsafe(method_family = none)]
573        pub fn inputAccessoryViewController(&self) -> Option<Retained<UIInputViewController>>;
574
575        #[cfg(feature = "UITextInput")]
576        #[unsafe(method(textInputMode))]
577        #[unsafe(method_family = none)]
578        pub fn textInputMode(&self) -> Option<Retained<UITextInputMode>>;
579
580        #[unsafe(method(textInputContextIdentifier))]
581        #[unsafe(method_family = none)]
582        pub fn textInputContextIdentifier(&self) -> Option<Retained<NSString>>;
583
584        #[unsafe(method(clearTextInputContextIdentifier:))]
585        #[unsafe(method_family = none)]
586        pub fn clearTextInputContextIdentifier(identifier: &NSString, mtm: MainThreadMarker);
587
588        #[unsafe(method(reloadInputViews))]
589        #[unsafe(method_family = none)]
590        pub fn reloadInputViews(&self);
591    );
592}
593
594extern "C" {
595    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputuparrow?language=objc)
596    pub static UIKeyInputUpArrow: &'static NSString;
597}
598
599extern "C" {
600    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputdownarrow?language=objc)
601    pub static UIKeyInputDownArrow: &'static NSString;
602}
603
604extern "C" {
605    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputleftarrow?language=objc)
606    pub static UIKeyInputLeftArrow: &'static NSString;
607}
608
609extern "C" {
610    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputrightarrow?language=objc)
611    pub static UIKeyInputRightArrow: &'static NSString;
612}
613
614extern "C" {
615    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputescape?language=objc)
616    pub static UIKeyInputEscape: &'static NSString;
617}
618
619extern "C" {
620    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputpageup?language=objc)
621    pub static UIKeyInputPageUp: &'static NSString;
622}
623
624extern "C" {
625    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputpagedown?language=objc)
626    pub static UIKeyInputPageDown: &'static NSString;
627}
628
629extern "C" {
630    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputhome?language=objc)
631    pub static UIKeyInputHome: &'static NSString;
632}
633
634extern "C" {
635    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputend?language=objc)
636    pub static UIKeyInputEnd: &'static NSString;
637}
638
639extern "C" {
640    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputf2?language=objc)
641    pub static UIKeyInputF2: &'static NSString;
642}
643
644extern "C" {
645    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputf3?language=objc)
646    pub static UIKeyInputF3: &'static NSString;
647}
648
649extern "C" {
650    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputf4?language=objc)
651    pub static UIKeyInputF4: &'static NSString;
652}
653
654extern "C" {
655    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputf5?language=objc)
656    pub static UIKeyInputF5: &'static NSString;
657}
658
659extern "C" {
660    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputf6?language=objc)
661    pub static UIKeyInputF6: &'static NSString;
662}
663
664extern "C" {
665    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputf7?language=objc)
666    pub static UIKeyInputF7: &'static NSString;
667}
668
669extern "C" {
670    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputf8?language=objc)
671    pub static UIKeyInputF8: &'static NSString;
672}
673
674extern "C" {
675    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputf9?language=objc)
676    pub static UIKeyInputF9: &'static NSString;
677}
678
679extern "C" {
680    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputf10?language=objc)
681    pub static UIKeyInputF10: &'static NSString;
682}
683
684extern "C" {
685    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputf11?language=objc)
686    pub static UIKeyInputF11: &'static NSString;
687}
688
689extern "C" {
690    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputf12?language=objc)
691    pub static UIKeyInputF12: &'static NSString;
692}
693
694extern "C" {
695    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uikeyinputdelete?language=objc)
696    pub static UIKeyInputDelete: &'static NSString;
697}
698
699/// ActivityContinuation.
700impl UIResponder {
701    extern_methods!(
702        #[unsafe(method(userActivity))]
703        #[unsafe(method_family = none)]
704        pub fn userActivity(&self) -> Option<Retained<NSUserActivity>>;
705
706        /// Setter for [`userActivity`][Self::userActivity].
707        #[unsafe(method(setUserActivity:))]
708        #[unsafe(method_family = none)]
709        pub fn setUserActivity(&self, user_activity: Option<&NSUserActivity>);
710
711        #[unsafe(method(updateUserActivityState:))]
712        #[unsafe(method_family = none)]
713        pub fn updateUserActivityState(&self, activity: &NSUserActivity);
714
715        #[unsafe(method(restoreUserActivityState:))]
716        #[unsafe(method_family = none)]
717        pub fn restoreUserActivityState(&self, activity: &NSUserActivity);
718    );
719}
720
721#[cfg(feature = "UIUserActivity")]
722extern_conformance!(
723    unsafe impl UIUserActivityRestoring for UIResponder {}
724);
725
726/// UIPasteConfigurationSupporting.
727impl UIResponder {
728    extern_methods!();
729}
730
731#[cfg(feature = "UIPasteConfigurationSupporting")]
732extern_conformance!(
733    unsafe impl UIPasteConfigurationSupporting for UIResponder {}
734);
735
736/// UICaptureTextFromCameraSupporting.
737impl UIResponder {
738    extern_methods!(
739        /// # Safety
740        ///
741        /// `sender` should be of the correct type.
742        #[unsafe(method(captureTextFromCamera:))]
743        #[unsafe(method_family = none)]
744        pub unsafe fn captureTextFromCamera(&self, sender: Option<&AnyObject>);
745    );
746}