objc2_intents/generated/
INAnswerCallIntentResponse.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
10/// [Apple's documentation](https://developer.apple.com/documentation/intents/inanswercallintentresponsecode?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct INAnswerCallIntentResponseCode(pub NSInteger);
15impl INAnswerCallIntentResponseCode {
16    #[doc(alias = "INAnswerCallIntentResponseCodeUnspecified")]
17    pub const Unspecified: Self = Self(0);
18    #[doc(alias = "INAnswerCallIntentResponseCodeReady")]
19    pub const Ready: Self = Self(1);
20    #[doc(alias = "INAnswerCallIntentResponseCodeContinueInApp")]
21    pub const ContinueInApp: Self = Self(2);
22    #[doc(alias = "INAnswerCallIntentResponseCodeInProgress")]
23    pub const InProgress: Self = Self(3);
24    #[doc(alias = "INAnswerCallIntentResponseCodeSuccess")]
25    pub const Success: Self = Self(4);
26    #[doc(alias = "INAnswerCallIntentResponseCodeFailure")]
27    pub const Failure: Self = Self(5);
28    #[doc(alias = "INAnswerCallIntentResponseCodeFailureRequiringAppLaunch")]
29    pub const FailureRequiringAppLaunch: Self = Self(6);
30}
31
32unsafe impl Encode for INAnswerCallIntentResponseCode {
33    const ENCODING: Encoding = NSInteger::ENCODING;
34}
35
36unsafe impl RefEncode for INAnswerCallIntentResponseCode {
37    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
38}
39
40extern_class!(
41    /// [Apple's documentation](https://developer.apple.com/documentation/intents/inanswercallintentresponse?language=objc)
42    #[unsafe(super(INIntentResponse, NSObject))]
43    #[derive(Debug, PartialEq, Eq, Hash)]
44    #[cfg(feature = "INIntentResponse")]
45    pub struct INAnswerCallIntentResponse;
46);
47
48#[cfg(feature = "INIntentResponse")]
49extern_conformance!(
50    unsafe impl NSCoding for INAnswerCallIntentResponse {}
51);
52
53#[cfg(feature = "INIntentResponse")]
54extern_conformance!(
55    unsafe impl NSCopying for INAnswerCallIntentResponse {}
56);
57
58#[cfg(feature = "INIntentResponse")]
59unsafe impl CopyingHelper for INAnswerCallIntentResponse {
60    type Result = Self;
61}
62
63#[cfg(feature = "INIntentResponse")]
64extern_conformance!(
65    unsafe impl NSObjectProtocol for INAnswerCallIntentResponse {}
66);
67
68#[cfg(feature = "INIntentResponse")]
69extern_conformance!(
70    unsafe impl NSSecureCoding for INAnswerCallIntentResponse {}
71);
72
73#[cfg(feature = "INIntentResponse")]
74impl INAnswerCallIntentResponse {
75    extern_methods!(
76        #[unsafe(method(init))]
77        #[unsafe(method_family = init)]
78        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
79
80        #[unsafe(method(initWithCode:userActivity:))]
81        #[unsafe(method_family = init)]
82        pub unsafe fn initWithCode_userActivity(
83            this: Allocated<Self>,
84            code: INAnswerCallIntentResponseCode,
85            user_activity: Option<&NSUserActivity>,
86        ) -> Retained<Self>;
87
88        #[unsafe(method(code))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn code(&self) -> INAnswerCallIntentResponseCode;
91
92        #[cfg(feature = "INCallRecord")]
93        #[unsafe(method(callRecords))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn callRecords(&self) -> Option<Retained<NSArray<INCallRecord>>>;
96
97        #[cfg(feature = "INCallRecord")]
98        /// Setter for [`callRecords`][Self::callRecords].
99        ///
100        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
101        #[unsafe(method(setCallRecords:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn setCallRecords(&self, call_records: Option<&NSArray<INCallRecord>>);
104    );
105}
106
107/// Methods declared on superclass `NSObject`.
108#[cfg(feature = "INIntentResponse")]
109impl INAnswerCallIntentResponse {
110    extern_methods!(
111        #[unsafe(method(new))]
112        #[unsafe(method_family = new)]
113        pub unsafe fn new() -> Retained<Self>;
114    );
115}