use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKAlertActionStyle(pub NSInteger);
impl WKAlertActionStyle {
#[doc(alias = "WKAlertActionStyleDefault")]
pub const Default: Self = Self(0);
#[doc(alias = "WKAlertActionStyleCancel")]
pub const Cancel: Self = Self(1);
#[doc(alias = "WKAlertActionStyleDestructive")]
pub const Destructive: Self = Self(2);
}
unsafe impl Encode for WKAlertActionStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for WKAlertActionStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[cfg(feature = "block2")]
pub type WKAlertActionHandler = *mut block2::DynBlock<dyn Fn()>;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct WKAlertAction;
);
extern_conformance!(
unsafe impl NSObjectProtocol for WKAlertAction {}
);
impl WKAlertAction {
extern_methods!(
#[cfg(feature = "block2")]
#[unsafe(method(actionWithTitle:style:handler:))]
#[unsafe(method_family = none)]
pub unsafe fn actionWithTitle_style_handler(
title: &NSString,
style: WKAlertActionStyle,
handler: WKAlertActionHandler,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
impl WKAlertAction {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}