use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct INPersonSuggestionType(pub NSInteger);
impl INPersonSuggestionType {
#[doc(alias = "INPersonSuggestionTypeNone")]
pub const None: Self = Self(0);
#[doc(alias = "INPersonSuggestionTypeSocialProfile")]
pub const SocialProfile: Self = Self(1);
#[doc(alias = "INPersonSuggestionTypeInstantMessageAddress")]
pub const InstantMessageAddress: Self = Self(2);
}
unsafe impl Encode for INPersonSuggestionType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for INPersonSuggestionType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct INPerson;
);
extern_conformance!(
unsafe impl NSCoding for INPerson {}
);
extern_conformance!(
unsafe impl NSCopying for INPerson {}
);
unsafe impl CopyingHelper for INPerson {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for INPerson {}
);
extern_conformance!(
unsafe impl NSSecureCoding for INPerson {}
);
impl INPerson {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(all(feature = "INImage", feature = "INPersonHandle"))]
#[unsafe(method(initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithPersonHandle_nameComponents_displayName_image_contactIdentifier_customIdentifier(
this: Allocated<Self>,
person_handle: &INPersonHandle,
name_components: Option<&NSPersonNameComponents>,
display_name: Option<&NSString>,
image: Option<&INImage>,
contact_identifier: Option<&NSString>,
custom_identifier: Option<&NSString>,
) -> Retained<Self>;
#[cfg(all(
feature = "INImage",
feature = "INPersonHandle",
feature = "INPersonRelationship"
))]
#[unsafe(method(initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:relationship:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithPersonHandle_nameComponents_displayName_image_contactIdentifier_customIdentifier_relationship(
this: Allocated<Self>,
person_handle: &INPersonHandle,
name_components: Option<&NSPersonNameComponents>,
display_name: Option<&NSString>,
image: Option<&INImage>,
contact_identifier: Option<&NSString>,
custom_identifier: Option<&NSString>,
relationship: Option<&INPersonRelationship>,
) -> Retained<Self>;
#[cfg(all(feature = "INImage", feature = "INPersonHandle"))]
#[unsafe(method(initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:isMe:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithPersonHandle_nameComponents_displayName_image_contactIdentifier_customIdentifier_isMe(
this: Allocated<Self>,
person_handle: &INPersonHandle,
name_components: Option<&NSPersonNameComponents>,
display_name: Option<&NSString>,
image: Option<&INImage>,
contact_identifier: Option<&NSString>,
custom_identifier: Option<&NSString>,
is_me: bool,
) -> Retained<Self>;
#[cfg(all(feature = "INImage", feature = "INPersonHandle"))]
#[unsafe(method(initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:isMe:suggestionType:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithPersonHandle_nameComponents_displayName_image_contactIdentifier_customIdentifier_isMe_suggestionType(
this: Allocated<Self>,
person_handle: &INPersonHandle,
name_components: Option<&NSPersonNameComponents>,
display_name: Option<&NSString>,
image: Option<&INImage>,
contact_identifier: Option<&NSString>,
custom_identifier: Option<&NSString>,
is_me: bool,
suggestion_type: INPersonSuggestionType,
) -> Retained<Self>;
#[cfg(all(feature = "INImage", feature = "INPersonHandle"))]
#[unsafe(method(initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:isContactSuggestion:suggestionType:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithPersonHandle_nameComponents_displayName_image_contactIdentifier_customIdentifier_isContactSuggestion_suggestionType(
this: Allocated<Self>,
person_handle: &INPersonHandle,
name_components: Option<&NSPersonNameComponents>,
display_name: Option<&NSString>,
image: Option<&INImage>,
contact_identifier: Option<&NSString>,
custom_identifier: Option<&NSString>,
is_contact_suggestion: bool,
suggestion_type: INPersonSuggestionType,
) -> Retained<Self>;
#[cfg(feature = "INPersonHandle")]
#[unsafe(method(personHandle))]
#[unsafe(method_family = none)]
pub unsafe fn personHandle(&self) -> Option<Retained<INPersonHandle>>;
#[unsafe(method(nameComponents))]
#[unsafe(method_family = none)]
pub unsafe fn nameComponents(&self) -> Option<Retained<NSPersonNameComponents>>;
#[unsafe(method(displayName))]
#[unsafe(method_family = none)]
pub unsafe fn displayName(&self) -> Retained<NSString>;
#[cfg(feature = "INImage")]
#[unsafe(method(image))]
#[unsafe(method_family = none)]
pub unsafe fn image(&self) -> Option<Retained<INImage>>;
#[unsafe(method(contactIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn contactIdentifier(&self) -> Option<Retained<NSString>>;
#[unsafe(method(customIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn customIdentifier(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "INPersonRelationship")]
#[unsafe(method(relationship))]
#[unsafe(method_family = none)]
pub unsafe fn relationship(&self) -> Option<Retained<INPersonRelationship>>;
#[unsafe(method(isContactSuggestion))]
#[unsafe(method_family = none)]
pub unsafe fn isContactSuggestion(&self) -> bool;
);
}
impl INPerson {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
impl INPerson {
extern_methods!(
#[cfg(feature = "INPersonHandle")]
#[unsafe(method(aliases))]
#[unsafe(method_family = none)]
pub unsafe fn aliases(&self) -> Option<Retained<NSArray<INPersonHandle>>>;
#[unsafe(method(suggestionType))]
#[unsafe(method_family = none)]
pub unsafe fn suggestionType(&self) -> INPersonSuggestionType;
#[cfg(all(feature = "INImage", feature = "INPersonHandle"))]
#[unsafe(method(initWithPersonHandle:nameComponents:displayName:image:contactIdentifier:customIdentifier:aliases:suggestionType:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithPersonHandle_nameComponents_displayName_image_contactIdentifier_customIdentifier_aliases_suggestionType(
this: Allocated<Self>,
person_handle: &INPersonHandle,
name_components: Option<&NSPersonNameComponents>,
display_name: Option<&NSString>,
image: Option<&INImage>,
contact_identifier: Option<&NSString>,
custom_identifier: Option<&NSString>,
aliases: Option<&NSArray<INPersonHandle>>,
suggestion_type: INPersonSuggestionType,
) -> Retained<Self>;
);
}