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 HKVisionPrescriptionType(pub NSUInteger);
impl HKVisionPrescriptionType {
#[doc(alias = "HKVisionPrescriptionTypeGlasses")]
pub const Glasses: Self = Self(1);
#[doc(alias = "HKVisionPrescriptionTypeContacts")]
pub const Contacts: Self = Self(2);
}
unsafe impl Encode for HKVisionPrescriptionType {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for HKVisionPrescriptionType {
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 HKVisionPrescription;
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
unsafe impl Send for HKVisionPrescription {}
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
unsafe impl Sync for HKVisionPrescription {}
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
unsafe impl NSCoding for HKVisionPrescription {}
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
unsafe impl NSCopying for HKVisionPrescription {}
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
unsafe impl CopyingHelper for HKVisionPrescription {
type Result = Self;
}
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
unsafe impl NSObjectProtocol for HKVisionPrescription {}
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
extern_conformance!(
unsafe impl NSSecureCoding for HKVisionPrescription {}
);
#[cfg(all(feature = "HKObject", feature = "HKSample"))]
impl HKVisionPrescription {
extern_methods!(
#[unsafe(method(prescriptionType))]
#[unsafe(method_family = none)]
pub unsafe fn prescriptionType(&self) -> HKVisionPrescriptionType;
#[unsafe(method(dateIssued))]
#[unsafe(method_family = none)]
pub unsafe fn dateIssued(&self) -> Retained<NSDate>;
#[unsafe(method(expirationDate))]
#[unsafe(method_family = none)]
pub unsafe fn expirationDate(&self) -> Option<Retained<NSDate>>;
#[cfg(feature = "HKDevice")]
#[unsafe(method(prescriptionWithType:dateIssued:expirationDate:device:metadata:))]
#[unsafe(method_family = none)]
pub unsafe fn prescriptionWithType_dateIssued_expirationDate_device_metadata(
r#type: HKVisionPrescriptionType,
date_issued: &NSDate,
expiration_date: Option<&NSDate>,
device: Option<&HKDevice>,
metadata: Option<&NSDictionary<NSString, AnyObject>>,
) -> Retained<Self>;
#[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>;
);
}