objc2_watch_kit/generated/
WKAlertAction.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct WKAlertActionStyle(pub NSInteger);
15impl WKAlertActionStyle {
16 #[doc(alias = "WKAlertActionStyleDefault")]
17 pub const Default: Self = Self(0);
18 #[doc(alias = "WKAlertActionStyleCancel")]
19 pub const Cancel: Self = Self(1);
20 #[doc(alias = "WKAlertActionStyleDestructive")]
21 pub const Destructive: Self = Self(2);
22}
23
24unsafe impl Encode for WKAlertActionStyle {
25 const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for WKAlertActionStyle {
29 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32#[cfg(feature = "block2")]
34pub type WKAlertActionHandler = *mut block2::DynBlock<dyn Fn()>;
35
36extern_class!(
37 #[unsafe(super(NSObject))]
39 #[derive(Debug, PartialEq, Eq, Hash)]
40 pub struct WKAlertAction;
41);
42
43extern_conformance!(
44 unsafe impl NSObjectProtocol for WKAlertAction {}
45);
46
47impl WKAlertAction {
48 extern_methods!(
49 #[cfg(feature = "block2")]
50 #[unsafe(method(actionWithTitle:style:handler:))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn actionWithTitle_style_handler(
56 title: &NSString,
57 style: WKAlertActionStyle,
58 handler: WKAlertActionHandler,
59 ) -> Retained<Self>;
60
61 #[unsafe(method(init))]
62 #[unsafe(method_family = init)]
63 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
64 );
65}
66
67impl WKAlertAction {
69 extern_methods!(
70 #[unsafe(method(new))]
71 #[unsafe(method_family = new)]
72 pub unsafe fn new() -> Retained<Self>;
73 );
74}