objc2_health_kit/generated/HKWorkoutRouteQuery.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-location")]
7use objc2_core_location::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 /// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkworkoutroutequery?language=objc)
14 #[unsafe(super(HKQuery, NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[cfg(feature = "HKQuery")]
17 pub struct HKWorkoutRouteQuery;
18);
19
20#[cfg(feature = "HKQuery")]
21unsafe impl Send for HKWorkoutRouteQuery {}
22
23#[cfg(feature = "HKQuery")]
24unsafe impl Sync for HKWorkoutRouteQuery {}
25
26#[cfg(feature = "HKQuery")]
27extern_conformance!(
28 unsafe impl NSObjectProtocol for HKWorkoutRouteQuery {}
29);
30
31#[cfg(feature = "HKQuery")]
32impl HKWorkoutRouteQuery {
33 extern_methods!(
34 #[cfg(all(
35 feature = "HKObject",
36 feature = "HKSample",
37 feature = "HKSeriesSample",
38 feature = "HKWorkoutRoute",
39 feature = "block2",
40 feature = "objc2-core-location"
41 ))]
42 /// Returns a query that will retrieve CLLocation objects for the specified workoutRoute.
43 ///
44 ///
45 /// Parameter `workoutRoute`: The HKWorkoutRoute for which the location data will be returned.
46 ///
47 /// Parameter `dataHandler`: The block to invoke with results from the query. It is called repeatedly with an array of
48 /// CLLocation objects until all data is returned and the done parameter is YES or if HKHealthStore
49 /// stopQuery: is called. The stopQuery call can be made within the dataHandler block. The number of
50 /// objects returned in routeData per dataHandler call is unspecified. Once done is YES, or
51 /// stopQuery called, the query is complete and no more calls to the handler will be made.
52 ///
53 /// # Safety
54 ///
55 /// `data_handler` block must be sendable.
56 #[unsafe(method(initWithRoute:dataHandler:))]
57 #[unsafe(method_family = init)]
58 pub unsafe fn initWithRoute_dataHandler(
59 this: Allocated<Self>,
60 workout_route: &HKWorkoutRoute,
61 data_handler: &block2::DynBlock<
62 dyn Fn(NonNull<HKWorkoutRouteQuery>, *mut NSArray<CLLocation>, Bool, *mut NSError),
63 >,
64 ) -> Retained<Self>;
65
66 #[cfg(all(
67 feature = "HKObject",
68 feature = "HKSample",
69 feature = "HKSeriesSample",
70 feature = "HKWorkoutRoute",
71 feature = "block2",
72 feature = "objc2-core-location"
73 ))]
74 /// Returns a query that will retrieve CLLocation objects for the specified workoutRoute and dateInterval.
75 ///
76 ///
77 /// Parameter `workoutRoute`: The HKWorkoutRoute for which the location data will be returned.
78 ///
79 /// Parameter `dateInterval`: The date interval for which the location data will be returned. If the requested interval does
80 /// not overlap with the specified workout route sample, an empty array of results is returned. If
81 /// the requested interval partially overlaps with the specified workout route sample, only location
82 /// data from within that overlapping time period is returned.
83 ///
84 /// Parameter `dataHandler`: The block to invoke with results from the query. It is called repeatedly with an array of
85 /// CLLocation objects until all data is returned and the done parameter is YES or if HKHealthStore
86 /// stopQuery: is called. The stopQuery call can be made within the dataHandler block. The number of
87 /// objects returned in routeData per dataHandler call is unspecified. Once done is YES, or
88 /// stopQuery called, the query is complete and no more calls to the handler will be made.
89 ///
90 /// # Safety
91 ///
92 /// `data_handler` block must be sendable.
93 #[unsafe(method(initWithRoute:dateInterval:dataHandler:))]
94 #[unsafe(method_family = init)]
95 pub unsafe fn initWithRoute_dateInterval_dataHandler(
96 this: Allocated<Self>,
97 workout_route: &HKWorkoutRoute,
98 date_interval: &NSDateInterval,
99 data_handler: &block2::DynBlock<
100 dyn Fn(NonNull<HKWorkoutRouteQuery>, *mut NSArray<CLLocation>, Bool, *mut NSError),
101 >,
102 ) -> Retained<Self>;
103 );
104}
105
106/// Methods declared on superclass `HKQuery`.
107#[cfg(feature = "HKQuery")]
108impl HKWorkoutRouteQuery {
109 extern_methods!(
110 #[unsafe(method(init))]
111 #[unsafe(method_family = init)]
112 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
113 );
114}
115
116/// Methods declared on superclass `NSObject`.
117#[cfg(feature = "HKQuery")]
118impl HKWorkoutRouteQuery {
119 extern_methods!(
120 #[unsafe(method(new))]
121 #[unsafe(method_family = new)]
122 pub unsafe fn new() -> Retained<Self>;
123 );
124}