objc2_intents/generated/
INUpdateMediaAffinityIntent.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/inupdatemediaaffinityintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INUpdateMediaAffinityIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INUpdateMediaAffinityIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INUpdateMediaAffinityIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INUpdateMediaAffinityIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INUpdateMediaAffinityIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INUpdateMediaAffinityIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INUpdateMediaAffinityIntent {
45    extern_methods!(
46        #[cfg(all(
47            feature = "INMediaAffinityType",
48            feature = "INMediaItem",
49            feature = "INMediaSearch"
50        ))]
51        #[unsafe(method(initWithMediaItems:mediaSearch:affinityType:))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn initWithMediaItems_mediaSearch_affinityType(
54            this: Allocated<Self>,
55            media_items: Option<&NSArray<INMediaItem>>,
56            media_search: Option<&INMediaSearch>,
57            affinity_type: INMediaAffinityType,
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 = "INMediaAffinityType")]
71        #[unsafe(method(affinityType))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn affinityType(&self) -> INMediaAffinityType;
74    );
75}
76
77/// Methods declared on superclass `NSObject`.
78#[cfg(feature = "INIntent")]
79impl INUpdateMediaAffinityIntent {
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 INUpdateMediaAffinityIntent. 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/inupdatemediaaffinityintenthandling?language=objc)
97    pub unsafe trait INUpdateMediaAffinityIntentHandling: NSObjectProtocol {
98        #[cfg(all(
99            feature = "INIntent",
100            feature = "INIntentResponse",
101            feature = "INUpdateMediaAffinityIntentResponse",
102            feature = "block2"
103        ))]
104        /// Handling method - Execute the task represented by the INUpdateMediaAffinityIntent 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 INUpdateMediaAffinityIntentResponse containing the details of the result of having executed the intent
112        ///
113        ///
114        /// See: INUpdateMediaAffinityIntentResponse
115        #[unsafe(method(handleUpdateMediaAffinity:completion:))]
116        #[unsafe(method_family = none)]
117        unsafe fn handleUpdateMediaAffinity_completion(
118            &self,
119            intent: &INUpdateMediaAffinityIntent,
120            completion: &block2::DynBlock<dyn Fn(NonNull<INUpdateMediaAffinityIntentResponse>)>,
121        );
122
123        #[cfg(all(
124            feature = "INIntent",
125            feature = "INIntentResponse",
126            feature = "INUpdateMediaAffinityIntentResponse",
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 INUpdateMediaAffinityIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
137        ///
138        ///
139        /// See: INUpdateMediaAffinityIntentResponse
140        #[optional]
141        #[unsafe(method(confirmUpdateMediaAffinity:completion:))]
142        #[unsafe(method_family = none)]
143        unsafe fn confirmUpdateMediaAffinity_completion(
144            &self,
145            intent: &INUpdateMediaAffinityIntent,
146            completion: &block2::DynBlock<dyn Fn(NonNull<INUpdateMediaAffinityIntentResponse>)>,
147        );
148
149        #[cfg(all(
150            feature = "INIntent",
151            feature = "INIntentResolutionResult",
152            feature = "INMediaItemResolutionResult",
153            feature = "INUpdateMediaAffinityMediaItemResolutionResult",
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(resolveMediaItemsForUpdateMediaAffinity:withCompletion:))]
169        #[unsafe(method_family = none)]
170        unsafe fn resolveMediaItemsForUpdateMediaAffinity_withCompletion(
171            &self,
172            intent: &INUpdateMediaAffinityIntent,
173            completion: &block2::DynBlock<
174                dyn Fn(NonNull<NSArray<INUpdateMediaAffinityMediaItemResolutionResult>>),
175            >,
176        );
177
178        #[cfg(all(
179            feature = "INIntent",
180            feature = "INIntentResolutionResult",
181            feature = "INMediaAffinityTypeResolutionResult",
182            feature = "block2"
183        ))]
184        #[optional]
185        #[unsafe(method(resolveAffinityTypeForUpdateMediaAffinity:withCompletion:))]
186        #[unsafe(method_family = none)]
187        unsafe fn resolveAffinityTypeForUpdateMediaAffinity_withCompletion(
188            &self,
189            intent: &INUpdateMediaAffinityIntent,
190            completion: &block2::DynBlock<dyn Fn(NonNull<INMediaAffinityTypeResolutionResult>)>,
191        );
192    }
193);