objc2_intents/generated/
INUnsendMessagesIntent.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/inunsendmessagesintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INUnsendMessagesIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INUnsendMessagesIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INUnsendMessagesIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INUnsendMessagesIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INUnsendMessagesIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INUnsendMessagesIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INUnsendMessagesIntent {
45    extern_methods!(
46        #[unsafe(method(initWithMessageIdentifiers:))]
47        #[unsafe(method_family = init)]
48        pub unsafe fn initWithMessageIdentifiers(
49            this: Allocated<Self>,
50            message_identifiers: Option<&NSArray<NSString>>,
51        ) -> Retained<Self>;
52
53        #[unsafe(method(messageIdentifiers))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn messageIdentifiers(&self) -> Option<Retained<NSArray<NSString>>>;
56    );
57}
58
59/// Methods declared on superclass `NSObject`.
60#[cfg(feature = "INIntent")]
61impl INUnsendMessagesIntent {
62    extern_methods!(
63        #[unsafe(method(init))]
64        #[unsafe(method_family = init)]
65        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
66
67        #[unsafe(method(new))]
68        #[unsafe(method_family = new)]
69        pub unsafe fn new() -> Retained<Self>;
70    );
71}
72
73extern_protocol!(
74    /// Protocol to declare support for handling an INUnsendMessagesIntent. By implementing this protocol, a class can provide logic for resolving, confirming and handling the intent.
75    ///
76    /// 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.
77    ///
78    /// See also [Apple's documentation](https://developer.apple.com/documentation/intents/inunsendmessagesintenthandling?language=objc)
79    pub unsafe trait INUnsendMessagesIntentHandling: NSObjectProtocol {
80        #[cfg(all(
81            feature = "INIntent",
82            feature = "INIntentResponse",
83            feature = "INUnsendMessagesIntentResponse",
84            feature = "block2"
85        ))]
86        /// Handling method - Execute the task represented by the INUnsendMessagesIntent that's passed in
87        ///
88        /// Called to actually execute the intent. The app must return a response for this intent.
89        ///
90        ///
91        /// Parameter `intent`: The input intent
92        ///
93        /// Parameter `completion`: The response handling block takes a INUnsendMessagesIntentResponse containing the details of the result of having executed the intent
94        ///
95        ///
96        /// See: INUnsendMessagesIntentResponse
97        #[unsafe(method(handleUnsendMessages:completion:))]
98        #[unsafe(method_family = none)]
99        unsafe fn handleUnsendMessages_completion(
100            &self,
101            intent: &INUnsendMessagesIntent,
102            completion: &block2::DynBlock<dyn Fn(NonNull<INUnsendMessagesIntentResponse>)>,
103        );
104
105        #[cfg(all(
106            feature = "INIntent",
107            feature = "INIntentResponse",
108            feature = "INUnsendMessagesIntentResponse",
109            feature = "block2"
110        ))]
111        /// Confirmation method - Validate that this intent is ready for the next step (i.e. handling)
112        ///
113        /// 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.
114        ///
115        ///
116        /// Parameter `intent`: The input intent
117        ///
118        /// Parameter `completion`: The response block contains an INUnsendMessagesIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
119        ///
120        ///
121        /// See: INUnsendMessagesIntentResponse
122        #[optional]
123        #[unsafe(method(confirmUnsendMessages:completion:))]
124        #[unsafe(method_family = none)]
125        unsafe fn confirmUnsendMessages_completion(
126            &self,
127            intent: &INUnsendMessagesIntent,
128            completion: &block2::DynBlock<dyn Fn(NonNull<INUnsendMessagesIntentResponse>)>,
129        );
130    }
131);