use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-location")]
use objc2_core_location::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct SACrashDetectionEventResponse(pub NSInteger);
impl SACrashDetectionEventResponse {
#[doc(alias = "SACrashDetectionEventResponseAttempted")]
pub const Attempted: Self = Self(0);
#[doc(alias = "SACrashDetectionEventResponseDisabled")]
pub const Disabled: Self = Self(1);
}
unsafe impl Encode for SACrashDetectionEventResponse {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for SACrashDetectionEventResponse {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct SACrashDetectionEvent;
);
extern_conformance!(
unsafe impl NSCoding for SACrashDetectionEvent {}
);
extern_conformance!(
unsafe impl NSCopying for SACrashDetectionEvent {}
);
unsafe impl CopyingHelper for SACrashDetectionEvent {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for SACrashDetectionEvent {}
);
extern_conformance!(
unsafe impl NSSecureCoding for SACrashDetectionEvent {}
);
impl SACrashDetectionEvent {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(date))]
#[unsafe(method_family = none)]
pub unsafe fn date(&self) -> Retained<NSDate>;
#[unsafe(method(response))]
#[unsafe(method_family = none)]
pub unsafe fn response(&self) -> SACrashDetectionEventResponse;
#[cfg(feature = "objc2-core-location")]
#[unsafe(method(location))]
#[unsafe(method_family = none)]
pub unsafe fn location(&self) -> Option<Retained<CLLocation>>;
);
}