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