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        #[unsafe(method(awakeWithContext:))]
291        #[unsafe(method_family = none)]
292        pub unsafe fn awakeWithContext(&self, context: Option<&AnyObject>);
293
294        #[cfg(feature = "objc2-core-foundation")]
295        #[unsafe(method(contentFrame))]
296        #[unsafe(method_family = none)]
297        pub unsafe fn contentFrame(&self) -> CGRect;
298
299        #[cfg(feature = "WKCrownSequencer")]
300        #[unsafe(method(crownSequencer))]
301        #[unsafe(method_family = none)]
302        pub unsafe fn crownSequencer(&self) -> Retained<WKCrownSequencer>;
303
304        #[cfg(feature = "objc2-ui-kit")]
305        #[unsafe(method(contentSafeAreaInsets))]
306        #[unsafe(method_family = none)]
307        pub unsafe fn contentSafeAreaInsets(&self) -> UIEdgeInsets;
308
309        #[cfg(feature = "objc2-ui-kit")]
310        #[unsafe(method(systemMinimumLayoutMargins))]
311        #[unsafe(method_family = none)]
312        pub unsafe fn systemMinimumLayoutMargins(&self) -> NSDirectionalEdgeInsets;
313
314        #[unsafe(method(isTableScrollingHapticFeedbackEnabled))]
315        #[unsafe(method_family = none)]
316        pub unsafe fn isTableScrollingHapticFeedbackEnabled(&self) -> bool;
317
318        /// Setter for [`isTableScrollingHapticFeedbackEnabled`][Self::isTableScrollingHapticFeedbackEnabled].
319        #[unsafe(method(setTableScrollingHapticFeedbackEnabled:))]
320        #[unsafe(method_family = none)]
321        pub unsafe fn setTableScrollingHapticFeedbackEnabled(
322            &self,
323            table_scrolling_haptic_feedback_enabled: bool,
324        );
325
326        #[unsafe(method(willActivate))]
327        #[unsafe(method_family = none)]
328        pub unsafe fn willActivate(&self);
329
330        #[unsafe(method(didDeactivate))]
331        #[unsafe(method_family = none)]
332        pub unsafe fn didDeactivate(&self);
333
334        #[unsafe(method(didAppear))]
335        #[unsafe(method_family = none)]
336        pub unsafe fn didAppear(&self);
337
338        #[unsafe(method(willDisappear))]
339        #[unsafe(method_family = none)]
340        pub unsafe fn willDisappear(&self);
341
342        #[cfg(all(feature = "WKInterfaceObject", feature = "WKInterfacePicker"))]
343        #[unsafe(method(pickerDidFocus:))]
344        #[unsafe(method_family = none)]
345        pub unsafe fn pickerDidFocus(&self, picker: &WKInterfacePicker);
346
347        #[cfg(all(feature = "WKInterfaceObject", feature = "WKInterfacePicker"))]
348        #[unsafe(method(pickerDidResignFocus:))]
349        #[unsafe(method_family = none)]
350        pub unsafe fn pickerDidResignFocus(&self, picker: &WKInterfacePicker);
351
352        #[cfg(all(feature = "WKInterfaceObject", feature = "WKInterfacePicker"))]
353        #[unsafe(method(pickerDidSettle:))]
354        #[unsafe(method_family = none)]
355        pub unsafe fn pickerDidSettle(&self, picker: &WKInterfacePicker);
356
357        #[cfg(all(feature = "WKInterfaceObject", feature = "WKInterfaceTable"))]
358        #[unsafe(method(table:didSelectRowAtIndex:))]
359        #[unsafe(method_family = none)]
360        pub unsafe fn table_didSelectRowAtIndex(
361            &self,
362            table: &WKInterfaceTable,
363            row_index: NSInteger,
364        );
365
366        #[unsafe(method(setTitle:))]
367        #[unsafe(method_family = none)]
368        pub unsafe fn setTitle(&self, title: Option<&NSString>);
369
370        #[unsafe(method(pushControllerWithName:context:))]
371        #[unsafe(method_family = none)]
372        pub unsafe fn pushControllerWithName_context(
373            &self,
374            name: &NSString,
375            context: Option<&AnyObject>,
376        );
377
378        #[unsafe(method(popController))]
379        #[unsafe(method_family = none)]
380        pub unsafe fn popController(&self);
381
382        #[unsafe(method(popToRootController))]
383        #[unsafe(method_family = none)]
384        pub unsafe fn popToRootController(&self);
385
386        #[cfg(feature = "WKInterfaceObject")]
387        #[unsafe(method(scrollToObject:atScrollPosition:animated:))]
388        #[unsafe(method_family = none)]
389        pub unsafe fn scrollToObject_atScrollPosition_animated(
390            &self,
391            object: &WKInterfaceObject,
392            scroll_position: WKInterfaceScrollPosition,
393            animated: bool,
394        );
395
396        #[unsafe(method(interfaceDidScrollToTop))]
397        #[unsafe(method_family = none)]
398        pub unsafe fn interfaceDidScrollToTop(&self);
399
400        #[unsafe(method(interfaceOffsetDidScrollToTop))]
401        #[unsafe(method_family = none)]
402        pub unsafe fn interfaceOffsetDidScrollToTop(&self);
403
404        #[unsafe(method(interfaceOffsetDidScrollToBottom))]
405        #[unsafe(method_family = none)]
406        pub unsafe fn interfaceOffsetDidScrollToBottom(&self);
407
408        #[unsafe(method(reloadRootPageControllersWithNames:contexts:orientation:pageIndex:))]
409        #[unsafe(method_family = none)]
410        pub unsafe fn reloadRootPageControllersWithNames_contexts_orientation_pageIndex(
411            names: &NSArray<NSString>,
412            contexts: Option<&NSArray>,
413            orientation: WKPageOrientation,
414            page_index: NSInteger,
415            mtm: MainThreadMarker,
416        );
417
418        #[unsafe(method(becomeCurrentPage))]
419        #[unsafe(method_family = none)]
420        pub unsafe fn becomeCurrentPage(&self);
421
422        #[unsafe(method(presentControllerWithName:context:))]
423        #[unsafe(method_family = none)]
424        pub unsafe fn presentControllerWithName_context(
425            &self,
426            name: &NSString,
427            context: Option<&AnyObject>,
428        );
429
430        #[unsafe(method(presentControllerWithNames:contexts:))]
431        #[unsafe(method_family = none)]
432        pub unsafe fn presentControllerWithNames_contexts(
433            &self,
434            names: &NSArray<NSString>,
435            contexts: Option<&NSArray>,
436        );
437
438        #[unsafe(method(dismissController))]
439        #[unsafe(method_family = none)]
440        pub unsafe fn dismissController(&self);
441
442        #[cfg(feature = "block2")]
443        #[unsafe(method(presentTextInputControllerWithSuggestions:allowedInputMode:completion:))]
444        #[unsafe(method_family = none)]
445        pub unsafe fn presentTextInputControllerWithSuggestions_allowedInputMode_completion(
446            &self,
447            suggestions: Option<&NSArray<NSString>>,
448            input_mode: WKTextInputMode,
449            completion: &block2::DynBlock<dyn Fn(*mut NSArray)>,
450        );
451
452        #[cfg(feature = "block2")]
453        #[unsafe(method(presentTextInputControllerWithSuggestionsForLanguage:allowedInputMode:completion:))]
454        #[unsafe(method_family = none)]
455        pub unsafe fn presentTextInputControllerWithSuggestionsForLanguage_allowedInputMode_completion(
456            &self,
457            suggestions_handler: Option<
458                &block2::DynBlock<dyn Fn(NonNull<NSString>) -> *mut NSArray>,
459            >,
460            input_mode: WKTextInputMode,
461            completion: &block2::DynBlock<dyn Fn(*mut NSArray)>,
462        );
463
464        #[unsafe(method(dismissTextInputController))]
465        #[unsafe(method_family = none)]
466        pub unsafe fn dismissTextInputController(&self);
467
468        #[cfg(feature = "block2")]
469        #[unsafe(method(presentMediaPlayerControllerWithURL:options:completion:))]
470        #[unsafe(method_family = none)]
471        pub unsafe fn presentMediaPlayerControllerWithURL_options_completion(
472            &self,
473            url: &NSURL,
474            options: Option<&NSDictionary>,
475            completion: &block2::DynBlock<dyn Fn(Bool, NSTimeInterval, *mut NSError)>,
476        );
477
478        #[unsafe(method(dismissMediaPlayerController))]
479        #[unsafe(method_family = none)]
480        pub unsafe fn dismissMediaPlayerController(&self);
481
482        #[cfg(feature = "block2")]
483        #[unsafe(method(presentAudioRecorderControllerWithOutputURL:preset:options:completion:))]
484        #[unsafe(method_family = none)]
485        pub unsafe fn presentAudioRecorderControllerWithOutputURL_preset_options_completion(
486            &self,
487            url: &NSURL,
488            preset: WKAudioRecorderPreset,
489            options: Option<&NSDictionary>,
490            completion: &block2::DynBlock<dyn Fn(Bool, *mut NSError)>,
491        );
492
493        #[unsafe(method(dismissAudioRecorderController))]
494        #[unsafe(method_family = none)]
495        pub unsafe fn dismissAudioRecorderController(&self);
496
497        #[unsafe(method(contextForSegueWithIdentifier:))]
498        #[unsafe(method_family = none)]
499        pub unsafe fn contextForSegueWithIdentifier(
500            &self,
501            segue_identifier: &NSString,
502        ) -> Option<Retained<AnyObject>>;
503
504        #[unsafe(method(contextsForSegueWithIdentifier:))]
505        #[unsafe(method_family = none)]
506        pub unsafe fn contextsForSegueWithIdentifier(
507            &self,
508            segue_identifier: &NSString,
509        ) -> Option<Retained<NSArray>>;
510
511        #[cfg(all(feature = "WKInterfaceObject", feature = "WKInterfaceTable"))]
512        #[unsafe(method(contextForSegueWithIdentifier:inTable:rowIndex:))]
513        #[unsafe(method_family = none)]
514        pub unsafe fn contextForSegueWithIdentifier_inTable_rowIndex(
515            &self,
516            segue_identifier: &NSString,
517            table: &WKInterfaceTable,
518            row_index: NSInteger,
519        ) -> Option<Retained<AnyObject>>;
520
521        #[cfg(all(feature = "WKInterfaceObject", feature = "WKInterfaceTable"))]
522        #[unsafe(method(contextsForSegueWithIdentifier:inTable:rowIndex:))]
523        #[unsafe(method_family = none)]
524        pub unsafe fn contextsForSegueWithIdentifier_inTable_rowIndex(
525            &self,
526            segue_identifier: &NSString,
527            table: &WKInterfaceTable,
528            row_index: NSInteger,
529        ) -> Option<Retained<NSArray>>;
530
531        #[cfg(feature = "block2")]
532        #[unsafe(method(animateWithDuration:animations:))]
533        #[unsafe(method_family = none)]
534        pub unsafe fn animateWithDuration_animations(
535            &self,
536            duration: NSTimeInterval,
537            animations: &block2::DynBlock<dyn Fn()>,
538        );
539
540        #[cfg(feature = "WKAlertAction")]
541        #[unsafe(method(presentAlertControllerWithTitle:message:preferredStyle:actions:))]
542        #[unsafe(method_family = none)]
543        pub unsafe fn presentAlertControllerWithTitle_message_preferredStyle_actions(
544            &self,
545            title: Option<&NSString>,
546            message: Option<&NSString>,
547            preferred_style: WKAlertControllerStyle,
548            actions: &NSArray<WKAlertAction>,
549        );
550
551        #[unsafe(method(dismissAddPassesController))]
552        #[unsafe(method_family = none)]
553        pub unsafe fn dismissAddPassesController(&self);
554
555        #[unsafe(method(updateUserActivity:))]
556        #[unsafe(method_family = none)]
557        pub unsafe fn updateUserActivity(&self, user_activity: &NSUserActivity);
558
559        #[unsafe(method(invalidateUserActivity))]
560        #[unsafe(method_family = none)]
561        pub unsafe fn invalidateUserActivity(&self);
562
563        #[deprecated = "Glances are no longer supported"]
564        #[unsafe(method(beginGlanceUpdates))]
565        #[unsafe(method_family = none)]
566        pub unsafe fn beginGlanceUpdates(&self);
567
568        #[deprecated = "Glances are no longer supported"]
569        #[unsafe(method(endGlanceUpdates))]
570        #[unsafe(method_family = none)]
571        pub unsafe fn endGlanceUpdates(&self);
572
573        #[deprecated = "use updateUserActivity:"]
574        #[unsafe(method(updateUserActivity:userInfo:webpageURL:))]
575        #[unsafe(method_family = none)]
576        pub unsafe fn updateUserActivity_userInfo_webpageURL(
577            &self,
578            r#type: &NSString,
579            user_info: Option<&NSDictionary>,
580            webpage_url: Option<&NSURL>,
581        );
582
583        #[deprecated = "use reloadRootPageControllersWithNames:contexts:orientation:pageIndex:"]
584        #[unsafe(method(reloadRootControllersWithNames:contexts:))]
585        #[unsafe(method_family = none)]
586        pub unsafe fn reloadRootControllersWithNames_contexts(
587            names: &NSArray<NSString>,
588            contexts: Option<&NSArray>,
589            mtm: MainThreadMarker,
590        );
591
592        #[deprecated = "use WKExtensionDelegate's handleUserActivity:"]
593        #[unsafe(method(handleUserActivity:))]
594        #[unsafe(method_family = none)]
595        pub unsafe fn handleUserActivity(&self, user_info: Option<&NSDictionary>);
596
597        #[cfg(feature = "objc2-ui-kit")]
598        #[deprecated]
599        #[unsafe(method(addMenuItemWithImage:title:action:))]
600        #[unsafe(method_family = none)]
601        pub unsafe fn addMenuItemWithImage_title_action(
602            &self,
603            image: &UIImage,
604            title: &NSString,
605            action: Sel,
606        );
607
608        #[deprecated]
609        #[unsafe(method(addMenuItemWithImageNamed:title:action:))]
610        #[unsafe(method_family = none)]
611        pub unsafe fn addMenuItemWithImageNamed_title_action(
612            &self,
613            image_name: &NSString,
614            title: &NSString,
615            action: Sel,
616        );
617
618        #[deprecated]
619        #[unsafe(method(addMenuItemWithItemIcon:title:action:))]
620        #[unsafe(method_family = none)]
621        pub unsafe fn addMenuItemWithItemIcon_title_action(
622            &self,
623            item_icon: WKMenuItemIcon,
624            title: &NSString,
625            action: Sel,
626        );
627
628        #[deprecated]
629        #[unsafe(method(clearAllMenuItems))]
630        #[unsafe(method_family = none)]
631        pub unsafe fn clearAllMenuItems(&self);
632    );
633}
634
635/// Methods declared on superclass `NSObject`.
636impl WKInterfaceController {
637    extern_methods!(
638        #[unsafe(method(new))]
639        #[unsafe(method_family = new)]
640        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
641    );
642}
643
644extern_class!(
645    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkusernotificationinterfacecontroller?language=objc)
646    #[unsafe(super(WKInterfaceController, NSObject))]
647    #[thread_kind = MainThreadOnly]
648    #[derive(Debug, PartialEq, Eq, Hash)]
649    pub struct WKUserNotificationInterfaceController;
650);
651
652extern_conformance!(
653    unsafe impl NSObjectProtocol for WKUserNotificationInterfaceController {}
654);
655
656impl WKUserNotificationInterfaceController {
657    extern_methods!(
658        #[unsafe(method(init))]
659        #[unsafe(method_family = init)]
660        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
661
662        #[cfg(feature = "objc2-user-notifications")]
663        #[unsafe(method(notificationActions))]
664        #[unsafe(method_family = none)]
665        pub unsafe fn notificationActions(&self) -> Retained<NSArray<UNNotificationAction>>;
666
667        #[cfg(feature = "objc2-user-notifications")]
668        /// Setter for [`notificationActions`][Self::notificationActions].
669        #[unsafe(method(setNotificationActions:))]
670        #[unsafe(method_family = none)]
671        pub unsafe fn setNotificationActions(
672            &self,
673            notification_actions: &NSArray<UNNotificationAction>,
674        );
675
676        #[cfg(feature = "objc2-user-notifications")]
677        #[unsafe(method(didReceiveNotification:))]
678        #[unsafe(method_family = none)]
679        pub unsafe fn didReceiveNotification(&self, notification: &UNNotification);
680
681        #[cfg(feature = "objc2-user-notifications")]
682        #[unsafe(method(suggestionsForResponseToActionWithIdentifier:forNotification:inputLanguage:))]
683        #[unsafe(method_family = none)]
684        pub unsafe fn suggestionsForResponseToActionWithIdentifier_forNotification_inputLanguage(
685            &self,
686            identifier: &NSString,
687            notification: &UNNotification,
688            input_language: &NSString,
689        ) -> Retained<NSArray<NSString>>;
690
691        #[unsafe(method(performNotificationDefaultAction))]
692        #[unsafe(method_family = none)]
693        pub unsafe fn performNotificationDefaultAction(&self);
694
695        #[unsafe(method(performDismissAction))]
696        #[unsafe(method_family = none)]
697        pub unsafe fn performDismissAction(&self);
698
699        #[deprecated = "use performDismissAction"]
700        #[unsafe(method(dismissController))]
701        #[unsafe(method_family = none)]
702        pub unsafe fn dismissController(&self);
703
704        #[cfg(all(feature = "block2", feature = "objc2-user-notifications"))]
705        #[deprecated = "use didReceiveNotification:"]
706        #[unsafe(method(didReceiveNotification:withCompletion:))]
707        #[unsafe(method_family = none)]
708        pub unsafe fn didReceiveNotification_withCompletion(
709            &self,
710            notification: &UNNotification,
711            completion_handler: &block2::DynBlock<dyn Fn(WKUserNotificationInterfaceType)>,
712        );
713    );
714}
715
716/// Methods declared on superclass `NSObject`.
717impl WKUserNotificationInterfaceController {
718    extern_methods!(
719        #[unsafe(method(new))]
720        #[unsafe(method_family = new)]
721        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
722    );
723}