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
38unsafe impl NSCoding for CXHandle {}
39
40unsafe impl NSCopying for CXHandle {}
41
42unsafe impl CopyingHelper for CXHandle {
43    type Result = Self;
44}
45
46unsafe impl NSObjectProtocol for CXHandle {}
47
48unsafe impl NSSecureCoding for CXHandle {}
49
50impl CXHandle {
51    extern_methods!(
52        #[unsafe(method(type))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn r#type(&self) -> CXHandleType;
55
56        #[unsafe(method(value))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn value(&self) -> Retained<NSString>;
59
60        #[unsafe(method(initWithType:value:))]
61        #[unsafe(method_family = init)]
62        pub unsafe fn initWithType_value(
63            this: Allocated<Self>,
64            r#type: CXHandleType,
65            value: &NSString,
66        ) -> Retained<Self>;
67
68        #[unsafe(method(init))]
69        #[unsafe(method_family = init)]
70        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
71
72        #[unsafe(method(isEqualToHandle:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn isEqualToHandle(&self, handle: &CXHandle) -> bool;
75    );
76}
77
78/// Methods declared on superclass `NSObject`.
79impl CXHandle {
80    extern_methods!(
81        #[unsafe(method(new))]
82        #[unsafe(method_family = new)]
83        pub unsafe fn new() -> Retained<Self>;
84    );
85}