objc2_health_kit/generated/
HKMedicationDoseEvent.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct HKMedicationDoseEventLogStatus(pub NSInteger);
16impl HKMedicationDoseEventLogStatus {
17 #[doc(alias = "HKMedicationDoseEventLogStatusNotInteracted")]
18 pub const NotInteracted: Self = Self(1);
19 #[doc(alias = "HKMedicationDoseEventLogStatusNotificationNotSent")]
20 pub const NotificationNotSent: Self = Self(2);
21 #[doc(alias = "HKMedicationDoseEventLogStatusSnoozed")]
22 pub const Snoozed: Self = Self(3);
23 #[doc(alias = "HKMedicationDoseEventLogStatusTaken")]
24 pub const Taken: Self = Self(4);
25 #[doc(alias = "HKMedicationDoseEventLogStatusSkipped")]
26 pub const Skipped: Self = Self(5);
27 #[doc(alias = "HKMedicationDoseEventLogStatusNotLogged")]
28 pub const NotLogged: Self = Self(6);
29}
30
31unsafe impl Encode for HKMedicationDoseEventLogStatus {
32 const ENCODING: Encoding = NSInteger::ENCODING;
33}
34
35unsafe impl RefEncode for HKMedicationDoseEventLogStatus {
36 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39#[repr(transparent)]
44#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
45pub struct HKMedicationDoseEventScheduleType(pub NSInteger);
46impl HKMedicationDoseEventScheduleType {
47 #[doc(alias = "HKMedicationDoseEventScheduleTypeAsNeeded")]
48 pub const AsNeeded: Self = Self(1);
49 #[doc(alias = "HKMedicationDoseEventScheduleTypeSchedule")]
50 pub const Schedule: Self = Self(2);
51}
52
53unsafe impl Encode for HKMedicationDoseEventScheduleType {
54 const ENCODING: Encoding = NSInteger::ENCODING;
55}
56
57unsafe impl RefEncode for HKMedicationDoseEventScheduleType {
58 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
59}
60
61extern_class!(
62 #[unsafe(super(HKSample, HKObject, NSObject))]
64 #[derive(Debug, PartialEq, Eq, Hash)]
65 #[cfg(all(feature = "HKObject", feature = "HKSample"))]
66 pub struct HKMedicationDoseEvent;
67);
68
69#[cfg(all(feature = "HKObject", feature = "HKSample"))]
70unsafe impl Send for HKMedicationDoseEvent {}
71
72#[cfg(all(feature = "HKObject", feature = "HKSample"))]
73unsafe impl Sync for HKMedicationDoseEvent {}
74
75#[cfg(all(feature = "HKObject", feature = "HKSample"))]
76extern_conformance!(
77 unsafe impl NSCoding for HKMedicationDoseEvent {}
78);
79
80#[cfg(all(feature = "HKObject", feature = "HKSample"))]
81extern_conformance!(
82 unsafe impl NSCopying for HKMedicationDoseEvent {}
83);
84
85#[cfg(all(feature = "HKObject", feature = "HKSample"))]
86unsafe impl CopyingHelper for HKMedicationDoseEvent {
87 type Result = Self;
88}
89
90#[cfg(all(feature = "HKObject", feature = "HKSample"))]
91extern_conformance!(
92 unsafe impl NSObjectProtocol for HKMedicationDoseEvent {}
93);
94
95#[cfg(all(feature = "HKObject", feature = "HKSample"))]
96extern_conformance!(
97 unsafe impl NSSecureCoding for HKMedicationDoseEvent {}
98);
99
100#[cfg(all(feature = "HKObject", feature = "HKSample"))]
101impl HKMedicationDoseEvent {
102 extern_methods!(
103 #[cfg(feature = "HKObjectType")]
104 #[unsafe(method(medicationDoseEventType))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn medicationDoseEventType(&self) -> Retained<HKMedicationDoseEventType>;
108
109 #[unsafe(method(scheduleType))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn scheduleType(&self) -> HKMedicationDoseEventScheduleType;
121
122 #[cfg(feature = "HKHealthConceptIdentifier")]
123 #[unsafe(method(medicationConceptIdentifier))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn medicationConceptIdentifier(&self) -> Retained<HKHealthConceptIdentifier>;
133
134 #[unsafe(method(scheduledDate))]
144 #[unsafe(method_family = none)]
145 pub unsafe fn scheduledDate(&self) -> Option<Retained<NSDate>>;
146
147 #[unsafe(method(scheduledDoseQuantity))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn scheduledDoseQuantity(&self) -> Option<Retained<NSNumber>>;
159
160 #[unsafe(method(doseQuantity))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn doseQuantity(&self) -> Option<Retained<NSNumber>>;
172
173 #[unsafe(method(logStatus))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn logStatus(&self) -> HKMedicationDoseEventLogStatus;
183
184 #[cfg(feature = "HKUnit")]
185 #[unsafe(method(unit))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn unit(&self) -> Retained<HKUnit>;
195
196 #[unsafe(method(init))]
197 #[unsafe(method_family = init)]
198 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
199
200 #[unsafe(method(new))]
201 #[unsafe(method_family = new)]
202 pub unsafe fn new() -> Retained<Self>;
203 );
204}
205
206extern "C" {
207 pub static HKPredicateKeyPathStatus: &'static NSString;
209}
210
211extern "C" {
212 pub static HKPredicateKeyPathLogOrigin: &'static NSString;
214}
215
216extern "C" {
217 pub static HKPredicateKeyPathScheduledDate: &'static NSString;
219}
220
221extern "C" {
222 pub static HKPredicateKeyPathMedicationConceptIdentifier: &'static NSString;
224}