objc2_call_kit/generated/
CXPlayDTMFCallAction.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/callkit/cxplaydtmfcallactiontype?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct CXPlayDTMFCallActionType(pub NSInteger);
15impl CXPlayDTMFCallActionType {
16    #[doc(alias = "CXPlayDTMFCallActionTypeSingleTone")]
17    pub const SingleTone: Self = Self(1);
18    #[doc(alias = "CXPlayDTMFCallActionTypeSoftPause")]
19    pub const SoftPause: Self = Self(2);
20    #[doc(alias = "CXPlayDTMFCallActionTypeHardPause")]
21    pub const HardPause: Self = Self(3);
22}
23
24unsafe impl Encode for CXPlayDTMFCallActionType {
25    const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for CXPlayDTMFCallActionType {
29    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32extern_class!(
33    /// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxplaydtmfcallaction?language=objc)
34    #[unsafe(super(CXCallAction, CXAction, NSObject))]
35    #[derive(Debug, PartialEq, Eq, Hash)]
36    #[cfg(all(feature = "CXAction", feature = "CXCallAction"))]
37    pub struct CXPlayDTMFCallAction;
38);
39
40#[cfg(all(feature = "CXAction", feature = "CXCallAction"))]
41extern_conformance!(
42    unsafe impl NSCoding for CXPlayDTMFCallAction {}
43);
44
45#[cfg(all(feature = "CXAction", feature = "CXCallAction"))]
46extern_conformance!(
47    unsafe impl NSCopying for CXPlayDTMFCallAction {}
48);
49
50#[cfg(all(feature = "CXAction", feature = "CXCallAction"))]
51unsafe impl CopyingHelper for CXPlayDTMFCallAction {
52    type Result = Self;
53}
54
55#[cfg(all(feature = "CXAction", feature = "CXCallAction"))]
56extern_conformance!(
57    unsafe impl NSObjectProtocol for CXPlayDTMFCallAction {}
58);
59
60#[cfg(all(feature = "CXAction", feature = "CXCallAction"))]
61extern_conformance!(
62    unsafe impl NSSecureCoding for CXPlayDTMFCallAction {}
63);
64
65#[cfg(all(feature = "CXAction", feature = "CXCallAction"))]
66impl CXPlayDTMFCallAction {
67    extern_methods!(
68        #[unsafe(method(initWithCallUUID:digits:type:))]
69        #[unsafe(method_family = init)]
70        pub unsafe fn initWithCallUUID_digits_type(
71            this: Allocated<Self>,
72            call_uuid: &NSUUID,
73            digits: &NSString,
74            r#type: CXPlayDTMFCallActionType,
75        ) -> Retained<Self>;
76
77        /// # Safety
78        ///
79        /// `a_decoder` possibly has further requirements.
80        #[unsafe(method(initWithCoder:))]
81        #[unsafe(method_family = init)]
82        pub unsafe fn initWithCoder(
83            this: Allocated<Self>,
84            a_decoder: &NSCoder,
85        ) -> Option<Retained<Self>>;
86
87        #[unsafe(method(initWithCallUUID:))]
88        #[unsafe(method_family = init)]
89        pub unsafe fn initWithCallUUID(this: Allocated<Self>, call_uuid: &NSUUID)
90            -> Retained<Self>;
91
92        #[unsafe(method(digits))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn digits(&self) -> Retained<NSString>;
95
96        /// Setter for [`digits`][Self::digits].
97        ///
98        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
99        #[unsafe(method(setDigits:))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn setDigits(&self, digits: &NSString);
102
103        #[unsafe(method(type))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn r#type(&self) -> CXPlayDTMFCallActionType;
106
107        /// Setter for [`type`][Self::type].
108        #[unsafe(method(setType:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn setType(&self, r#type: CXPlayDTMFCallActionType);
111    );
112}
113
114/// Methods declared on superclass `CXCallAction`.
115#[cfg(all(feature = "CXAction", feature = "CXCallAction"))]
116impl CXPlayDTMFCallAction {
117    extern_methods!(
118        #[unsafe(method(init))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
121    );
122}
123
124/// Methods declared on superclass `NSObject`.
125#[cfg(all(feature = "CXAction", feature = "CXCallAction"))]
126impl CXPlayDTMFCallAction {
127    extern_methods!(
128        #[unsafe(method(new))]
129        #[unsafe(method_family = new)]
130        pub unsafe fn new() -> Retained<Self>;
131    );
132}