objc2_contacts/generated/
CNPhoneNumber.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    /// An immutable value object representing a phone number.
11    ///
12    ///
13    /// CNPhoneNumber is thread safe.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnphonenumber?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct CNPhoneNumber;
19);
20
21extern_conformance!(
22    unsafe impl NSCoding for CNPhoneNumber {}
23);
24
25extern_conformance!(
26    unsafe impl NSCopying for CNPhoneNumber {}
27);
28
29unsafe impl CopyingHelper for CNPhoneNumber {
30    type Result = Self;
31}
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for CNPhoneNumber {}
35);
36
37extern_conformance!(
38    unsafe impl NSSecureCoding for CNPhoneNumber {}
39);
40
41impl CNPhoneNumber {
42    extern_methods!(
43        /// These will return nil if the stringValue is nil.
44        #[unsafe(method(phoneNumberWithStringValue:))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn phoneNumberWithStringValue(string_value: &NSString)
47            -> Option<Retained<Self>>;
48
49        #[unsafe(method(initWithStringValue:))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn initWithStringValue(
52            this: Allocated<Self>,
53            string: &NSString,
54        ) -> Retained<CNPhoneNumber>;
55
56        #[deprecated = "Use initWithStringValue:"]
57        #[unsafe(method(init))]
58        #[unsafe(method_family = init)]
59        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
60
61        #[deprecated = "Use phoneNumberWithStringValue:"]
62        #[unsafe(method(new))]
63        #[unsafe(method_family = new)]
64        pub unsafe fn new() -> Retained<Self>;
65
66        #[unsafe(method(stringValue))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn stringValue(&self) -> Retained<NSString>;
69    );
70}
71
72extern "C" {
73    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnlabelphonenumberiphone?language=objc)
74    pub static CNLabelPhoneNumberiPhone: &'static NSString;
75}
76
77extern "C" {
78    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnlabelphonenumberapplewatch?language=objc)
79    pub static CNLabelPhoneNumberAppleWatch: &'static NSString;
80}
81
82extern "C" {
83    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnlabelphonenumbermobile?language=objc)
84    pub static CNLabelPhoneNumberMobile: &'static NSString;
85}
86
87extern "C" {
88    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnlabelphonenumbermain?language=objc)
89    pub static CNLabelPhoneNumberMain: &'static NSString;
90}
91
92extern "C" {
93    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnlabelphonenumberhomefax?language=objc)
94    pub static CNLabelPhoneNumberHomeFax: &'static NSString;
95}
96
97extern "C" {
98    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnlabelphonenumberworkfax?language=objc)
99    pub static CNLabelPhoneNumberWorkFax: &'static NSString;
100}
101
102extern "C" {
103    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnlabelphonenumberotherfax?language=objc)
104    pub static CNLabelPhoneNumberOtherFax: &'static NSString;
105}
106
107extern "C" {
108    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnlabelphonenumberpager?language=objc)
109    pub static CNLabelPhoneNumberPager: &'static NSString;
110}