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::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/healthkit/hkactivitysummaryquery?language=objc)
#[unsafe(super(HKQuery, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "HKQuery")]
pub struct HKActivitySummaryQuery;
);
#[cfg(feature = "HKQuery")]
unsafe impl Send for HKActivitySummaryQuery {}
#[cfg(feature = "HKQuery")]
unsafe impl Sync for HKActivitySummaryQuery {}
#[cfg(feature = "HKQuery")]
extern_conformance!(
unsafe impl NSObjectProtocol for HKActivitySummaryQuery {}
);
#[cfg(feature = "HKQuery")]
impl HKActivitySummaryQuery {
extern_methods!(
#[cfg(all(feature = "HKActivitySummary", feature = "block2"))]
/// An optional handler to be called when activity summaries matching the given predicate are updated.
///
/// This property may not be modified once the query has been executed. If this property is nonnull, then
/// the query must be manually stopped.
///
/// This property is not atomic.
///
/// # Safety
///
/// - The returned block must be sendable.
/// - This might not be thread-safe.
#[unsafe(method(updateHandler))]
#[unsafe(method_family = none)]
pub unsafe fn updateHandler(
&self,
) -> *mut block2::DynBlock<
dyn Fn(NonNull<HKActivitySummaryQuery>, *mut NSArray<HKActivitySummary>, *mut NSError),
>;
#[cfg(all(feature = "HKActivitySummary", feature = "block2"))]
/// Setter for [`updateHandler`][Self::updateHandler].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
///
/// # Safety
///
/// - `update_handler` block must be sendable.
/// - This might not be thread-safe.
#[unsafe(method(setUpdateHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn setUpdateHandler(
&self,
update_handler: Option<
&block2::DynBlock<
dyn Fn(
NonNull<HKActivitySummaryQuery>,
*mut NSArray<HKActivitySummary>,
*mut NSError,
),
>,
>,
);
#[cfg(all(feature = "HKActivitySummary", feature = "block2"))]
/// Returns a query that will retrieve HKActivitySummaries matching the given predicate.
///
/// If no updateHandler is set on the query, the query will automatically stop after calling resultsHandler.
/// Otherwise, the query continues to run and calls the updateHandler as HKActivitySummaries matching the
/// predicate are updated.
///
/// Parameter `predicate`: The predicate which HKActivitySummaries should match.
///
/// Parameter `handler`: The block to invoke with results when the query has finished.
///
/// # Safety
///
/// `handler` block must be sendable.
#[unsafe(method(initWithPredicate:resultsHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithPredicate_resultsHandler(
this: Allocated<Self>,
predicate: Option<&NSPredicate>,
handler: &block2::DynBlock<
dyn Fn(
NonNull<HKActivitySummaryQuery>,
*mut NSArray<HKActivitySummary>,
*mut NSError,
),
>,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `HKQuery`.
#[cfg(feature = "HKQuery")]
impl HKActivitySummaryQuery {
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 HKActivitySummaryQuery {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}