objc2_intents/generated/
INAnswerCallIntent.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/inanswercallintent?language=objc)
12    #[unsafe(super(INIntent, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "INIntent")]
15    pub struct INAnswerCallIntent;
16);
17
18#[cfg(feature = "INIntent")]
19extern_conformance!(
20    unsafe impl NSCoding for INAnswerCallIntent {}
21);
22
23#[cfg(feature = "INIntent")]
24extern_conformance!(
25    unsafe impl NSCopying for INAnswerCallIntent {}
26);
27
28#[cfg(feature = "INIntent")]
29unsafe impl CopyingHelper for INAnswerCallIntent {
30    type Result = Self;
31}
32
33#[cfg(feature = "INIntent")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for INAnswerCallIntent {}
36);
37
38#[cfg(feature = "INIntent")]
39extern_conformance!(
40    unsafe impl NSSecureCoding for INAnswerCallIntent {}
41);
42
43#[cfg(feature = "INIntent")]
44impl INAnswerCallIntent {
45    extern_methods!(
46        #[cfg(feature = "INCallAudioRoute")]
47        #[unsafe(method(initWithAudioRoute:callIdentifier:))]
48        #[unsafe(method_family = init)]
49        pub unsafe fn initWithAudioRoute_callIdentifier(
50            this: Allocated<Self>,
51            audio_route: INCallAudioRoute,
52            call_identifier: Option<&NSString>,
53        ) -> Retained<Self>;
54
55        #[cfg(feature = "INCallAudioRoute")]
56        #[unsafe(method(audioRoute))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn audioRoute(&self) -> INCallAudioRoute;
59
60        #[unsafe(method(callIdentifier))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn callIdentifier(&self) -> Option<Retained<NSString>>;
63    );
64}
65
66/// Methods declared on superclass `NSObject`.
67#[cfg(feature = "INIntent")]
68impl INAnswerCallIntent {
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 INAnswerCallIntent. 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/inanswercallintenthandling?language=objc)
86    pub unsafe trait INAnswerCallIntentHandling: NSObjectProtocol {
87        #[cfg(all(
88            feature = "INAnswerCallIntentResponse",
89            feature = "INIntent",
90            feature = "INIntentResponse",
91            feature = "block2"
92        ))]
93        /// Handling method - Execute the task represented by the INAnswerCallIntent 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 INAnswerCallIntentResponse containing the details of the result of having executed the intent
101        ///
102        ///
103        /// See: INAnswerCallIntentResponse
104        #[unsafe(method(handleAnswerCall:completion:))]
105        #[unsafe(method_family = none)]
106        unsafe fn handleAnswerCall_completion(
107            &self,
108            intent: &INAnswerCallIntent,
109            completion: &block2::DynBlock<dyn Fn(NonNull<INAnswerCallIntentResponse>)>,
110        );
111
112        #[cfg(all(
113            feature = "INAnswerCallIntentResponse",
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 INAnswerCallIntentResponse containing additional details about the intent that may be relevant for the system to show the user prior to handling.
126        ///
127        ///
128        /// See: INAnswerCallIntentResponse
129        #[optional]
130        #[unsafe(method(confirmAnswerCall:completion:))]
131        #[unsafe(method_family = none)]
132        unsafe fn confirmAnswerCall_completion(
133            &self,
134            intent: &INAnswerCallIntent,
135            completion: &block2::DynBlock<dyn Fn(NonNull<INAnswerCallIntentResponse>)>,
136        );
137    }
138);