objc2_intents/generated/
INGetVisualCodeIntent.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/ingetvisualcodeintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    #[deprecated = "INGetVisualCodeIntent is deprecated. There is no replacement."]
16    pub struct INGetVisualCodeIntent;
17);
18
19#[cfg(feature = "INIntent")]
20extern_conformance!(
21    unsafe impl NSCoding for INGetVisualCodeIntent {}
22);
23
24#[cfg(feature = "INIntent")]
25extern_conformance!(
26    unsafe impl NSCopying for INGetVisualCodeIntent {}
27);
28
29#[cfg(feature = "INIntent")]
30unsafe impl CopyingHelper for INGetVisualCodeIntent {
31    type Result = Self;
32}
33
34#[cfg(feature = "INIntent")]
35extern_conformance!(
36    unsafe impl NSObjectProtocol for INGetVisualCodeIntent {}
37);
38
39#[cfg(feature = "INIntent")]
40extern_conformance!(
41    unsafe impl NSSecureCoding for INGetVisualCodeIntent {}
42);
43
44#[cfg(feature = "INIntent")]
45impl INGetVisualCodeIntent {
46    extern_methods!(
47        #[cfg(feature = "INVisualCodeType")]
48        #[deprecated = "INGetVisualCodeIntent is deprecated. There is no replacement."]
49        #[unsafe(method(initWithVisualCodeType:))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn initWithVisualCodeType(
52            this: Allocated<Self>,
53            visual_code_type: INVisualCodeType,
54        ) -> Retained<Self>;
55
56        #[cfg(feature = "INVisualCodeType")]
57        #[deprecated = "INGetVisualCodeIntent is deprecated. There is no replacement."]
58        #[unsafe(method(visualCodeType))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn visualCodeType(&self) -> INVisualCodeType;
61    );
62}
63
64/// Methods declared on superclass `NSObject`.
65#[cfg(feature = "INIntent")]
66impl INGetVisualCodeIntent {
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 INGetVisualCodeIntent. 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/ingetvisualcodeintenthandling?language=objc)
84    #[deprecated = "INGetVisualCodeIntentHandling is deprecated. There is no replacement."]
85    pub unsafe trait INGetVisualCodeIntentHandling: NSObjectProtocol {
86        #[cfg(all(
87            feature = "INGetVisualCodeIntentResponse",
88            feature = "INIntent",
89            feature = "INIntentResponse",
90            feature = "block2"
91        ))]
92        /// Handling method - Execute the task represented by the INGetVisualCodeIntent that's passed in
93        ///
94        /// Called to actually execute the intent. The app must return a response for this intent.
95        ///
96        ///
97        /// Parameter `intent`: The input intent
98        ///
99        /// Parameter `completion`: The response handling block takes a INGetVisualCodeIntentResponse containing the details of the result of having executed the intent
100        ///
101        ///
102        /// See: INGetVisualCodeIntentResponse
103        #[deprecated = "INGetVisualCodeIntentHandling is deprecated. There is no replacement."]
104        #[unsafe(method(handleGetVisualCode:completion:))]
105        #[unsafe(method_family = none)]
106        unsafe fn handleGetVisualCode_completion(
107            &self,
108            intent: &INGetVisualCodeIntent,
109            completion: &block2::DynBlock<dyn Fn(NonNull<INGetVisualCodeIntentResponse>)>,
110        );
111
112        #[cfg(all(
113            feature = "INGetVisualCodeIntentResponse",
114            feature = "INIntent",
115            feature = "INIntentResponse",
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 INGetVisualCodeIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
126        ///
127        ///
128        /// See: INGetVisualCodeIntentResponse
129        #[deprecated = "INGetVisualCodeIntentHandling is deprecated. There is no replacement."]
130        #[optional]
131        #[unsafe(method(confirmGetVisualCode:completion:))]
132        #[unsafe(method_family = none)]
133        unsafe fn confirmGetVisualCode_completion(
134            &self,
135            intent: &INGetVisualCodeIntent,
136            completion: &block2::DynBlock<dyn Fn(NonNull<INGetVisualCodeIntentResponse>)>,
137        );
138
139        #[cfg(all(
140            feature = "INIntent",
141            feature = "INIntentResolutionResult",
142            feature = "INVisualCodeTypeResolutionResult",
143            feature = "block2"
144        ))]
145        /// Resolution methods - Determine if this intent is ready for the next step (confirmation)
146        ///
147        /// 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.
148        ///
149        ///
150        /// Parameter `intent`: The input intent
151        ///
152        /// Parameter `completion`: The response block contains an INIntentResolutionResult for the parameter being resolved
153        ///
154        ///
155        /// See: INIntentResolutionResult
156        #[deprecated = "INGetVisualCodeIntentHandling is deprecated. There is no replacement."]
157        #[optional]
158        #[unsafe(method(resolveVisualCodeTypeForGetVisualCode:withCompletion:))]
159        #[unsafe(method_family = none)]
160        unsafe fn resolveVisualCodeTypeForGetVisualCode_withCompletion(
161            &self,
162            intent: &INGetVisualCodeIntent,
163            completion: &block2::DynBlock<dyn Fn(NonNull<INVisualCodeTypeResolutionResult>)>,
164        );
165    }
166);