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