objc2_intents/generated/
INPerson.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 INPersonSuggestionType(pub NSInteger);
14impl INPersonSuggestionType {
15 #[doc(alias = "INPersonSuggestionTypeNone")]
16 pub const None: Self = Self(0);
17 #[doc(alias = "INPersonSuggestionTypeSocialProfile")]
18 pub const SocialProfile: Self = Self(1);
19 #[doc(alias = "INPersonSuggestionTypeInstantMessageAddress")]
20 pub const InstantMessageAddress: Self = Self(2);
21}
22
23unsafe impl Encode for INPersonSuggestionType {
24 const ENCODING: Encoding = NSInteger::ENCODING;
25}
26
27unsafe impl RefEncode for INPersonSuggestionType {
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 INPerson;
36);
37
38extern_conformance!(
39 unsafe impl NSCoding for INPerson {}
40);
41
42extern_conformance!(
43 unsafe impl NSCopying for INPerson {}
44);
45
46unsafe impl CopyingHelper for INPerson {
47 type Result = Self;
48}
49
50extern_conformance!(
51 unsafe impl NSObjectProtocol for INPerson {}
52);
53
54extern_conformance!(
55 unsafe impl NSSecureCoding for INPerson {}
56);
57
58impl INPerson {
59 extern_methods!(
60 #[unsafe(method(init))]
61 #[unsafe(method_family = init)]
62 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
63
64 #[cfg(all(feature = "INImage", feature = "INPersonHandle"))]
65 #[unsafe(method(initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:))]
66 #[unsafe(method_family = init)]
67 pub unsafe fn initWithPersonHandle_nameComponents_displayName_image_contactIdentifier_customIdentifier(
68 this: Allocated<Self>,
69 person_handle: &INPersonHandle,
70 name_components: Option<&NSPersonNameComponents>,
71 display_name: Option<&NSString>,
72 image: Option<&INImage>,
73 contact_identifier: Option<&NSString>,
74 custom_identifier: Option<&NSString>,
75 ) -> Retained<Self>;
76
77 #[cfg(all(
78 feature = "INImage",
79 feature = "INPersonHandle",
80 feature = "INPersonRelationship"
81 ))]
82 #[unsafe(method(initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:relationship:))]
83 #[unsafe(method_family = init)]
84 pub unsafe fn initWithPersonHandle_nameComponents_displayName_image_contactIdentifier_customIdentifier_relationship(
85 this: Allocated<Self>,
86 person_handle: &INPersonHandle,
87 name_components: Option<&NSPersonNameComponents>,
88 display_name: Option<&NSString>,
89 image: Option<&INImage>,
90 contact_identifier: Option<&NSString>,
91 custom_identifier: Option<&NSString>,
92 relationship: Option<&INPersonRelationship>,
93 ) -> Retained<Self>;
94
95 #[cfg(all(feature = "INImage", feature = "INPersonHandle"))]
96 #[unsafe(method(initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:isMe:))]
97 #[unsafe(method_family = init)]
98 pub unsafe fn initWithPersonHandle_nameComponents_displayName_image_contactIdentifier_customIdentifier_isMe(
99 this: Allocated<Self>,
100 person_handle: &INPersonHandle,
101 name_components: Option<&NSPersonNameComponents>,
102 display_name: Option<&NSString>,
103 image: Option<&INImage>,
104 contact_identifier: Option<&NSString>,
105 custom_identifier: Option<&NSString>,
106 is_me: bool,
107 ) -> Retained<Self>;
108
109 #[cfg(all(feature = "INImage", feature = "INPersonHandle"))]
110 #[unsafe(method(initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:isMe:suggestionType:))]
111 #[unsafe(method_family = init)]
112 pub unsafe fn initWithPersonHandle_nameComponents_displayName_image_contactIdentifier_customIdentifier_isMe_suggestionType(
113 this: Allocated<Self>,
114 person_handle: &INPersonHandle,
115 name_components: Option<&NSPersonNameComponents>,
116 display_name: Option<&NSString>,
117 image: Option<&INImage>,
118 contact_identifier: Option<&NSString>,
119 custom_identifier: Option<&NSString>,
120 is_me: bool,
121 suggestion_type: INPersonSuggestionType,
122 ) -> Retained<Self>;
123
124 #[cfg(all(feature = "INImage", feature = "INPersonHandle"))]
125 #[unsafe(method(initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:isContactSuggestion:suggestionType:))]
126 #[unsafe(method_family = init)]
127 pub unsafe fn initWithPersonHandle_nameComponents_displayName_image_contactIdentifier_customIdentifier_isContactSuggestion_suggestionType(
128 this: Allocated<Self>,
129 person_handle: &INPersonHandle,
130 name_components: Option<&NSPersonNameComponents>,
131 display_name: Option<&NSString>,
132 image: Option<&INImage>,
133 contact_identifier: Option<&NSString>,
134 custom_identifier: Option<&NSString>,
135 is_contact_suggestion: bool,
136 suggestion_type: INPersonSuggestionType,
137 ) -> Retained<Self>;
138
139 #[cfg(feature = "INPersonHandle")]
140 #[unsafe(method(personHandle))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn personHandle(&self) -> Option<Retained<INPersonHandle>>;
143
144 #[unsafe(method(nameComponents))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn nameComponents(&self) -> Option<Retained<NSPersonNameComponents>>;
147
148 #[unsafe(method(displayName))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn displayName(&self) -> Retained<NSString>;
151
152 #[cfg(feature = "INImage")]
153 #[unsafe(method(image))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn image(&self) -> Option<Retained<INImage>>;
156
157 #[unsafe(method(contactIdentifier))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn contactIdentifier(&self) -> Option<Retained<NSString>>;
160
161 #[unsafe(method(customIdentifier))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn customIdentifier(&self) -> Option<Retained<NSString>>;
164
165 #[cfg(feature = "INPersonRelationship")]
166 #[unsafe(method(relationship))]
167 #[unsafe(method_family = none)]
168 pub unsafe fn relationship(&self) -> Option<Retained<INPersonRelationship>>;
169
170 #[unsafe(method(isContactSuggestion))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn isContactSuggestion(&self) -> bool;
173 );
174}
175
176impl INPerson {
178 extern_methods!(
179 #[unsafe(method(new))]
180 #[unsafe(method_family = new)]
181 pub unsafe fn new() -> Retained<Self>;
182 );
183}
184
185impl INPerson {
187 extern_methods!(
188 #[cfg(feature = "INPersonHandle")]
189 #[unsafe(method(aliases))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn aliases(&self) -> Option<Retained<NSArray<INPersonHandle>>>;
192
193 #[unsafe(method(suggestionType))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn suggestionType(&self) -> INPersonSuggestionType;
196
197 #[cfg(all(feature = "INImage", feature = "INPersonHandle"))]
198 #[unsafe(method(initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:aliases:suggestionType:))]
199 #[unsafe(method_family = init)]
200 pub unsafe fn initWithPersonHandle_nameComponents_displayName_image_contactIdentifier_customIdentifier_aliases_suggestionType(
201 this: Allocated<Self>,
202 person_handle: &INPersonHandle,
203 name_components: Option<&NSPersonNameComponents>,
204 display_name: Option<&NSString>,
205 image: Option<&INImage>,
206 contact_identifier: Option<&NSString>,
207 custom_identifier: Option<&NSString>,
208 aliases: Option<&NSArray<INPersonHandle>>,
209 suggestion_type: INPersonSuggestionType,
210 ) -> Retained<Self>;
211 );
212}