objc2_contacts/generated/
CNPostalAddress.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 postal address.
11    ///
12    ///
13    /// CNPostalAddress is thread safe.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnpostaladdress?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct CNPostalAddress;
19);
20
21unsafe impl NSCoding for CNPostalAddress {}
22
23unsafe impl NSCopying for CNPostalAddress {}
24
25unsafe impl CopyingHelper for CNPostalAddress {
26    type Result = Self;
27}
28
29unsafe impl NSMutableCopying for CNPostalAddress {}
30
31#[cfg(feature = "CNMutablePostalAddress")]
32unsafe impl MutableCopyingHelper for CNPostalAddress {
33    type Result = CNMutablePostalAddress;
34}
35
36unsafe impl NSObjectProtocol for CNPostalAddress {}
37
38unsafe impl NSSecureCoding for CNPostalAddress {}
39
40impl CNPostalAddress {
41    extern_methods!(
42        /// multi-street address is delimited with carriage returns ā€œ
43        /// \nā€
44        #[unsafe(method(street))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn street(&self) -> Retained<NSString>;
47
48        #[unsafe(method(subLocality))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn subLocality(&self) -> Retained<NSString>;
51
52        #[unsafe(method(city))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn city(&self) -> Retained<NSString>;
55
56        #[unsafe(method(subAdministrativeArea))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn subAdministrativeArea(&self) -> Retained<NSString>;
59
60        #[unsafe(method(state))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn state(&self) -> Retained<NSString>;
63
64        #[unsafe(method(postalCode))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn postalCode(&self) -> Retained<NSString>;
67
68        #[unsafe(method(country))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn country(&self) -> Retained<NSString>;
71
72        #[unsafe(method(ISOCountryCode))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn ISOCountryCode(&self) -> Retained<NSString>;
75
76        /// Returns a user displayable property name.
77        #[unsafe(method(localizedStringForKey:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn localizedStringForKey(key: &NSString) -> Retained<NSString>;
80    );
81}
82
83/// Methods declared on superclass `NSObject`.
84impl CNPostalAddress {
85    extern_methods!(
86        #[unsafe(method(init))]
87        #[unsafe(method_family = init)]
88        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
89
90        #[unsafe(method(new))]
91        #[unsafe(method_family = new)]
92        pub unsafe fn new() -> Retained<Self>;
93    );
94}
95
96extern "C" {
97    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnpostaladdressstreetkey?language=objc)
98    pub static CNPostalAddressStreetKey: &'static NSString;
99}
100
101extern "C" {
102    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnpostaladdresssublocalitykey?language=objc)
103    pub static CNPostalAddressSubLocalityKey: &'static NSString;
104}
105
106extern "C" {
107    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnpostaladdresscitykey?language=objc)
108    pub static CNPostalAddressCityKey: &'static NSString;
109}
110
111extern "C" {
112    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnpostaladdresssubadministrativeareakey?language=objc)
113    pub static CNPostalAddressSubAdministrativeAreaKey: &'static NSString;
114}
115
116extern "C" {
117    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnpostaladdressstatekey?language=objc)
118    pub static CNPostalAddressStateKey: &'static NSString;
119}
120
121extern "C" {
122    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnpostaladdresspostalcodekey?language=objc)
123    pub static CNPostalAddressPostalCodeKey: &'static NSString;
124}
125
126extern "C" {
127    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnpostaladdresscountrykey?language=objc)
128    pub static CNPostalAddressCountryKey: &'static NSString;
129}
130
131extern "C" {
132    /// [Apple's documentation](https://developer.apple.com/documentation/contacts/cnpostaladdressisocountrycodekey?language=objc)
133    pub static CNPostalAddressISOCountryCodeKey: &'static NSString;
134}