objc2_intents/generated/INEndWorkoutIntent.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/inendworkoutintent?language=objc)
12 #[unsafe(super(INIntent, NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 #[cfg(feature = "INIntent")]
15 pub struct INEndWorkoutIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20 unsafe impl NSCoding for INEndWorkoutIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25 unsafe impl NSCopying for INEndWorkoutIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INEndWorkoutIntent {
30 type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35 unsafe impl NSObjectProtocol for INEndWorkoutIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40 unsafe impl NSSecureCoding for INEndWorkoutIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INEndWorkoutIntent {
45 extern_methods!(
46 #[cfg(feature = "INSpeakableString")]
47 #[unsafe(method(initWithWorkoutName:))]
48 #[unsafe(method_family = init)]
49 pub unsafe fn initWithWorkoutName(
50 this: Allocated<Self>,
51 workout_name: Option<&INSpeakableString>,
52 ) -> Retained<Self>;
53
54 #[cfg(feature = "INSpeakableString")]
55 #[unsafe(method(workoutName))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn workoutName(&self) -> Option<Retained<INSpeakableString>>;
58 );
59}
60
61/// Methods declared on superclass `NSObject`.
62#[cfg(feature = "INIntent")]
63impl INEndWorkoutIntent {
64 extern_methods!(
65 #[unsafe(method(init))]
66 #[unsafe(method_family = init)]
67 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
68
69 #[unsafe(method(new))]
70 #[unsafe(method_family = new)]
71 pub unsafe fn new() -> Retained<Self>;
72 );
73}
74
75extern_protocol!(
76 /// Protocol to declare support for handling an INEndWorkoutIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent.
77 ///
78 /// 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.
79 ///
80 /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/inendworkoutintenthandling?language=objc)
81 pub unsafe trait INEndWorkoutIntentHandling: NSObjectProtocol {
82 #[cfg(all(
83 feature = "INEndWorkoutIntentResponse",
84 feature = "INIntent",
85 feature = "INIntentResponse",
86 feature = "block2"
87 ))]
88 /// Handling method - Execute the task represented by the INEndWorkoutIntent that's passed in
89 ///
90 /// Called to actually execute the intent. The app must return a response for this intent.
91 ///
92 ///
93 /// Parameter `intent`: The input intent
94 ///
95 /// Parameter `completion`: The response handling block takes a INEndWorkoutIntentResponse containing the details of the result of having executed the intent
96 ///
97 ///
98 /// See: INEndWorkoutIntentResponse
99 #[unsafe(method(handleEndWorkout:completion:))]
100 #[unsafe(method_family = none)]
101 unsafe fn handleEndWorkout_completion(
102 &self,
103 intent: &INEndWorkoutIntent,
104 completion: &block2::DynBlock<dyn Fn(NonNull<INEndWorkoutIntentResponse>)>,
105 );
106
107 #[cfg(all(
108 feature = "INEndWorkoutIntentResponse",
109 feature = "INIntent",
110 feature = "INIntentResponse",
111 feature = "block2"
112 ))]
113 /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
114 ///
115 /// 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.
116 ///
117 ///
118 /// Parameter `intent`: The input intent
119 ///
120 /// Parameter `completion`: The response block contains an INEndWorkoutIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
121 ///
122 ///
123 /// See: INEndWorkoutIntentResponse
124 #[optional]
125 #[unsafe(method(confirmEndWorkout:completion:))]
126 #[unsafe(method_family = none)]
127 unsafe fn confirmEndWorkout_completion(
128 &self,
129 intent: &INEndWorkoutIntent,
130 completion: &block2::DynBlock<dyn Fn(NonNull<INEndWorkoutIntentResponse>)>,
131 );
132
133 #[cfg(all(
134 feature = "INIntent",
135 feature = "INIntentResolutionResult",
136 feature = "INSpeakableStringResolutionResult",
137 feature = "block2"
138 ))]
139 /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
140 ///
141 /// 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.
142 ///
143 ///
144 /// Parameter `intent`: The input intent
145 ///
146 /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
147 ///
148 ///
149 /// See: INIntentResolutionResult
150 #[optional]
151 #[unsafe(method(resolveWorkoutNameForEndWorkout:withCompletion:))]
152 #[unsafe(method_family = none)]
153 unsafe fn resolveWorkoutNameForEndWorkout_withCompletion(
154 &self,
155 intent: &INEndWorkoutIntent,
156 completion: &block2::DynBlock<dyn Fn(NonNull<INSpeakableStringResolutionResult>)>,
157 );
158 }
159);