use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
pub const HKUnitMolarMassBloodGlucose: c_float = 180.15588000005408;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct HKUnit;
);
unsafe impl Send for HKUnit {}
unsafe impl Sync for HKUnit {}
extern_conformance!(
unsafe impl NSCoding for HKUnit {}
);
extern_conformance!(
unsafe impl NSCopying for HKUnit {}
);
unsafe impl CopyingHelper for HKUnit {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for HKUnit {}
);
extern_conformance!(
unsafe impl NSSecureCoding for HKUnit {}
);
impl HKUnit {
extern_methods!(
#[unsafe(method(unitString))]
#[unsafe(method_family = none)]
pub unsafe fn unitString(&self) -> Retained<NSString>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(unitFromString:))]
#[unsafe(method_family = none)]
pub unsafe fn unitFromString(string: &NSString) -> Retained<Self>;
#[unsafe(method(unitFromMassFormatterUnit:))]
#[unsafe(method_family = none)]
pub unsafe fn unitFromMassFormatterUnit(
mass_formatter_unit: NSMassFormatterUnit,
) -> Retained<Self>;
#[unsafe(method(massFormatterUnitFromUnit:))]
#[unsafe(method_family = none)]
pub unsafe fn massFormatterUnitFromUnit(unit: &HKUnit) -> NSMassFormatterUnit;
#[unsafe(method(unitFromLengthFormatterUnit:))]
#[unsafe(method_family = none)]
pub unsafe fn unitFromLengthFormatterUnit(
length_formatter_unit: NSLengthFormatterUnit,
) -> Retained<Self>;
#[unsafe(method(lengthFormatterUnitFromUnit:))]
#[unsafe(method_family = none)]
pub unsafe fn lengthFormatterUnitFromUnit(unit: &HKUnit) -> NSLengthFormatterUnit;
#[unsafe(method(unitFromEnergyFormatterUnit:))]
#[unsafe(method_family = none)]
pub unsafe fn unitFromEnergyFormatterUnit(
energy_formatter_unit: NSEnergyFormatterUnit,
) -> Retained<Self>;
#[unsafe(method(energyFormatterUnitFromUnit:))]
#[unsafe(method_family = none)]
pub unsafe fn energyFormatterUnitFromUnit(unit: &HKUnit) -> NSEnergyFormatterUnit;
#[unsafe(method(isNull))]
#[unsafe(method_family = none)]
pub unsafe fn isNull(&self) -> bool;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct HKMetricPrefix(pub NSInteger);
impl HKMetricPrefix {
#[doc(alias = "HKMetricPrefixNone")]
pub const None: Self = Self(0);
#[doc(alias = "HKMetricPrefixFemto")]
pub const Femto: Self = Self(13);
#[doc(alias = "HKMetricPrefixPico")]
pub const Pico: Self = Self(1);
#[doc(alias = "HKMetricPrefixNano")]
pub const Nano: Self = Self(2);
#[doc(alias = "HKMetricPrefixMicro")]
pub const Micro: Self = Self(3);
#[doc(alias = "HKMetricPrefixMilli")]
pub const Milli: Self = Self(4);
#[doc(alias = "HKMetricPrefixCenti")]
pub const Centi: Self = Self(5);
#[doc(alias = "HKMetricPrefixDeci")]
pub const Deci: Self = Self(6);
#[doc(alias = "HKMetricPrefixDeca")]
pub const Deca: Self = Self(7);
#[doc(alias = "HKMetricPrefixHecto")]
pub const Hecto: Self = Self(8);
#[doc(alias = "HKMetricPrefixKilo")]
pub const Kilo: Self = Self(9);
#[doc(alias = "HKMetricPrefixMega")]
pub const Mega: Self = Self(10);
#[doc(alias = "HKMetricPrefixGiga")]
pub const Giga: Self = Self(11);
#[doc(alias = "HKMetricPrefixTera")]
pub const Tera: Self = Self(12);
}
unsafe impl Encode for HKMetricPrefix {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for HKMetricPrefix {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(gramUnitWithMetricPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn gramUnitWithMetricPrefix(prefix: HKMetricPrefix) -> Retained<Self>;
#[unsafe(method(gramUnit))]
#[unsafe(method_family = none)]
pub unsafe fn gramUnit() -> Retained<Self>;
#[unsafe(method(ounceUnit))]
#[unsafe(method_family = none)]
pub unsafe fn ounceUnit() -> Retained<Self>;
#[unsafe(method(poundUnit))]
#[unsafe(method_family = none)]
pub unsafe fn poundUnit() -> Retained<Self>;
#[unsafe(method(stoneUnit))]
#[unsafe(method_family = none)]
pub unsafe fn stoneUnit() -> Retained<Self>;
#[unsafe(method(moleUnitWithMetricPrefix:molarMass:))]
#[unsafe(method_family = none)]
pub unsafe fn moleUnitWithMetricPrefix_molarMass(
prefix: HKMetricPrefix,
grams_per_mole: c_double,
) -> Retained<Self>;
#[unsafe(method(moleUnitWithMolarMass:))]
#[unsafe(method_family = none)]
pub unsafe fn moleUnitWithMolarMass(grams_per_mole: c_double) -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(meterUnitWithMetricPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn meterUnitWithMetricPrefix(prefix: HKMetricPrefix) -> Retained<Self>;
#[unsafe(method(meterUnit))]
#[unsafe(method_family = none)]
pub unsafe fn meterUnit() -> Retained<Self>;
#[unsafe(method(inchUnit))]
#[unsafe(method_family = none)]
pub unsafe fn inchUnit() -> Retained<Self>;
#[unsafe(method(footUnit))]
#[unsafe(method_family = none)]
pub unsafe fn footUnit() -> Retained<Self>;
#[unsafe(method(yardUnit))]
#[unsafe(method_family = none)]
pub unsafe fn yardUnit() -> Retained<Self>;
#[unsafe(method(mileUnit))]
#[unsafe(method_family = none)]
pub unsafe fn mileUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(literUnitWithMetricPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn literUnitWithMetricPrefix(prefix: HKMetricPrefix) -> Retained<Self>;
#[unsafe(method(literUnit))]
#[unsafe(method_family = none)]
pub unsafe fn literUnit() -> Retained<Self>;
#[unsafe(method(fluidOunceUSUnit))]
#[unsafe(method_family = none)]
pub unsafe fn fluidOunceUSUnit() -> Retained<Self>;
#[unsafe(method(fluidOunceImperialUnit))]
#[unsafe(method_family = none)]
pub unsafe fn fluidOunceImperialUnit() -> Retained<Self>;
#[unsafe(method(pintUSUnit))]
#[unsafe(method_family = none)]
pub unsafe fn pintUSUnit() -> Retained<Self>;
#[unsafe(method(pintImperialUnit))]
#[unsafe(method_family = none)]
pub unsafe fn pintImperialUnit() -> Retained<Self>;
#[unsafe(method(cupUSUnit))]
#[unsafe(method_family = none)]
pub unsafe fn cupUSUnit() -> Retained<Self>;
#[unsafe(method(cupImperialUnit))]
#[unsafe(method_family = none)]
pub unsafe fn cupImperialUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(pascalUnitWithMetricPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn pascalUnitWithMetricPrefix(prefix: HKMetricPrefix) -> Retained<Self>;
#[unsafe(method(pascalUnit))]
#[unsafe(method_family = none)]
pub unsafe fn pascalUnit() -> Retained<Self>;
#[unsafe(method(millimeterOfMercuryUnit))]
#[unsafe(method_family = none)]
pub unsafe fn millimeterOfMercuryUnit() -> Retained<Self>;
#[unsafe(method(centimeterOfWaterUnit))]
#[unsafe(method_family = none)]
pub unsafe fn centimeterOfWaterUnit() -> Retained<Self>;
#[unsafe(method(atmosphereUnit))]
#[unsafe(method_family = none)]
pub unsafe fn atmosphereUnit() -> Retained<Self>;
#[unsafe(method(decibelAWeightedSoundPressureLevelUnit))]
#[unsafe(method_family = none)]
pub unsafe fn decibelAWeightedSoundPressureLevelUnit() -> Retained<Self>;
#[unsafe(method(inchesOfMercuryUnit))]
#[unsafe(method_family = none)]
pub unsafe fn inchesOfMercuryUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(secondUnitWithMetricPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn secondUnitWithMetricPrefix(prefix: HKMetricPrefix) -> Retained<Self>;
#[unsafe(method(secondUnit))]
#[unsafe(method_family = none)]
pub unsafe fn secondUnit() -> Retained<Self>;
#[unsafe(method(minuteUnit))]
#[unsafe(method_family = none)]
pub unsafe fn minuteUnit() -> Retained<Self>;
#[unsafe(method(hourUnit))]
#[unsafe(method_family = none)]
pub unsafe fn hourUnit() -> Retained<Self>;
#[unsafe(method(dayUnit))]
#[unsafe(method_family = none)]
pub unsafe fn dayUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(jouleUnitWithMetricPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn jouleUnitWithMetricPrefix(prefix: HKMetricPrefix) -> Retained<Self>;
#[unsafe(method(jouleUnit))]
#[unsafe(method_family = none)]
pub unsafe fn jouleUnit() -> Retained<Self>;
#[unsafe(method(kilocalorieUnit))]
#[unsafe(method_family = none)]
pub unsafe fn kilocalorieUnit() -> Retained<Self>;
#[unsafe(method(smallCalorieUnit))]
#[unsafe(method_family = none)]
pub unsafe fn smallCalorieUnit() -> Retained<Self>;
#[unsafe(method(largeCalorieUnit))]
#[unsafe(method_family = none)]
pub unsafe fn largeCalorieUnit() -> Retained<Self>;
#[deprecated = "Use smallCalorieUnit or largeCalorieUnit, depending on which you mean"]
#[unsafe(method(calorieUnit))]
#[unsafe(method_family = none)]
pub unsafe fn calorieUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(degreeCelsiusUnit))]
#[unsafe(method_family = none)]
pub unsafe fn degreeCelsiusUnit() -> Retained<Self>;
#[unsafe(method(degreeFahrenheitUnit))]
#[unsafe(method_family = none)]
pub unsafe fn degreeFahrenheitUnit() -> Retained<Self>;
#[unsafe(method(kelvinUnit))]
#[unsafe(method_family = none)]
pub unsafe fn kelvinUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(siemenUnitWithMetricPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn siemenUnitWithMetricPrefix(prefix: HKMetricPrefix) -> Retained<Self>;
#[unsafe(method(siemenUnit))]
#[unsafe(method_family = none)]
pub unsafe fn siemenUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(internationalUnit))]
#[unsafe(method_family = none)]
pub unsafe fn internationalUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(countUnit))]
#[unsafe(method_family = none)]
pub unsafe fn countUnit() -> Retained<Self>;
#[unsafe(method(percentUnit))]
#[unsafe(method_family = none)]
pub unsafe fn percentUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(decibelHearingLevelUnit))]
#[unsafe(method_family = none)]
pub unsafe fn decibelHearingLevelUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(unitMultipliedByUnit:))]
#[unsafe(method_family = none)]
pub unsafe fn unitMultipliedByUnit(&self, unit: &HKUnit) -> Retained<HKUnit>;
#[unsafe(method(unitDividedByUnit:))]
#[unsafe(method_family = none)]
pub unsafe fn unitDividedByUnit(&self, unit: &HKUnit) -> Retained<HKUnit>;
#[unsafe(method(unitRaisedToPower:))]
#[unsafe(method_family = none)]
pub unsafe fn unitRaisedToPower(&self, power: NSInteger) -> Retained<HKUnit>;
#[unsafe(method(reciprocalUnit))]
#[unsafe(method_family = none)]
pub unsafe fn reciprocalUnit(&self) -> Retained<HKUnit>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(hertzUnitWithMetricPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn hertzUnitWithMetricPrefix(prefix: HKMetricPrefix) -> Retained<Self>;
#[unsafe(method(hertzUnit))]
#[unsafe(method_family = none)]
pub unsafe fn hertzUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(voltUnitWithMetricPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn voltUnitWithMetricPrefix(prefix: HKMetricPrefix) -> Retained<Self>;
#[unsafe(method(voltUnit))]
#[unsafe(method_family = none)]
pub unsafe fn voltUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(wattUnitWithMetricPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn wattUnitWithMetricPrefix(prefix: HKMetricPrefix) -> Retained<Self>;
#[unsafe(method(wattUnit))]
#[unsafe(method_family = none)]
pub unsafe fn wattUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(diopterUnit))]
#[unsafe(method_family = none)]
pub unsafe fn diopterUnit() -> Retained<Self>;
#[unsafe(method(prismDiopterUnit))]
#[unsafe(method_family = none)]
pub unsafe fn prismDiopterUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(radianAngleUnitWithMetricPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn radianAngleUnitWithMetricPrefix(prefix: HKMetricPrefix) -> Retained<Self>;
#[unsafe(method(radianAngleUnit))]
#[unsafe(method_family = none)]
pub unsafe fn radianAngleUnit() -> Retained<Self>;
#[unsafe(method(degreeAngleUnit))]
#[unsafe(method_family = none)]
pub unsafe fn degreeAngleUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(luxUnitWithMetricPrefix:))]
#[unsafe(method_family = none)]
pub unsafe fn luxUnitWithMetricPrefix(prefix: HKMetricPrefix) -> Retained<Self>;
#[unsafe(method(luxUnit))]
#[unsafe(method_family = none)]
pub unsafe fn luxUnit() -> Retained<Self>;
);
}
impl HKUnit {
extern_methods!(
#[unsafe(method(appleEffortScoreUnit))]
#[unsafe(method_family = none)]
pub unsafe fn appleEffortScoreUnit() -> Retained<Self>;
);
}