objc2_contacts/generated/
CNContactProperty.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
9extern_class!(
10    /// Contains related information for a specific contact property.
11    ///
12    ///
13    /// CNContactProperty is used by the CNContactPicker to return the user's selected property.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cncontactproperty?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct CNContactProperty;
19);
20
21extern_conformance!(
22    unsafe impl NSCoding for CNContactProperty {}
23);
24
25extern_conformance!(
26    unsafe impl NSCopying for CNContactProperty {}
27);
28
29unsafe impl CopyingHelper for CNContactProperty {
30    type Result = Self;
31}
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for CNContactProperty {}
35);
36
37extern_conformance!(
38    unsafe impl NSSecureCoding for CNContactProperty {}
39);
40
41impl CNContactProperty {
42    extern_methods!(
43        #[cfg(feature = "CNContact")]
44        #[unsafe(method(contact))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn contact(&self) -> Retained<CNContact>;
47
48        /// The key of the contact property, as defined in CNContact.h.
49        #[unsafe(method(key))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn key(&self) -> Retained<NSString>;
52
53        /// The value of the property.
54        #[unsafe(method(value))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn value(&self) -> Option<Retained<AnyObject>>;
57
58        /// The identifier of the labeled value if the property is an array of labeled values, otherwise is nil.
59        #[unsafe(method(identifier))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;
62
63        /// The label of the labeled value if the property is an array of labeled values, otherwise is nil.
64        #[unsafe(method(label))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn label(&self) -> Option<Retained<NSString>>;
67    );
68}
69
70/// Methods declared on superclass `NSObject`.
71impl CNContactProperty {
72    extern_methods!(
73        #[unsafe(method(init))]
74        #[unsafe(method_family = init)]
75        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
76
77        #[unsafe(method(new))]
78        #[unsafe(method_family = new)]
79        pub unsafe fn new() -> Retained<Self>;
80    );
81}