1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkquantityseriessamplequery?language=objc)
#[unsafe(super(HKQuery, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "HKQuery")]
pub struct HKQuantitySeriesSampleQuery;
);
#[cfg(feature = "HKQuery")]
unsafe impl Send for HKQuantitySeriesSampleQuery {}
#[cfg(feature = "HKQuery")]
unsafe impl Sync for HKQuantitySeriesSampleQuery {}
#[cfg(feature = "HKQuery")]
extern_conformance!(
unsafe impl NSObjectProtocol for HKQuantitySeriesSampleQuery {}
);
#[cfg(feature = "HKQuery")]
impl HKQuantitySeriesSampleQuery {
extern_methods!(
/// Include owning HKQuantitySample in quantityHandler handler.
///
/// Default value is NO.
/// If includeSample is set then the quantitySample parameter of quantityHandler will
/// be non-nil anytime the quantity parameter is non-nil.
/// Specifying this option has a performance cost.
/// This property may not be modified once the query has been executed.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(includeSample))]
#[unsafe(method_family = none)]
pub unsafe fn includeSample(&self) -> bool;
/// Setter for [`includeSample`][Self::includeSample].
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(setIncludeSample:))]
#[unsafe(method_family = none)]
pub unsafe fn setIncludeSample(&self, include_sample: bool);
/// Order enumerated results first by quantitySample.startDate,
/// then by the quantity's dateInterval.startDate.
///
/// Default value is NO.
/// All quantities owned by a given quantitySample will be
/// enumerated before any quantities owned by any other quantity sample,
/// and the quantity samples will be enumerated in their startDate order.
/// Note that individual quantities may not be returned in their
/// dateInterval.startDate order if more than one quantitySample overlap in time.
/// This property may not be modified once the query has been executed.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(orderByQuantitySampleStartDate))]
#[unsafe(method_family = none)]
pub unsafe fn orderByQuantitySampleStartDate(&self) -> bool;
/// Setter for [`orderByQuantitySampleStartDate`][Self::orderByQuantitySampleStartDate].
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(setOrderByQuantitySampleStartDate:))]
#[unsafe(method_family = none)]
pub unsafe fn setOrderByQuantitySampleStartDate(
&self,
order_by_quantity_sample_start_date: bool,
);
#[cfg(all(
feature = "HKObject",
feature = "HKObjectType",
feature = "HKQuantity",
feature = "HKQuantitySample",
feature = "HKSample",
feature = "block2"
))]
/// Returns a query that will retrieve HKQuantity objects for samples of a specified
/// type that match the specified predicate.
///
///
/// Parameter `quantityType`: The type of HKQuantitySample to retrieve.
///
/// Parameter `predicate`: The predicate which the query results should match.
/// To query for the quantities for a specific quantity sample
/// see: +[HKPredicates predicateForObjectWithUUID:]
///
///
/// Parameter `quantityHandler`: The block to invoke with results from the query. It will be
/// called repeatedly with HKQuantity, and NSDateInterval objects in
/// ascending dateInterval.startDate order, until all quantities are
/// returned and the done parameter is YES
/// or -[HKHealthStore stopQuery:] is called.
/// The quantitySample parameter is nil unless includeSample is YES,
/// in which case it will be the quantitySample which owns the current
/// quantity anytime the quantity paramater is non-nil.
/// The stopQuery call can be made within the quantityHandler block.
/// Once done is YES, or stopQuery has been called, the query is
/// complete and no more calls to quantityHandler will be made.
///
/// # Safety
///
/// `quantity_handler` block must be sendable.
#[unsafe(method(initWithQuantityType:predicate:quantityHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithQuantityType_predicate_quantityHandler(
this: Allocated<Self>,
quantity_type: &HKQuantityType,
predicate: Option<&NSPredicate>,
quantity_handler: &block2::DynBlock<
dyn Fn(
NonNull<HKQuantitySeriesSampleQuery>,
*mut HKQuantity,
*mut NSDateInterval,
*mut HKQuantitySample,
Bool,
*mut NSError,
),
>,
) -> Retained<Self>;
#[cfg(all(
feature = "HKObject",
feature = "HKQuantity",
feature = "HKQuantitySample",
feature = "HKSample",
feature = "block2"
))]
/// # Safety
///
/// `quantity_handler` block must be sendable.
#[deprecated]
#[unsafe(method(initWithSample:quantityHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithSample_quantityHandler(
this: Allocated<Self>,
quantity_sample: &HKQuantitySample,
quantity_handler: &block2::DynBlock<
dyn Fn(
NonNull<HKQuantitySeriesSampleQuery>,
*mut HKQuantity,
*mut NSDate,
Bool,
*mut NSError,
),
>,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `HKQuery`.
#[cfg(feature = "HKQuery")]
impl HKQuantitySeriesSampleQuery {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(feature = "HKQuery")]
impl HKQuantitySeriesSampleQuery {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}