objc2_intents/generated/
INPersonHandle.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct INPersonHandleType(pub NSInteger);
14impl INPersonHandleType {
15 #[doc(alias = "INPersonHandleTypeUnknown")]
16 pub const Unknown: Self = Self(0);
17 #[doc(alias = "INPersonHandleTypeEmailAddress")]
18 pub const EmailAddress: Self = Self(1);
19 #[doc(alias = "INPersonHandleTypePhoneNumber")]
20 pub const PhoneNumber: Self = Self(2);
21}
22
23unsafe impl Encode for INPersonHandleType {
24 const ENCODING: Encoding = NSInteger::ENCODING;
25}
26
27unsafe impl RefEncode for INPersonHandleType {
28 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
29}
30
31extern_class!(
32 #[unsafe(super(NSObject))]
34 #[derive(Debug, PartialEq, Eq, Hash)]
35 pub struct INPersonHandle;
36);
37
38extern_conformance!(
39 unsafe impl NSCoding for INPersonHandle {}
40);
41
42extern_conformance!(
43 unsafe impl NSCopying for INPersonHandle {}
44);
45
46unsafe impl CopyingHelper for INPersonHandle {
47 type Result = Self;
48}
49
50extern_conformance!(
51 unsafe impl NSObjectProtocol for INPersonHandle {}
52);
53
54extern_conformance!(
55 unsafe impl NSSecureCoding for INPersonHandle {}
56);
57
58impl INPersonHandle {
59 extern_methods!(
60 #[unsafe(method(value))]
61 #[unsafe(method_family = none)]
62 pub unsafe fn value(&self) -> Option<Retained<NSString>>;
63
64 #[unsafe(method(type))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn r#type(&self) -> INPersonHandleType;
67
68 #[cfg(feature = "INPersonHandleLabel")]
69 #[unsafe(method(label))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn label(&self) -> Option<Retained<INPersonHandleLabel>>;
72
73 #[unsafe(method(init))]
74 #[unsafe(method_family = init)]
75 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
76
77 #[cfg(feature = "INPersonHandleLabel")]
78 #[unsafe(method(initWithValue:type:label:))]
79 #[unsafe(method_family = init)]
80 pub unsafe fn initWithValue_type_label(
81 this: Allocated<Self>,
82 value: Option<&NSString>,
83 r#type: INPersonHandleType,
84 label: Option<&INPersonHandleLabel>,
85 ) -> Retained<Self>;
86
87 #[unsafe(method(initWithValue:type:))]
88 #[unsafe(method_family = init)]
89 pub unsafe fn initWithValue_type(
90 this: Allocated<Self>,
91 value: Option<&NSString>,
92 r#type: INPersonHandleType,
93 ) -> Retained<Self>;
94 );
95}
96
97impl INPersonHandle {
99 extern_methods!(
100 #[unsafe(method(new))]
101 #[unsafe(method_family = new)]
102 pub unsafe fn new() -> Retained<Self>;
103 );
104}