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 HKElectrocardiogramLead(pub NSInteger);
impl HKElectrocardiogramLead {
#[doc(alias = "HKElectrocardiogramLeadAppleWatchSimilarToLeadI")]
pub const AppleWatchSimilarToLeadI: Self = Self(1);
}
unsafe impl Encode for HKElectrocardiogramLead {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for HKElectrocardiogramLead {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct HKElectrocardiogramClassification(pub NSInteger);
impl HKElectrocardiogramClassification {
#[doc(alias = "HKElectrocardiogramClassificationNotSet")]
pub const NotSet: Self = Self(0);
#[doc(alias = "HKElectrocardiogramClassificationSinusRhythm")]
pub const SinusRhythm: Self = Self(1);
#[doc(alias = "HKElectrocardiogramClassificationAtrialFibrillation")]
pub const AtrialFibrillation: Self = Self(2);
#[doc(alias = "HKElectrocardiogramClassificationInconclusiveLowHeartRate")]
pub const InconclusiveLowHeartRate: Self = Self(3);
#[doc(alias = "HKElectrocardiogramClassificationInconclusiveHighHeartRate")]
pub const InconclusiveHighHeartRate: Self = Self(4);
#[doc(alias = "HKElectrocardiogramClassificationInconclusivePoorReading")]
pub const InconclusivePoorReading: Self = Self(5);
#[doc(alias = "HKElectrocardiogramClassificationInconclusiveOther")]
pub const InconclusiveOther: Self = Self(6);
#[doc(alias = "HKElectrocardiogramClassificationUnrecognized")]
pub const Unrecognized: Self = Self(100);
}
unsafe impl Encode for HKElectrocardiogramClassification {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for HKElectrocardiogramClassification {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct HKElectrocardiogramSymptomsStatus(pub NSInteger);
impl HKElectrocardiogramSymptomsStatus {
#[doc(alias = "HKElectrocardiogramSymptomsStatusNotSet")]
pub const NotSet: Self = Self(0);
#[doc(alias = "HKElectrocardiogramSymptomsStatusNone")]
pub const None: Self = Self(1);
#[doc(alias = "HKElectrocardiogramSymptomsStatusPresent")]
pub const Present: Self = Self(2);
}
unsafe impl Encode for HKElectrocardiogramSymptomsStatus {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for HKElectrocardiogramSymptomsStatus {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(HKSample, HKObject, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
pub struct HKElectrocardiogram;
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
unsafe impl Send for HKElectrocardiogram {}
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
unsafe impl Sync for HKElectrocardiogram {}
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
unsafe impl NSCoding for HKElectrocardiogram {}
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
unsafe impl NSObjectProtocol for HKElectrocardiogram {}
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
unsafe impl NSSecureCoding for HKElectrocardiogram {}
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
impl HKElectrocardiogram {
extern_methods!(
#[unsafe(method(numberOfVoltageMeasurements))]
#[unsafe(method_family = none)]
pub unsafe fn numberOfVoltageMeasurements(&self) -> NSInteger;
#[cfg(feature = "HKQuantity")]
#[unsafe(method(samplingFrequency))]
#[unsafe(method_family = none)]
pub unsafe fn samplingFrequency(&self) -> Option<Retained<HKQuantity>>;
#[unsafe(method(classification))]
#[unsafe(method_family = none)]
pub unsafe fn classification(&self) -> HKElectrocardiogramClassification;
#[cfg(feature = "HKQuantity")]
#[unsafe(method(averageHeartRate))]
#[unsafe(method_family = none)]
pub unsafe fn averageHeartRate(&self) -> Option<Retained<HKQuantity>>;
#[unsafe(method(symptomsStatus))]
#[unsafe(method_family = none)]
pub unsafe fn symptomsStatus(&self) -> HKElectrocardiogramSymptomsStatus;
);
}
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
impl HKElectrocardiogram {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
impl HKElectrocardiogram {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern "C" {
pub static HKPredicateKeyPathAverageHeartRate: &'static NSString;
}
extern "C" {
pub static HKPredicateKeyPathECGClassification: &'static NSString;
}
extern "C" {
pub static HKPredicateKeyPathECGSymptomsStatus: &'static NSString;
}