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
//! 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::*;
#[cfg(feature = "objc2-core-location")]
use objc2_core_location::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkworkoutroutequery?language=objc)
#[unsafe(super(HKQuery, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "HKQuery")]
pub struct HKWorkoutRouteQuery;
);
#[cfg(feature = "HKQuery")]
unsafe impl Send for HKWorkoutRouteQuery {}
#[cfg(feature = "HKQuery")]
unsafe impl Sync for HKWorkoutRouteQuery {}
#[cfg(feature = "HKQuery")]
extern_conformance!(
unsafe impl NSObjectProtocol for HKWorkoutRouteQuery {}
);
#[cfg(feature = "HKQuery")]
impl HKWorkoutRouteQuery {
extern_methods!(
#[cfg(all(
feature = "HKObject",
feature = "HKSample",
feature = "HKSeriesSample",
feature = "HKWorkoutRoute",
feature = "block2",
feature = "objc2-core-location"
))]
/// Returns a query that will retrieve CLLocation objects for the specified workoutRoute.
///
///
/// Parameter `workoutRoute`: The HKWorkoutRoute for which the location data will be returned.
///
/// Parameter `dataHandler`: The block to invoke with results from the query. It is called repeatedly with an array of
/// CLLocation objects until all data is returned and the done parameter is YES or if HKHealthStore
/// stopQuery: is called. The stopQuery call can be made within the dataHandler block. The number of
/// objects returned in routeData per dataHandler call is unspecified. Once done is YES, or
/// stopQuery called, the query is complete and no more calls to the handler will be made.
///
/// # Safety
///
/// `data_handler` block must be sendable.
#[unsafe(method(initWithRoute:dataHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithRoute_dataHandler(
this: Allocated<Self>,
workout_route: &HKWorkoutRoute,
data_handler: &block2::DynBlock<
dyn Fn(NonNull<HKWorkoutRouteQuery>, *mut NSArray<CLLocation>, Bool, *mut NSError),
>,
) -> Retained<Self>;
#[cfg(all(
feature = "HKObject",
feature = "HKSample",
feature = "HKSeriesSample",
feature = "HKWorkoutRoute",
feature = "block2",
feature = "objc2-core-location"
))]
/// Returns a query that will retrieve CLLocation objects for the specified workoutRoute and dateInterval.
///
///
/// Parameter `workoutRoute`: The HKWorkoutRoute for which the location data will be returned.
///
/// Parameter `dateInterval`: The date interval for which the location data will be returned. If the requested interval does
/// not overlap with the specified workout route sample, an empty array of results is returned. If
/// the requested interval partially overlaps with the specified workout route sample, only location
/// data from within that overlapping time period is returned.
///
/// Parameter `dataHandler`: The block to invoke with results from the query. It is called repeatedly with an array of
/// CLLocation objects until all data is returned and the done parameter is YES or if HKHealthStore
/// stopQuery: is called. The stopQuery call can be made within the dataHandler block. The number of
/// objects returned in routeData per dataHandler call is unspecified. Once done is YES, or
/// stopQuery called, the query is complete and no more calls to the handler will be made.
///
/// # Safety
///
/// `data_handler` block must be sendable.
#[unsafe(method(initWithRoute:dateInterval:dataHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithRoute_dateInterval_dataHandler(
this: Allocated<Self>,
workout_route: &HKWorkoutRoute,
date_interval: &NSDateInterval,
data_handler: &block2::DynBlock<
dyn Fn(NonNull<HKWorkoutRouteQuery>, *mut NSArray<CLLocation>, Bool, *mut NSError),
>,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `HKQuery`.
#[cfg(feature = "HKQuery")]
impl HKWorkoutRouteQuery {
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 HKWorkoutRouteQuery {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}