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