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
//! 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!(
/// An HKLiveWorkoutDataSource is to be used with an HKWorkoutBuilder to automatically collect samples
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkliveworkoutdatasource?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct HKLiveWorkoutDataSource;
);
unsafe impl Send for HKLiveWorkoutDataSource {}
unsafe impl Sync for HKLiveWorkoutDataSource {}
extern_conformance!(
unsafe impl NSObjectProtocol for HKLiveWorkoutDataSource {}
);
impl HKLiveWorkoutDataSource {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "HKObjectType")]
/// The quantity types the receiver is collecting.
#[unsafe(method(typesToCollect))]
#[unsafe(method_family = none)]
pub unsafe fn typesToCollect(&self) -> Retained<NSSet<HKQuantityType>>;
#[cfg(all(feature = "HKHealthStore", feature = "HKWorkoutConfiguration"))]
/// The designated initializer of HKLiveWorkoutDataSource.
///
///
/// Parameter `healthStore`: The HKHealthStore. This should match the one used to create the corresponding
/// HKWorkoutBuilder.
///
/// Parameter `configuration`: An optional workout configuration. typesToCollect will be populated with default
/// types for the workout configuration
#[unsafe(method(initWithHealthStore:workoutConfiguration:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithHealthStore_workoutConfiguration(
this: Allocated<Self>,
health_store: &HKHealthStore,
configuration: Option<&HKWorkoutConfiguration>,
) -> Retained<Self>;
#[cfg(feature = "HKObjectType")]
/// Adds a new type of quantity sample to collect.
///
/// Calling this method for a type that is already being collected will override the predicate for that type.
///
///
/// Parameter `quantityType`: The type of sample to collect.
///
/// Parameter `predicate`: If non-nil, collected samples must match this predicate.
#[unsafe(method(enableCollectionForType:predicate:))]
#[unsafe(method_family = none)]
pub unsafe fn enableCollectionForType_predicate(
&self,
quantity_type: &HKQuantityType,
predicate: Option<&NSPredicate>,
);
#[cfg(feature = "HKObjectType")]
/// Removes the specified quantity type from the types to collect.
///
///
/// Parameter `quantityType`: The type of sample to no longer collect.
#[unsafe(method(disableCollectionForType:))]
#[unsafe(method_family = none)]
pub unsafe fn disableCollectionForType(&self, quantity_type: &HKQuantityType);
);
}
/// Methods declared on superclass `NSObject`.
impl HKLiveWorkoutDataSource {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}