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