objc2_contacts/generated/
CNMutablePostalAddress.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// A mutable value object representing a postal address.
12    ///
13    ///
14    /// CNMutablePostalAddress is not thread safe.
15    ///
16    ///
17    /// Note: To remove properties when saving a mutable postal address, set string properties to empty values.
18    ///
19    /// See also [Apple's documentation](https://developer.apple.com/documentation/contacts/cnmutablepostaladdress?language=objc)
20    #[unsafe(super(CNPostalAddress, NSObject))]
21    #[derive(Debug, PartialEq, Eq, Hash)]
22    #[cfg(feature = "CNPostalAddress")]
23    pub struct CNMutablePostalAddress;
24);
25
26#[cfg(feature = "CNPostalAddress")]
27extern_conformance!(
28    unsafe impl NSCoding for CNMutablePostalAddress {}
29);
30
31#[cfg(feature = "CNPostalAddress")]
32extern_conformance!(
33    unsafe impl NSCopying for CNMutablePostalAddress {}
34);
35
36#[cfg(feature = "CNPostalAddress")]
37unsafe impl CopyingHelper for CNMutablePostalAddress {
38    type Result = CNPostalAddress;
39}
40
41#[cfg(feature = "CNPostalAddress")]
42extern_conformance!(
43    unsafe impl NSMutableCopying for CNMutablePostalAddress {}
44);
45
46#[cfg(feature = "CNPostalAddress")]
47unsafe impl MutableCopyingHelper for CNMutablePostalAddress {
48    type Result = Self;
49}
50
51#[cfg(feature = "CNPostalAddress")]
52extern_conformance!(
53    unsafe impl NSObjectProtocol for CNMutablePostalAddress {}
54);
55
56#[cfg(feature = "CNPostalAddress")]
57extern_conformance!(
58    unsafe impl NSSecureCoding for CNMutablePostalAddress {}
59);
60
61#[cfg(feature = "CNPostalAddress")]
62impl CNMutablePostalAddress {
63    extern_methods!(
64        /// multi-street address is delimited with carriage returns ā€œ
65        /// \nā€
66        #[unsafe(method(street))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn street(&self) -> Retained<NSString>;
69
70        /// Setter for [`street`][Self::street].
71        ///
72        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
73        #[unsafe(method(setStreet:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn setStreet(&self, street: &NSString);
76
77        #[unsafe(method(subLocality))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn subLocality(&self) -> Retained<NSString>;
80
81        /// Setter for [`subLocality`][Self::subLocality].
82        ///
83        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
84        #[unsafe(method(setSubLocality:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setSubLocality(&self, sub_locality: &NSString);
87
88        #[unsafe(method(city))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn city(&self) -> Retained<NSString>;
91
92        /// Setter for [`city`][Self::city].
93        ///
94        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
95        #[unsafe(method(setCity:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn setCity(&self, city: &NSString);
98
99        #[unsafe(method(subAdministrativeArea))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn subAdministrativeArea(&self) -> Retained<NSString>;
102
103        /// Setter for [`subAdministrativeArea`][Self::subAdministrativeArea].
104        ///
105        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
106        #[unsafe(method(setSubAdministrativeArea:))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn setSubAdministrativeArea(&self, sub_administrative_area: &NSString);
109
110        #[unsafe(method(state))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn state(&self) -> Retained<NSString>;
113
114        /// Setter for [`state`][Self::state].
115        ///
116        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
117        #[unsafe(method(setState:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn setState(&self, state: &NSString);
120
121        #[unsafe(method(postalCode))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn postalCode(&self) -> Retained<NSString>;
124
125        /// Setter for [`postalCode`][Self::postalCode].
126        ///
127        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
128        #[unsafe(method(setPostalCode:))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn setPostalCode(&self, postal_code: &NSString);
131
132        #[unsafe(method(country))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn country(&self) -> Retained<NSString>;
135
136        /// Setter for [`country`][Self::country].
137        ///
138        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
139        #[unsafe(method(setCountry:))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn setCountry(&self, country: &NSString);
142
143        #[unsafe(method(ISOCountryCode))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn ISOCountryCode(&self) -> Retained<NSString>;
146
147        /// Setter for [`ISOCountryCode`][Self::ISOCountryCode].
148        ///
149        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
150        #[unsafe(method(setISOCountryCode:))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn setISOCountryCode(&self, iso_country_code: &NSString);
153    );
154}
155
156/// Methods declared on superclass `NSObject`.
157#[cfg(feature = "CNPostalAddress")]
158impl CNMutablePostalAddress {
159    extern_methods!(
160        #[unsafe(method(init))]
161        #[unsafe(method_family = init)]
162        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
163
164        #[unsafe(method(new))]
165        #[unsafe(method_family = new)]
166        pub unsafe fn new() -> Retained<Self>;
167    );
168}