objc2_intents/generated/
INPlayMediaIntent.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/inplaymediaintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INPlayMediaIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INPlayMediaIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INPlayMediaIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INPlayMediaIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INPlayMediaIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INPlayMediaIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INPlayMediaIntent {
45    extern_methods!(
46        #[cfg(all(
47            feature = "INMediaItem",
48            feature = "INMediaSearch",
49            feature = "INPlaybackQueueLocation",
50            feature = "INPlaybackRepeatMode"
51        ))]
52        #[unsafe(method(initWithMediaItems:mediaContainer:playShuffled:playbackRepeatMode:resumePlayback:playbackQueueLocation:playbackSpeed:mediaSearch:))]
53        #[unsafe(method_family = init)]
54        pub unsafe fn initWithMediaItems_mediaContainer_playShuffled_playbackRepeatMode_resumePlayback_playbackQueueLocation_playbackSpeed_mediaSearch(
55            this: Allocated<Self>,
56            media_items: Option<&NSArray<INMediaItem>>,
57            media_container: Option<&INMediaItem>,
58            play_shuffled: Option<&NSNumber>,
59            playback_repeat_mode: INPlaybackRepeatMode,
60            resume_playback: Option<&NSNumber>,
61            playback_queue_location: INPlaybackQueueLocation,
62            playback_speed: Option<&NSNumber>,
63            media_search: Option<&INMediaSearch>,
64        ) -> Retained<Self>;
65
66        #[cfg(feature = "INMediaItem")]
67        #[unsafe(method(mediaItems))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn mediaItems(&self) -> Option<Retained<NSArray<INMediaItem>>>;
70
71        #[cfg(feature = "INMediaItem")]
72        #[unsafe(method(mediaContainer))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn mediaContainer(&self) -> Option<Retained<INMediaItem>>;
75
76        #[unsafe(method(playShuffled))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn playShuffled(&self) -> Option<Retained<NSNumber>>;
79
80        #[cfg(feature = "INPlaybackRepeatMode")]
81        #[unsafe(method(playbackRepeatMode))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn playbackRepeatMode(&self) -> INPlaybackRepeatMode;
84
85        #[unsafe(method(resumePlayback))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn resumePlayback(&self) -> Option<Retained<NSNumber>>;
88
89        #[cfg(feature = "INPlaybackQueueLocation")]
90        #[unsafe(method(playbackQueueLocation))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn playbackQueueLocation(&self) -> INPlaybackQueueLocation;
93
94        #[unsafe(method(playbackSpeed))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn playbackSpeed(&self) -> Option<Retained<NSNumber>>;
97
98        #[cfg(feature = "INMediaSearch")]
99        #[unsafe(method(mediaSearch))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn mediaSearch(&self) -> Option<Retained<INMediaSearch>>;
102    );
103}
104
105/// Methods declared on superclass `NSObject`.
106#[cfg(feature = "INIntent")]
107impl INPlayMediaIntent {
108    extern_methods!(
109        #[unsafe(method(init))]
110        #[unsafe(method_family = init)]
111        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
112
113        #[unsafe(method(new))]
114        #[unsafe(method_family = new)]
115        pub unsafe fn new() -> Retained<Self>;
116    );
117}
118
119extern_protocol!(
120    /// Protocol to declare support for handling an INPlayMediaIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent.
121    ///
122    /// 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.
123    ///
124    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/inplaymediaintenthandling?language=objc)
125    pub unsafe trait INPlayMediaIntentHandling: NSObjectProtocol {
126        #[cfg(all(
127            feature = "INIntent",
128            feature = "INIntentResponse",
129            feature = "INPlayMediaIntentResponse",
130            feature = "block2"
131        ))]
132        /// Handling method - Execute the task represented by the INPlayMediaIntent that's passed in
133        ///
134        /// Called to actually execute the intent. The app must return a response for this intent.
135        ///
136        ///
137        /// Parameter `intent`: The input intent
138        ///
139        /// Parameter `completion`: The response handling block takes a INPlayMediaIntentResponse containing the details of the result of having executed the intent
140        ///
141        ///
142        /// See: INPlayMediaIntentResponse
143        #[unsafe(method(handlePlayMedia:completion:))]
144        #[unsafe(method_family = none)]
145        unsafe fn handlePlayMedia_completion(
146            &self,
147            intent: &INPlayMediaIntent,
148            completion: &block2::DynBlock<dyn Fn(NonNull<INPlayMediaIntentResponse>)>,
149        );
150
151        #[cfg(all(
152            feature = "INIntent",
153            feature = "INIntentResponse",
154            feature = "INPlayMediaIntentResponse",
155            feature = "block2"
156        ))]
157        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
158        ///
159        /// 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.
160        ///
161        ///
162        /// Parameter `intent`: The input intent
163        ///
164        /// Parameter `completion`: The response block contains an INPlayMediaIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
165        ///
166        ///
167        /// See: INPlayMediaIntentResponse
168        #[optional]
169        #[unsafe(method(confirmPlayMedia:completion:))]
170        #[unsafe(method_family = none)]
171        unsafe fn confirmPlayMedia_completion(
172            &self,
173            intent: &INPlayMediaIntent,
174            completion: &block2::DynBlock<dyn Fn(NonNull<INPlayMediaIntentResponse>)>,
175        );
176
177        #[cfg(all(
178            feature = "INIntent",
179            feature = "INIntentResolutionResult",
180            feature = "INMediaItemResolutionResult",
181            feature = "INPlayMediaMediaItemResolutionResult",
182            feature = "block2"
183        ))]
184        /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
185        ///
186        /// 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.
187        ///
188        ///
189        /// Parameter `intent`: The input intent
190        ///
191        /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
192        ///
193        ///
194        /// See: INIntentResolutionResult
195        #[optional]
196        #[unsafe(method(resolveMediaItemsForPlayMedia:withCompletion:))]
197        #[unsafe(method_family = none)]
198        unsafe fn resolveMediaItemsForPlayMedia_withCompletion(
199            &self,
200            intent: &INPlayMediaIntent,
201            completion: &block2::DynBlock<
202                dyn Fn(NonNull<NSArray<INPlayMediaMediaItemResolutionResult>>),
203            >,
204        );
205
206        #[cfg(all(
207            feature = "INBooleanResolutionResult",
208            feature = "INIntent",
209            feature = "INIntentResolutionResult",
210            feature = "block2"
211        ))]
212        #[optional]
213        #[unsafe(method(resolvePlayShuffledForPlayMedia:withCompletion:))]
214        #[unsafe(method_family = none)]
215        unsafe fn resolvePlayShuffledForPlayMedia_withCompletion(
216            &self,
217            intent: &INPlayMediaIntent,
218            completion: &block2::DynBlock<dyn Fn(NonNull<INBooleanResolutionResult>)>,
219        );
220
221        #[cfg(all(
222            feature = "INIntent",
223            feature = "INIntentResolutionResult",
224            feature = "INPlaybackRepeatModeResolutionResult",
225            feature = "block2"
226        ))]
227        #[optional]
228        #[unsafe(method(resolvePlaybackRepeatModeForPlayMedia:withCompletion:))]
229        #[unsafe(method_family = none)]
230        unsafe fn resolvePlaybackRepeatModeForPlayMedia_withCompletion(
231            &self,
232            intent: &INPlayMediaIntent,
233            completion: &block2::DynBlock<dyn Fn(NonNull<INPlaybackRepeatModeResolutionResult>)>,
234        );
235
236        #[cfg(all(
237            feature = "INBooleanResolutionResult",
238            feature = "INIntent",
239            feature = "INIntentResolutionResult",
240            feature = "block2"
241        ))]
242        #[optional]
243        #[unsafe(method(resolveResumePlaybackForPlayMedia:withCompletion:))]
244        #[unsafe(method_family = none)]
245        unsafe fn resolveResumePlaybackForPlayMedia_withCompletion(
246            &self,
247            intent: &INPlayMediaIntent,
248            completion: &block2::DynBlock<dyn Fn(NonNull<INBooleanResolutionResult>)>,
249        );
250
251        #[cfg(all(
252            feature = "INIntent",
253            feature = "INIntentResolutionResult",
254            feature = "INPlaybackQueueLocationResolutionResult",
255            feature = "block2"
256        ))]
257        #[optional]
258        #[unsafe(method(resolvePlaybackQueueLocationForPlayMedia:withCompletion:))]
259        #[unsafe(method_family = none)]
260        unsafe fn resolvePlaybackQueueLocationForPlayMedia_withCompletion(
261            &self,
262            intent: &INPlayMediaIntent,
263            completion: &block2::DynBlock<dyn Fn(NonNull<INPlaybackQueueLocationResolutionResult>)>,
264        );
265
266        #[cfg(all(
267            feature = "INDoubleResolutionResult",
268            feature = "INIntent",
269            feature = "INIntentResolutionResult",
270            feature = "INPlayMediaPlaybackSpeedResolutionResult",
271            feature = "block2"
272        ))]
273        #[optional]
274        #[unsafe(method(resolvePlaybackSpeedForPlayMedia:withCompletion:))]
275        #[unsafe(method_family = none)]
276        unsafe fn resolvePlaybackSpeedForPlayMedia_withCompletion(
277            &self,
278            intent: &INPlayMediaIntent,
279            completion: &block2::DynBlock<
280                dyn Fn(NonNull<INPlayMediaPlaybackSpeedResolutionResult>),
281            >,
282        );
283    }
284);