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