objc2_intents/generated/
INAddMediaIntent.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/inaddmediaintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INAddMediaIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INAddMediaIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INAddMediaIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INAddMediaIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INAddMediaIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INAddMediaIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INAddMediaIntent {
45    extern_methods!(
46        #[cfg(all(
47            feature = "INMediaDestination",
48            feature = "INMediaItem",
49            feature = "INMediaSearch"
50        ))]
51        #[unsafe(method(initWithMediaItems:mediaSearch:mediaDestination:))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn initWithMediaItems_mediaSearch_mediaDestination(
54            this: Allocated<Self>,
55            media_items: Option<&NSArray<INMediaItem>>,
56            media_search: Option<&INMediaSearch>,
57            media_destination: Option<&INMediaDestination>,
58        ) -> Retained<Self>;
59
60        #[cfg(feature = "INMediaItem")]
61        #[unsafe(method(mediaItems))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn mediaItems(&self) -> Option<Retained<NSArray<INMediaItem>>>;
64
65        #[cfg(feature = "INMediaSearch")]
66        #[unsafe(method(mediaSearch))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn mediaSearch(&self) -> Option<Retained<INMediaSearch>>;
69
70        #[cfg(feature = "INMediaDestination")]
71        #[unsafe(method(mediaDestination))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn mediaDestination(&self) -> Option<Retained<INMediaDestination>>;
74    );
75}
76
77/// Methods declared on superclass `NSObject`.
78#[cfg(feature = "INIntent")]
79impl INAddMediaIntent {
80    extern_methods!(
81        #[unsafe(method(init))]
82        #[unsafe(method_family = init)]
83        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
84
85        #[unsafe(method(new))]
86        #[unsafe(method_family = new)]
87        pub unsafe fn new() -> Retained<Self>;
88    );
89}
90
91extern_protocol!(
92    /// Protocol to declare support for handling an INAddMediaIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent.
93    ///
94    /// 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.
95    ///
96    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/inaddmediaintenthandling?language=objc)
97    pub unsafe trait INAddMediaIntentHandling: NSObjectProtocol {
98        #[cfg(all(
99            feature = "INAddMediaIntentResponse",
100            feature = "INIntent",
101            feature = "INIntentResponse",
102            feature = "block2"
103        ))]
104        /// Handling method - Execute the task represented by the INAddMediaIntent that's passed in
105        ///
106        /// Called to actually execute the intent. The app must return a response for this intent.
107        ///
108        ///
109        /// Parameter `intent`: The input intent
110        ///
111        /// Parameter `completion`: The response handling block takes a INAddMediaIntentResponse containing the details of the result of having executed the intent
112        ///
113        ///
114        /// See: INAddMediaIntentResponse
115        #[unsafe(method(handleAddMedia:completion:))]
116        #[unsafe(method_family = none)]
117        unsafe fn handleAddMedia_completion(
118            &self,
119            intent: &INAddMediaIntent,
120            completion: &block2::DynBlock<dyn Fn(NonNull<INAddMediaIntentResponse>)>,
121        );
122
123        #[cfg(all(
124            feature = "INAddMediaIntentResponse",
125            feature = "INIntent",
126            feature = "INIntentResponse",
127            feature = "block2"
128        ))]
129        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
130        ///
131        /// 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.
132        ///
133        ///
134        /// Parameter `intent`: The input intent
135        ///
136        /// Parameter `completion`: The response block contains an INAddMediaIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
137        ///
138        ///
139        /// See: INAddMediaIntentResponse
140        #[optional]
141        #[unsafe(method(confirmAddMedia:completion:))]
142        #[unsafe(method_family = none)]
143        unsafe fn confirmAddMedia_completion(
144            &self,
145            intent: &INAddMediaIntent,
146            completion: &block2::DynBlock<dyn Fn(NonNull<INAddMediaIntentResponse>)>,
147        );
148
149        #[cfg(all(
150            feature = "INAddMediaMediaItemResolutionResult",
151            feature = "INIntent",
152            feature = "INIntentResolutionResult",
153            feature = "INMediaItemResolutionResult",
154            feature = "block2"
155        ))]
156        /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
157        ///
158        /// 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.
159        ///
160        ///
161        /// Parameter `intent`: The input intent
162        ///
163        /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
164        ///
165        ///
166        /// See: INIntentResolutionResult
167        #[optional]
168        #[unsafe(method(resolveMediaItemsForAddMedia:withCompletion:))]
169        #[unsafe(method_family = none)]
170        unsafe fn resolveMediaItemsForAddMedia_withCompletion(
171            &self,
172            intent: &INAddMediaIntent,
173            completion: &block2::DynBlock<
174                dyn Fn(NonNull<NSArray<INAddMediaMediaItemResolutionResult>>),
175            >,
176        );
177
178        #[cfg(all(
179            feature = "INAddMediaMediaDestinationResolutionResult",
180            feature = "INIntent",
181            feature = "INIntentResolutionResult",
182            feature = "INMediaDestinationResolutionResult",
183            feature = "block2"
184        ))]
185        #[optional]
186        #[unsafe(method(resolveMediaDestinationForAddMedia:withCompletion:))]
187        #[unsafe(method_family = none)]
188        unsafe fn resolveMediaDestinationForAddMedia_withCompletion(
189            &self,
190            intent: &INAddMediaIntent,
191            completion: &block2::DynBlock<
192                dyn Fn(NonNull<INAddMediaMediaDestinationResolutionResult>),
193            >,
194        );
195    }
196);