objc2_watch_kit/generated/
WKInterfaceController.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-ui-kit")]
10use objc2_ui_kit::*;
11#[cfg(feature = "objc2-user-notifications")]
12use objc2_user_notifications::*;
13
14use crate::*;
15
16/// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkusernotificationinterfacetype?language=objc)
17// NS_ENUM
18#[repr(transparent)]
19#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
20pub struct WKUserNotificationInterfaceType(pub NSInteger);
21impl WKUserNotificationInterfaceType {
22    #[doc(alias = "WKUserNotificationInterfaceTypeDefault")]
23    pub const Default: Self = Self(0);
24    #[doc(alias = "WKUserNotificationInterfaceTypeCustom")]
25    pub const Custom: Self = Self(1);
26}
27
28unsafe impl Encode for WKUserNotificationInterfaceType {
29    const ENCODING: Encoding = NSInteger::ENCODING;
30}
31
32unsafe impl RefEncode for WKUserNotificationInterfaceType {
33    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36/// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkmenuitemicon?language=objc)
37// NS_ENUM
38#[deprecated]
39#[repr(transparent)]
40#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
41pub struct WKMenuItemIcon(pub NSInteger);
42impl WKMenuItemIcon {
43    #[doc(alias = "WKMenuItemIconAccept")]
44    #[deprecated]
45    pub const Accept: Self = Self(0);
46    #[doc(alias = "WKMenuItemIconAdd")]
47    #[deprecated]
48    pub const Add: Self = Self(1);
49    #[doc(alias = "WKMenuItemIconBlock")]
50    #[deprecated]
51    pub const Block: Self = Self(2);
52    #[doc(alias = "WKMenuItemIconDecline")]
53    #[deprecated]
54    pub const Decline: Self = Self(3);
55    #[doc(alias = "WKMenuItemIconInfo")]
56    #[deprecated]
57    pub const Info: Self = Self(4);
58    #[doc(alias = "WKMenuItemIconMaybe")]
59    #[deprecated]
60    pub const Maybe: Self = Self(5);
61    #[doc(alias = "WKMenuItemIconMore")]
62    #[deprecated]
63    pub const More: Self = Self(6);
64    #[doc(alias = "WKMenuItemIconMute")]
65    #[deprecated]
66    pub const Mute: Self = Self(7);
67    #[doc(alias = "WKMenuItemIconPause")]
68    #[deprecated]
69    pub const Pause: Self = Self(8);
70    #[doc(alias = "WKMenuItemIconPlay")]
71    #[deprecated]
72    pub const Play: Self = Self(9);
73    #[doc(alias = "WKMenuItemIconRepeat")]
74    #[deprecated]
75    pub const Repeat: Self = Self(10);
76    #[doc(alias = "WKMenuItemIconResume")]
77    #[deprecated]
78    pub const Resume: Self = Self(11);
79    #[doc(alias = "WKMenuItemIconShare")]
80    #[deprecated]
81    pub const Share: Self = Self(12);
82    #[doc(alias = "WKMenuItemIconShuffle")]
83    #[deprecated]
84    pub const Shuffle: Self = Self(13);
85    #[doc(alias = "WKMenuItemIconSpeaker")]
86    #[deprecated]
87    pub const Speaker: Self = Self(14);
88    #[doc(alias = "WKMenuItemIconTrash")]
89    #[deprecated]
90    pub const Trash: Self = Self(15);
91}
92
93unsafe impl Encode for WKMenuItemIcon {
94    const ENCODING: Encoding = NSInteger::ENCODING;
95}
96
97unsafe impl RefEncode for WKMenuItemIcon {
98    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
99}
100
101/// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wktextinputmode?language=objc)
102// NS_ENUM
103#[repr(transparent)]
104#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
105pub struct WKTextInputMode(pub NSInteger);
106impl WKTextInputMode {
107    #[doc(alias = "WKTextInputModePlain")]
108    pub const Plain: Self = Self(0);
109    #[doc(alias = "WKTextInputModeAllowEmoji")]
110    pub const AllowEmoji: Self = Self(1);
111    #[doc(alias = "WKTextInputModeAllowAnimatedEmoji")]
112    #[deprecated = "Animated Emojis are no longer supported. Use WKTextInputModeAllowEmoji instead"]
113    pub const AllowAnimatedEmoji: Self = Self(2);
114}
115
116unsafe impl Encode for WKTextInputMode {
117    const ENCODING: Encoding = NSInteger::ENCODING;
118}
119
120unsafe impl RefEncode for WKTextInputMode {
121    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
122}
123
124/// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkalertcontrollerstyle?language=objc)
125// NS_ENUM
126#[repr(transparent)]
127#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
128pub struct WKAlertControllerStyle(pub NSInteger);
129impl WKAlertControllerStyle {
130    #[doc(alias = "WKAlertControllerStyleAlert")]
131    pub const Alert: Self = Self(0);
132    #[doc(alias = "WKAlertControllerStyleSideBySideButtonsAlert")]
133    pub const SideBySideButtonsAlert: Self = Self(1);
134    #[doc(alias = "WKAlertControllerStyleActionSheet")]
135    pub const ActionSheet: Self = Self(2);
136}
137
138unsafe impl Encode for WKAlertControllerStyle {
139    const ENCODING: Encoding = NSInteger::ENCODING;
140}
141
142unsafe impl RefEncode for WKAlertControllerStyle {
143    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
144}
145
146/// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkpageorientation?language=objc)
147// NS_ENUM
148#[repr(transparent)]
149#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
150pub struct WKPageOrientation(pub NSInteger);
151impl WKPageOrientation {
152    #[doc(alias = "WKPageOrientationHorizontal")]
153    pub const Horizontal: Self = Self(0);
154    #[doc(alias = "WKPageOrientationVertical")]
155    pub const Vertical: Self = Self(1);
156}
157
158unsafe impl Encode for WKPageOrientation {
159    const ENCODING: Encoding = NSInteger::ENCODING;
160}
161
162unsafe impl RefEncode for WKPageOrientation {
163    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
164}
165
166/// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkinterfacescrollposition?language=objc)
167// NS_ENUM
168#[repr(transparent)]
169#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
170pub struct WKInterfaceScrollPosition(pub NSInteger);
171impl WKInterfaceScrollPosition {
172    #[doc(alias = "WKInterfaceScrollPositionTop")]
173    pub const Top: Self = Self(0);
174    #[doc(alias = "WKInterfaceScrollPositionCenteredVertically")]
175    pub const CenteredVertically: Self = Self(1);
176    #[doc(alias = "WKInterfaceScrollPositionBottom")]
177    pub const Bottom: Self = Self(2);
178}
179
180unsafe impl Encode for WKInterfaceScrollPosition {
181    const ENCODING: Encoding = NSInteger::ENCODING;
182}
183
184unsafe impl RefEncode for WKInterfaceScrollPosition {
185    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
186}
187
188/// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkvideogravity?language=objc)
189// NS_ENUM
190#[repr(transparent)]
191#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
192pub struct WKVideoGravity(pub NSInteger);
193impl WKVideoGravity {
194    #[doc(alias = "WKVideoGravityResizeAspect")]
195    pub const ResizeAspect: Self = Self(0);
196    #[doc(alias = "WKVideoGravityResizeAspectFill")]
197    pub const ResizeAspectFill: Self = Self(1);
198    #[doc(alias = "WKVideoGravityResize")]
199    pub const Resize: Self = Self(2);
200}
201
202unsafe impl Encode for WKVideoGravity {
203    const ENCODING: Encoding = NSInteger::ENCODING;
204}
205
206unsafe impl RefEncode for WKVideoGravity {
207    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
208}
209
210/// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiorecorderpreset?language=objc)
211// NS_ENUM
212#[repr(transparent)]
213#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
214pub struct WKAudioRecorderPreset(pub NSInteger);
215impl WKAudioRecorderPreset {
216    #[doc(alias = "WKAudioRecorderPresetNarrowBandSpeech")]
217    pub const NarrowBandSpeech: Self = Self(0);
218    #[doc(alias = "WKAudioRecorderPresetWideBandSpeech")]
219    pub const WideBandSpeech: Self = Self(1);
220    #[doc(alias = "WKAudioRecorderPresetHighQualityAudio")]
221    pub const HighQualityAudio: Self = Self(2);
222}
223
224unsafe impl Encode for WKAudioRecorderPreset {
225    const ENCODING: Encoding = NSInteger::ENCODING;
226}
227
228unsafe impl RefEncode for WKAudioRecorderPreset {
229    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
230}
231
232extern "C" {
233    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkmediaplayercontrolleroptionsautoplaykey?language=objc)
234    pub static WKMediaPlayerControllerOptionsAutoplayKey: &'static NSString;
235}
236
237extern "C" {
238    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkmediaplayercontrolleroptionsstarttimekey?language=objc)
239    pub static WKMediaPlayerControllerOptionsStartTimeKey: &'static NSString;
240}
241
242extern "C" {
243    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkmediaplayercontrolleroptionsvideogravitykey?language=objc)
244    pub static WKMediaPlayerControllerOptionsVideoGravityKey: &'static NSString;
245}
246
247extern "C" {
248    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkmediaplayercontrolleroptionsloopskey?language=objc)
249    pub static WKMediaPlayerControllerOptionsLoopsKey: &'static NSString;
250}
251
252extern "C" {
253    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiorecordercontrolleroptionsactiontitlekey?language=objc)
254    pub static WKAudioRecorderControllerOptionsActionTitleKey: &'static NSString;
255}
256
257extern "C" {
258    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiorecordercontrolleroptionsalwaysshowactiontitlekey?language=objc)
259    pub static WKAudioRecorderControllerOptionsAlwaysShowActionTitleKey: &'static NSString;
260}
261
262extern "C" {
263    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiorecordercontrolleroptionsautorecordkey?language=objc)
264    pub static WKAudioRecorderControllerOptionsAutorecordKey: &'static NSString;
265}
266
267extern "C" {
268    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkaudiorecordercontrolleroptionsmaximumdurationkey?language=objc)
269    pub static WKAudioRecorderControllerOptionsMaximumDurationKey: &'static NSString;
270}
271
272extern_class!(
273    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkinterfacecontroller?language=objc)
274    #[unsafe(super(NSObject))]
275    #[thread_kind = MainThreadOnly]
276    #[derive(Debug, PartialEq, Eq, Hash)]
277    pub struct WKInterfaceController;
278);
279
280extern_conformance!(
281    unsafe impl NSObjectProtocol for WKInterfaceController {}
282);
283
284impl WKInterfaceController {
285    extern_methods!(
286        #[unsafe(method(init))]
287        #[unsafe(method_family = init)]
288        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
289
290        /// # Safety
291        ///
292        /// `context` should be of the correct type.
293        #[unsafe(method(awakeWithContext:))]
294        #[unsafe(method_family = none)]
295        pub unsafe fn awakeWithContext(&self, context: Option<&AnyObject>);
296
297        #[cfg(feature = "objc2-core-foundation")]
298        #[unsafe(method(contentFrame))]
299        #[unsafe(method_family = none)]
300        pub unsafe fn contentFrame(&self) -> CGRect;
301
302        #[cfg(feature = "WKCrownSequencer")]
303        #[unsafe(method(crownSequencer))]
304        #[unsafe(method_family = none)]
305        pub unsafe fn crownSequencer(&self) -> Retained<WKCrownSequencer>;
306
307        #[cfg(feature = "objc2-ui-kit")]
308        #[unsafe(method(contentSafeAreaInsets))]
309        #[unsafe(method_family = none)]
310        pub unsafe fn contentSafeAreaInsets(&self) -> UIEdgeInsets;
311
312        #[cfg(feature = "objc2-ui-kit")]
313        #[unsafe(method(systemMinimumLayoutMargins))]
314        #[unsafe(method_family = none)]
315        pub unsafe fn systemMinimumLayoutMargins(&self) -> NSDirectionalEdgeInsets;
316
317        #[unsafe(method(isTableScrollingHapticFeedbackEnabled))]
318        #[unsafe(method_family = none)]
319        pub unsafe fn isTableScrollingHapticFeedbackEnabled(&self) -> bool;
320
321        /// Setter for [`isTableScrollingHapticFeedbackEnabled`][Self::isTableScrollingHapticFeedbackEnabled].
322        #[unsafe(method(setTableScrollingHapticFeedbackEnabled:))]
323        #[unsafe(method_family = none)]
324        pub unsafe fn setTableScrollingHapticFeedbackEnabled(
325            &self,
326            table_scrolling_haptic_feedback_enabled: bool,
327        );
328
329        #[unsafe(method(willActivate))]
330        #[unsafe(method_family = none)]
331        pub unsafe fn willActivate(&self);
332
333        #[unsafe(method(didDeactivate))]
334        #[unsafe(method_family = none)]
335        pub unsafe fn didDeactivate(&self);
336
337        #[unsafe(method(didAppear))]
338        #[unsafe(method_family = none)]
339        pub unsafe fn didAppear(&self);
340
341        #[unsafe(method(willDisappear))]
342        #[unsafe(method_family = none)]
343        pub unsafe fn willDisappear(&self);
344
345        #[cfg(all(feature = "WKInterfaceObject", feature = "WKInterfacePicker"))]
346        #[unsafe(method(pickerDidFocus:))]
347        #[unsafe(method_family = none)]
348        pub unsafe fn pickerDidFocus(&self, picker: &WKInterfacePicker);
349
350        #[cfg(all(feature = "WKInterfaceObject", feature = "WKInterfacePicker"))]
351        #[unsafe(method(pickerDidResignFocus:))]
352        #[unsafe(method_family = none)]
353        pub unsafe fn pickerDidResignFocus(&self, picker: &WKInterfacePicker);
354
355        #[cfg(all(feature = "WKInterfaceObject", feature = "WKInterfacePicker"))]
356        #[unsafe(method(pickerDidSettle:))]
357        #[unsafe(method_family = none)]
358        pub unsafe fn pickerDidSettle(&self, picker: &WKInterfacePicker);
359
360        #[cfg(all(feature = "WKInterfaceObject", feature = "WKInterfaceTable"))]
361        #[unsafe(method(table:didSelectRowAtIndex:))]
362        #[unsafe(method_family = none)]
363        pub unsafe fn table_didSelectRowAtIndex(
364            &self,
365            table: &WKInterfaceTable,
366            row_index: NSInteger,
367        );
368
369        #[unsafe(method(setTitle:))]
370        #[unsafe(method_family = none)]
371        pub unsafe fn setTitle(&self, title: Option<&NSString>);
372
373        /// # Safety
374        ///
375        /// `context` should be of the correct type.
376        #[unsafe(method(pushControllerWithName:context:))]
377        #[unsafe(method_family = none)]
378        pub unsafe fn pushControllerWithName_context(
379            &self,
380            name: &NSString,
381            context: Option<&AnyObject>,
382        );
383
384        #[unsafe(method(popController))]
385        #[unsafe(method_family = none)]
386        pub unsafe fn popController(&self);
387
388        #[unsafe(method(popToRootController))]
389        #[unsafe(method_family = none)]
390        pub unsafe fn popToRootController(&self);
391
392        #[cfg(feature = "WKInterfaceObject")]
393        #[unsafe(method(scrollToObject:atScrollPosition:animated:))]
394        #[unsafe(method_family = none)]
395        pub unsafe fn scrollToObject_atScrollPosition_animated(
396            &self,
397            object: &WKInterfaceObject,
398            scroll_position: WKInterfaceScrollPosition,
399            animated: bool,
400        );
401
402        #[unsafe(method(interfaceDidScrollToTop))]
403        #[unsafe(method_family = none)]
404        pub unsafe fn interfaceDidScrollToTop(&self);
405
406        #[unsafe(method(interfaceOffsetDidScrollToTop))]
407        #[unsafe(method_family = none)]
408        pub unsafe fn interfaceOffsetDidScrollToTop(&self);
409
410        #[unsafe(method(interfaceOffsetDidScrollToBottom))]
411        #[unsafe(method_family = none)]
412        pub unsafe fn interfaceOffsetDidScrollToBottom(&self);
413
414        /// # Safety
415        ///
416        /// `contexts` generic should be of the correct type.
417        #[unsafe(method(reloadRootPageControllersWithNames:contexts:orientation:pageIndex:))]
418        #[unsafe(method_family = none)]
419        pub unsafe fn reloadRootPageControllersWithNames_contexts_orientation_pageIndex(
420            names: &NSArray<NSString>,
421            contexts: Option<&NSArray>,
422            orientation: WKPageOrientation,
423            page_index: NSInteger,
424            mtm: MainThreadMarker,
425        );
426
427        #[unsafe(method(becomeCurrentPage))]
428        #[unsafe(method_family = none)]
429        pub unsafe fn becomeCurrentPage(&self);
430
431        /// # Safety
432        ///
433        /// `context` should be of the correct type.
434        #[unsafe(method(presentControllerWithName:context:))]
435        #[unsafe(method_family = none)]
436        pub unsafe fn presentControllerWithName_context(
437            &self,
438            name: &NSString,
439            context: Option<&AnyObject>,
440        );
441
442        /// # Safety
443        ///
444        /// `contexts` generic should be of the correct type.
445        #[unsafe(method(presentControllerWithNames:contexts:))]
446        #[unsafe(method_family = none)]
447        pub unsafe fn presentControllerWithNames_contexts(
448            &self,
449            names: &NSArray<NSString>,
450            contexts: Option<&NSArray>,
451        );
452
453        #[unsafe(method(dismissController))]
454        #[unsafe(method_family = none)]
455        pub unsafe fn dismissController(&self);
456
457        #[cfg(feature = "block2")]
458        #[unsafe(method(presentTextInputControllerWithSuggestions:allowedInputMode:completion:))]
459        #[unsafe(method_family = none)]
460        pub unsafe fn presentTextInputControllerWithSuggestions_allowedInputMode_completion(
461            &self,
462            suggestions: Option<&NSArray<NSString>>,
463            input_mode: WKTextInputMode,
464            completion: &block2::DynBlock<dyn Fn(*mut NSArray)>,
465        );
466
467        #[cfg(feature = "block2")]
468        /// # Safety
469        ///
470        /// `suggestions_handler` block's return must be a valid pointer or null.
471        #[unsafe(method(presentTextInputControllerWithSuggestionsForLanguage:allowedInputMode:completion:))]
472        #[unsafe(method_family = none)]
473        pub unsafe fn presentTextInputControllerWithSuggestionsForLanguage_allowedInputMode_completion(
474            &self,
475            suggestions_handler: Option<
476                &block2::DynBlock<dyn Fn(NonNull<NSString>) -> *mut NSArray>,
477            >,
478            input_mode: WKTextInputMode,
479            completion: &block2::DynBlock<dyn Fn(*mut NSArray)>,
480        );
481
482        #[unsafe(method(dismissTextInputController))]
483        #[unsafe(method_family = none)]
484        pub unsafe fn dismissTextInputController(&self);
485
486        #[cfg(feature = "block2")]
487        /// # Safety
488        ///
489        /// `options` generic should be of the correct type.
490        #[unsafe(method(presentMediaPlayerControllerWithURL:options:completion:))]
491        #[unsafe(method_family = none)]
492        pub unsafe fn presentMediaPlayerControllerWithURL_options_completion(
493            &self,
494            url: &NSURL,
495            options: Option<&NSDictionary>,
496            completion: &block2::DynBlock<dyn Fn(Bool, NSTimeInterval, *mut NSError)>,
497        );
498
499        #[unsafe(method(dismissMediaPlayerController))]
500        #[unsafe(method_family = none)]
501        pub unsafe fn dismissMediaPlayerController(&self);
502
503        #[cfg(feature = "block2")]
504        /// # Safety
505        ///
506        /// `options` generic should be of the correct type.
507        #[unsafe(method(presentAudioRecorderControllerWithOutputURL:preset:options:completion:))]
508        #[unsafe(method_family = none)]
509        pub unsafe fn presentAudioRecorderControllerWithOutputURL_preset_options_completion(
510            &self,
511            url: &NSURL,
512            preset: WKAudioRecorderPreset,
513            options: Option<&NSDictionary>,
514            completion: &block2::DynBlock<dyn Fn(Bool, *mut NSError)>,
515        );
516
517        #[unsafe(method(dismissAudioRecorderController))]
518        #[unsafe(method_family = none)]
519        pub unsafe fn dismissAudioRecorderController(&self);
520
521        #[unsafe(method(contextForSegueWithIdentifier:))]
522        #[unsafe(method_family = none)]
523        pub unsafe fn contextForSegueWithIdentifier(
524            &self,
525            segue_identifier: &NSString,
526        ) -> Option<Retained<AnyObject>>;
527
528        #[unsafe(method(contextsForSegueWithIdentifier:))]
529        #[unsafe(method_family = none)]
530        pub unsafe fn contextsForSegueWithIdentifier(
531            &self,
532            segue_identifier: &NSString,
533        ) -> Option<Retained<NSArray>>;
534
535        #[cfg(all(feature = "WKInterfaceObject", feature = "WKInterfaceTable"))]
536        #[unsafe(method(contextForSegueWithIdentifier:inTable:rowIndex:))]
537        #[unsafe(method_family = none)]
538        pub unsafe fn contextForSegueWithIdentifier_inTable_rowIndex(
539            &self,
540            segue_identifier: &NSString,
541            table: &WKInterfaceTable,
542            row_index: NSInteger,
543        ) -> Option<Retained<AnyObject>>;
544
545        #[cfg(all(feature = "WKInterfaceObject", feature = "WKInterfaceTable"))]
546        #[unsafe(method(contextsForSegueWithIdentifier:inTable:rowIndex:))]
547        #[unsafe(method_family = none)]
548        pub unsafe fn contextsForSegueWithIdentifier_inTable_rowIndex(
549            &self,
550            segue_identifier: &NSString,
551            table: &WKInterfaceTable,
552            row_index: NSInteger,
553        ) -> Option<Retained<NSArray>>;
554
555        #[cfg(feature = "block2")]
556        #[unsafe(method(animateWithDuration:animations:))]
557        #[unsafe(method_family = none)]
558        pub unsafe fn animateWithDuration_animations(
559            &self,
560            duration: NSTimeInterval,
561            animations: &block2::DynBlock<dyn Fn()>,
562        );
563
564        #[cfg(feature = "WKAlertAction")]
565        #[unsafe(method(presentAlertControllerWithTitle:message:preferredStyle:actions:))]
566        #[unsafe(method_family = none)]
567        pub unsafe fn presentAlertControllerWithTitle_message_preferredStyle_actions(
568            &self,
569            title: Option<&NSString>,
570            message: Option<&NSString>,
571            preferred_style: WKAlertControllerStyle,
572            actions: &NSArray<WKAlertAction>,
573        );
574
575        #[unsafe(method(dismissAddPassesController))]
576        #[unsafe(method_family = none)]
577        pub unsafe fn dismissAddPassesController(&self);
578
579        #[unsafe(method(updateUserActivity:))]
580        #[unsafe(method_family = none)]
581        pub unsafe fn updateUserActivity(&self, user_activity: &NSUserActivity);
582
583        #[unsafe(method(invalidateUserActivity))]
584        #[unsafe(method_family = none)]
585        pub unsafe fn invalidateUserActivity(&self);
586
587        #[deprecated = "Glances are no longer supported"]
588        #[unsafe(method(beginGlanceUpdates))]
589        #[unsafe(method_family = none)]
590        pub unsafe fn beginGlanceUpdates(&self);
591
592        #[deprecated = "Glances are no longer supported"]
593        #[unsafe(method(endGlanceUpdates))]
594        #[unsafe(method_family = none)]
595        pub unsafe fn endGlanceUpdates(&self);
596
597        /// # Safety
598        ///
599        /// `user_info` generic should be of the correct type.
600        #[deprecated = "use updateUserActivity:"]
601        #[unsafe(method(updateUserActivity:userInfo:webpageURL:))]
602        #[unsafe(method_family = none)]
603        pub unsafe fn updateUserActivity_userInfo_webpageURL(
604            &self,
605            r#type: &NSString,
606            user_info: Option<&NSDictionary>,
607            webpage_url: Option<&NSURL>,
608        );
609
610        /// # Safety
611        ///
612        /// `contexts` generic should be of the correct type.
613        #[deprecated = "use reloadRootPageControllersWithNames:contexts:orientation:pageIndex:"]
614        #[unsafe(method(reloadRootControllersWithNames:contexts:))]
615        #[unsafe(method_family = none)]
616        pub unsafe fn reloadRootControllersWithNames_contexts(
617            names: &NSArray<NSString>,
618            contexts: Option<&NSArray>,
619            mtm: MainThreadMarker,
620        );
621
622        /// # Safety
623        ///
624        /// `user_info` generic should be of the correct type.
625        #[deprecated = "use WKExtensionDelegate's handleUserActivity:"]
626        #[unsafe(method(handleUserActivity:))]
627        #[unsafe(method_family = none)]
628        pub unsafe fn handleUserActivity(&self, user_info: Option<&NSDictionary>);
629
630        #[cfg(feature = "objc2-ui-kit")]
631        /// # Safety
632        ///
633        /// `action` must be a valid selector.
634        #[deprecated]
635        #[unsafe(method(addMenuItemWithImage:title:action:))]
636        #[unsafe(method_family = none)]
637        pub unsafe fn addMenuItemWithImage_title_action(
638            &self,
639            image: &UIImage,
640            title: &NSString,
641            action: Sel,
642        );
643
644        /// # Safety
645        ///
646        /// `action` must be a valid selector.
647        #[deprecated]
648        #[unsafe(method(addMenuItemWithImageNamed:title:action:))]
649        #[unsafe(method_family = none)]
650        pub unsafe fn addMenuItemWithImageNamed_title_action(
651            &self,
652            image_name: &NSString,
653            title: &NSString,
654            action: Sel,
655        );
656
657        /// # Safety
658        ///
659        /// `action` must be a valid selector.
660        #[deprecated]
661        #[unsafe(method(addMenuItemWithItemIcon:title:action:))]
662        #[unsafe(method_family = none)]
663        pub unsafe fn addMenuItemWithItemIcon_title_action(
664            &self,
665            item_icon: WKMenuItemIcon,
666            title: &NSString,
667            action: Sel,
668        );
669
670        #[deprecated]
671        #[unsafe(method(clearAllMenuItems))]
672        #[unsafe(method_family = none)]
673        pub unsafe fn clearAllMenuItems(&self);
674    );
675}
676
677/// Methods declared on superclass `NSObject`.
678impl WKInterfaceController {
679    extern_methods!(
680        #[unsafe(method(new))]
681        #[unsafe(method_family = new)]
682        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
683    );
684}
685
686extern_class!(
687    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkusernotificationinterfacecontroller?language=objc)
688    #[unsafe(super(WKInterfaceController, NSObject))]
689    #[thread_kind = MainThreadOnly]
690    #[derive(Debug, PartialEq, Eq, Hash)]
691    pub struct WKUserNotificationInterfaceController;
692);
693
694extern_conformance!(
695    unsafe impl NSObjectProtocol for WKUserNotificationInterfaceController {}
696);
697
698impl WKUserNotificationInterfaceController {
699    extern_methods!(
700        #[unsafe(method(init))]
701        #[unsafe(method_family = init)]
702        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
703
704        #[cfg(feature = "objc2-user-notifications")]
705        #[unsafe(method(notificationActions))]
706        #[unsafe(method_family = none)]
707        pub unsafe fn notificationActions(&self) -> Retained<NSArray<UNNotificationAction>>;
708
709        #[cfg(feature = "objc2-user-notifications")]
710        /// Setter for [`notificationActions`][Self::notificationActions].
711        ///
712        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
713        #[unsafe(method(setNotificationActions:))]
714        #[unsafe(method_family = none)]
715        pub unsafe fn setNotificationActions(
716            &self,
717            notification_actions: &NSArray<UNNotificationAction>,
718        );
719
720        #[cfg(feature = "objc2-user-notifications")]
721        #[unsafe(method(didReceiveNotification:))]
722        #[unsafe(method_family = none)]
723        pub unsafe fn didReceiveNotification(&self, notification: &UNNotification);
724
725        #[cfg(feature = "objc2-user-notifications")]
726        #[unsafe(method(suggestionsForResponseToActionWithIdentifier:forNotification:inputLanguage:))]
727        #[unsafe(method_family = none)]
728        pub unsafe fn suggestionsForResponseToActionWithIdentifier_forNotification_inputLanguage(
729            &self,
730            identifier: &NSString,
731            notification: &UNNotification,
732            input_language: &NSString,
733        ) -> Retained<NSArray<NSString>>;
734
735        #[unsafe(method(performNotificationDefaultAction))]
736        #[unsafe(method_family = none)]
737        pub unsafe fn performNotificationDefaultAction(&self);
738
739        #[unsafe(method(performDismissAction))]
740        #[unsafe(method_family = none)]
741        pub unsafe fn performDismissAction(&self);
742
743        #[deprecated = "use performDismissAction"]
744        #[unsafe(method(dismissController))]
745        #[unsafe(method_family = none)]
746        pub unsafe fn dismissController(&self);
747
748        #[cfg(all(feature = "block2", feature = "objc2-user-notifications"))]
749        #[deprecated = "use didReceiveNotification:"]
750        #[unsafe(method(didReceiveNotification:withCompletion:))]
751        #[unsafe(method_family = none)]
752        pub unsafe fn didReceiveNotification_withCompletion(
753            &self,
754            notification: &UNNotification,
755            completion_handler: &block2::DynBlock<dyn Fn(WKUserNotificationInterfaceType)>,
756        );
757    );
758}
759
760/// Methods declared on superclass `NSObject`.
761impl WKUserNotificationInterfaceController {
762    extern_methods!(
763        #[unsafe(method(new))]
764        #[unsafe(method_family = new)]
765        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
766    );
767}