objc2_intents/generated/
INStartWorkoutIntent.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/intents/instartworkoutintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INStartWorkoutIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INStartWorkoutIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INStartWorkoutIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INStartWorkoutIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INStartWorkoutIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INStartWorkoutIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INStartWorkoutIntent {
45    extern_methods!(
46        #[cfg(all(
47            feature = "INSpeakableString",
48            feature = "INWorkoutGoalUnitType",
49            feature = "INWorkoutLocationType"
50        ))]
51        #[unsafe(method(initWithWorkoutName:goalValue:workoutGoalUnitType:workoutLocationType:isOpenEnded:))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn initWithWorkoutName_goalValue_workoutGoalUnitType_workoutLocationType_isOpenEnded(
54            this: Allocated<Self>,
55            workout_name: Option<&INSpeakableString>,
56            goal_value: Option<&NSNumber>,
57            workout_goal_unit_type: INWorkoutGoalUnitType,
58            workout_location_type: INWorkoutLocationType,
59            is_open_ended: Option<&NSNumber>,
60        ) -> Retained<Self>;
61
62        #[cfg(feature = "INSpeakableString")]
63        #[unsafe(method(workoutName))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn workoutName(&self) -> Option<Retained<INSpeakableString>>;
66
67        #[unsafe(method(goalValue))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn goalValue(&self) -> Option<Retained<NSNumber>>;
70
71        #[cfg(feature = "INWorkoutGoalUnitType")]
72        #[unsafe(method(workoutGoalUnitType))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn workoutGoalUnitType(&self) -> INWorkoutGoalUnitType;
75
76        #[cfg(feature = "INWorkoutLocationType")]
77        #[unsafe(method(workoutLocationType))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn workoutLocationType(&self) -> INWorkoutLocationType;
80
81        #[unsafe(method(isOpenEnded))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn isOpenEnded(&self) -> Option<Retained<NSNumber>>;
84    );
85}
86
87/// Methods declared on superclass `NSObject`.
88#[cfg(feature = "INIntent")]
89impl INStartWorkoutIntent {
90    extern_methods!(
91        #[unsafe(method(init))]
92        #[unsafe(method_family = init)]
93        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
94
95        #[unsafe(method(new))]
96        #[unsafe(method_family = new)]
97        pub unsafe fn new() -> Retained<Self>;
98    );
99}
100
101extern_protocol!(
102    /// Protocol to declare support for handling an INStartWorkoutIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent.
103    ///
104    /// The minimum requirement for an implementing class is that it should be able to handle the intent. The resolution and confirmation methods are optional. The handling method is always called last, after resolving and confirming the intent.
105    ///
106    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/instartworkoutintenthandling?language=objc)
107    pub unsafe trait INStartWorkoutIntentHandling: NSObjectProtocol {
108        #[cfg(all(
109            feature = "INIntent",
110            feature = "INIntentResponse",
111            feature = "INStartWorkoutIntentResponse",
112            feature = "block2"
113        ))]
114        /// Handling method - Execute the task represented by the INStartWorkoutIntent that's passed in
115        ///
116        /// Called to actually execute the intent. The app must return a response for this intent.
117        ///
118        ///
119        /// Parameter `intent`: The input intent
120        ///
121        /// Parameter `completion`: The response handling block takes a INStartWorkoutIntentResponse containing the details of the result of having executed the intent
122        ///
123        ///
124        /// See: INStartWorkoutIntentResponse
125        #[unsafe(method(handleStartWorkout:completion:))]
126        #[unsafe(method_family = none)]
127        unsafe fn handleStartWorkout_completion(
128            &self,
129            intent: &INStartWorkoutIntent,
130            completion: &block2::DynBlock<dyn Fn(NonNull<INStartWorkoutIntentResponse>)>,
131        );
132
133        #[cfg(all(
134            feature = "INIntent",
135            feature = "INIntentResponse",
136            feature = "INStartWorkoutIntentResponse",
137            feature = "block2"
138        ))]
139        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
140        ///
141        /// Called prior to asking the app to handle the intent. The app should return a response object that contains additional information about the intent, which may be relevant for the system to show the user prior to handling. If unimplemented, the system will assume the intent is valid following resolution, and will assume there is no additional information relevant to this intent.
142        ///
143        ///
144        /// Parameter `intent`: The input intent
145        ///
146        /// Parameter `completion`: The response block contains an INStartWorkoutIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
147        ///
148        ///
149        /// See: INStartWorkoutIntentResponse
150        #[optional]
151        #[unsafe(method(confirmStartWorkout:completion:))]
152        #[unsafe(method_family = none)]
153        unsafe fn confirmStartWorkout_completion(
154            &self,
155            intent: &INStartWorkoutIntent,
156            completion: &block2::DynBlock<dyn Fn(NonNull<INStartWorkoutIntentResponse>)>,
157        );
158
159        #[cfg(all(
160            feature = "INIntent",
161            feature = "INIntentResolutionResult",
162            feature = "INSpeakableStringResolutionResult",
163            feature = "block2"
164        ))]
165        /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
166        ///
167        /// Called to make sure the app extension is capable of handling this intent in its current form. This method is for validating if the intent needs any further fleshing out.
168        ///
169        ///
170        /// Parameter `intent`: The input intent
171        ///
172        /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
173        ///
174        ///
175        /// See: INIntentResolutionResult
176        #[optional]
177        #[unsafe(method(resolveWorkoutNameForStartWorkout:withCompletion:))]
178        #[unsafe(method_family = none)]
179        unsafe fn resolveWorkoutNameForStartWorkout_withCompletion(
180            &self,
181            intent: &INStartWorkoutIntent,
182            completion: &block2::DynBlock<dyn Fn(NonNull<INSpeakableStringResolutionResult>)>,
183        );
184
185        #[cfg(all(
186            feature = "INDoubleResolutionResult",
187            feature = "INIntent",
188            feature = "INIntentResolutionResult",
189            feature = "block2"
190        ))]
191        #[optional]
192        #[unsafe(method(resolveGoalValueForStartWorkout:withCompletion:))]
193        #[unsafe(method_family = none)]
194        unsafe fn resolveGoalValueForStartWorkout_withCompletion(
195            &self,
196            intent: &INStartWorkoutIntent,
197            completion: &block2::DynBlock<dyn Fn(NonNull<INDoubleResolutionResult>)>,
198        );
199
200        #[cfg(all(
201            feature = "INIntent",
202            feature = "INIntentResolutionResult",
203            feature = "INWorkoutGoalUnitTypeResolutionResult",
204            feature = "block2"
205        ))]
206        #[optional]
207        #[unsafe(method(resolveWorkoutGoalUnitTypeForStartWorkout:withCompletion:))]
208        #[unsafe(method_family = none)]
209        unsafe fn resolveWorkoutGoalUnitTypeForStartWorkout_withCompletion(
210            &self,
211            intent: &INStartWorkoutIntent,
212            completion: &block2::DynBlock<dyn Fn(NonNull<INWorkoutGoalUnitTypeResolutionResult>)>,
213        );
214
215        #[cfg(all(
216            feature = "INIntent",
217            feature = "INIntentResolutionResult",
218            feature = "INWorkoutLocationTypeResolutionResult",
219            feature = "block2"
220        ))]
221        #[optional]
222        #[unsafe(method(resolveWorkoutLocationTypeForStartWorkout:withCompletion:))]
223        #[unsafe(method_family = none)]
224        unsafe fn resolveWorkoutLocationTypeForStartWorkout_withCompletion(
225            &self,
226            intent: &INStartWorkoutIntent,
227            completion: &block2::DynBlock<dyn Fn(NonNull<INWorkoutLocationTypeResolutionResult>)>,
228        );
229
230        #[cfg(all(
231            feature = "INBooleanResolutionResult",
232            feature = "INIntent",
233            feature = "INIntentResolutionResult",
234            feature = "block2"
235        ))]
236        #[optional]
237        #[unsafe(method(resolveIsOpenEndedForStartWorkout:withCompletion:))]
238        #[unsafe(method_family = none)]
239        unsafe fn resolveIsOpenEndedForStartWorkout_withCompletion(
240            &self,
241            intent: &INStartWorkoutIntent,
242            completion: &block2::DynBlock<dyn Fn(NonNull<INBooleanResolutionResult>)>,
243        );
244    }
245);