objc2_intents/generated/
INPauseWorkoutIntent.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/inpauseworkoutintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INPauseWorkoutIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INPauseWorkoutIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INPauseWorkoutIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INPauseWorkoutIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INPauseWorkoutIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INPauseWorkoutIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INPauseWorkoutIntent {
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 INPauseWorkoutIntent {
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 INPauseWorkoutIntent. 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/inpauseworkoutintenthandling?language=objc)
81    pub unsafe trait INPauseWorkoutIntentHandling: NSObjectProtocol {
82        #[cfg(all(
83            feature = "INIntent",
84            feature = "INIntentResponse",
85            feature = "INPauseWorkoutIntentResponse",
86            feature = "block2"
87        ))]
88        /// Handling method - Execute the task represented by the INPauseWorkoutIntent 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 INPauseWorkoutIntentResponse containing the details of the result of having executed the intent
96        ///
97        ///
98        /// See: INPauseWorkoutIntentResponse
99        #[unsafe(method(handlePauseWorkout:completion:))]
100        #[unsafe(method_family = none)]
101        unsafe fn handlePauseWorkout_completion(
102            &self,
103            intent: &INPauseWorkoutIntent,
104            completion: &block2::DynBlock<dyn Fn(NonNull<INPauseWorkoutIntentResponse>)>,
105        );
106
107        #[cfg(all(
108            feature = "INIntent",
109            feature = "INIntentResponse",
110            feature = "INPauseWorkoutIntentResponse",
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 INPauseWorkoutIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
121        ///
122        ///
123        /// See: INPauseWorkoutIntentResponse
124        #[optional]
125        #[unsafe(method(confirmPauseWorkout:completion:))]
126        #[unsafe(method_family = none)]
127        unsafe fn confirmPauseWorkout_completion(
128            &self,
129            intent: &INPauseWorkoutIntent,
130            completion: &block2::DynBlock<dyn Fn(NonNull<INPauseWorkoutIntentResponse>)>,
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(resolveWorkoutNameForPauseWorkout:withCompletion:))]
152        #[unsafe(method_family = none)]
153        unsafe fn resolveWorkoutNameForPauseWorkout_withCompletion(
154            &self,
155            intent: &INPauseWorkoutIntent,
156            completion: &block2::DynBlock<dyn Fn(NonNull<INSpeakableStringResolutionResult>)>,
157        );
158    }
159);