use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct HKElectrocardiogramVoltageMeasurement;
);
unsafe impl Send for HKElectrocardiogramVoltageMeasurement {}
unsafe impl Sync for HKElectrocardiogramVoltageMeasurement {}
extern_conformance!(
unsafe impl NSCopying for HKElectrocardiogramVoltageMeasurement {}
);
unsafe impl CopyingHelper for HKElectrocardiogramVoltageMeasurement {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for HKElectrocardiogramVoltageMeasurement {}
);
impl HKElectrocardiogramVoltageMeasurement {
extern_methods!(
#[unsafe(method(timeSinceSampleStart))]
#[unsafe(method_family = none)]
pub unsafe fn timeSinceSampleStart(&self) -> NSTimeInterval;
#[cfg(all(feature = "HKElectrocardiogram", feature = "HKQuantity"))]
#[unsafe(method(quantityForLead:))]
#[unsafe(method_family = none)]
pub unsafe fn quantityForLead(
&self,
lead: HKElectrocardiogramLead,
) -> Option<Retained<HKQuantity>>;
);
}
impl HKElectrocardiogramVoltageMeasurement {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(HKQuery, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "HKQuery")]
pub struct HKElectrocardiogramQuery;
);
#[cfg(feature = "HKQuery")]
unsafe impl Send for HKElectrocardiogramQuery {}
#[cfg(feature = "HKQuery")]
unsafe impl Sync for HKElectrocardiogramQuery {}
#[cfg(feature = "HKQuery")]
extern_conformance!(
unsafe impl NSObjectProtocol for HKElectrocardiogramQuery {}
);
#[cfg(feature = "HKQuery")]
impl HKElectrocardiogramQuery {
extern_methods!(
#[cfg(all(
feature = "HKElectrocardiogram",
feature = "HKObject",
feature = "HKSample",
feature = "block2"
))]
#[unsafe(method(initWithElectrocardiogram:dataHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithElectrocardiogram_dataHandler(
this: Allocated<Self>,
electrocardiogram: &HKElectrocardiogram,
data_handler: &block2::DynBlock<
dyn Fn(
NonNull<HKElectrocardiogramQuery>,
*mut HKElectrocardiogramVoltageMeasurement,
Bool,
*mut NSError,
),
>,
) -> Retained<Self>;
);
}
#[cfg(feature = "HKQuery")]
impl HKElectrocardiogramQuery {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(feature = "HKQuery")]
impl HKElectrocardiogramQuery {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}