objc2_call_kit/generated/
CXHandle.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxhandletype?language=objc)
10// NS_ENUM
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct CXHandleType(pub NSInteger);
14impl CXHandleType {
15    #[doc(alias = "CXHandleTypeGeneric")]
16    pub const Generic: Self = Self(1);
17    #[doc(alias = "CXHandleTypePhoneNumber")]
18    pub const PhoneNumber: Self = Self(2);
19    #[doc(alias = "CXHandleTypeEmailAddress")]
20    pub const EmailAddress: Self = Self(3);
21}
22
23unsafe impl Encode for CXHandleType {
24    const ENCODING: Encoding = NSInteger::ENCODING;
25}
26
27unsafe impl RefEncode for CXHandleType {
28    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
29}
30
31extern_class!(
32    /// [Apple's documentation](https://developer.apple.com/documentation/callkit/cxhandle?language=objc)
33    #[unsafe(super(NSObject))]
34    #[derive(Debug, PartialEq, Eq, Hash)]
35    pub struct CXHandle;
36);
37
38extern_conformance!(
39    unsafe impl NSCoding for CXHandle {}
40);
41
42extern_conformance!(
43    unsafe impl NSCopying for CXHandle {}
44);
45
46unsafe impl CopyingHelper for CXHandle {
47    type Result = Self;
48}
49
50extern_conformance!(
51    unsafe impl NSObjectProtocol for CXHandle {}
52);
53
54extern_conformance!(
55    unsafe impl NSSecureCoding for CXHandle {}
56);
57
58impl CXHandle {
59    extern_methods!(
60        #[unsafe(method(type))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn r#type(&self) -> CXHandleType;
63
64        #[unsafe(method(value))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn value(&self) -> Retained<NSString>;
67
68        #[unsafe(method(initWithType:value:))]
69        #[unsafe(method_family = init)]
70        pub unsafe fn initWithType_value(
71            this: Allocated<Self>,
72            r#type: CXHandleType,
73            value: &NSString,
74        ) -> Retained<Self>;
75
76        #[unsafe(method(init))]
77        #[unsafe(method_family = init)]
78        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
79
80        #[unsafe(method(isEqualToHandle:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn isEqualToHandle(&self, handle: &CXHandle) -> bool;
83    );
84}
85
86/// Methods declared on superclass `NSObject`.
87impl CXHandle {
88    extern_methods!(
89        #[unsafe(method(new))]
90        #[unsafe(method_family = new)]
91        pub unsafe fn new() -> Retained<Self>;
92    );
93}