use crate::common::*;
use crate::Contacts::*;
use crate::Foundation::*;
ns_enum!(
#[underlying(NSInteger)]
pub enum CNPostalAddressFormatterStyle {
CNPostalAddressFormatterStyleMailingAddress = 0,
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "Contacts_CNPostalAddressFormatter")]
pub struct CNPostalAddressFormatter;
#[cfg(feature = "Contacts_CNPostalAddressFormatter")]
unsafe impl ClassType for CNPostalAddressFormatter {
#[inherits(NSObject)]
type Super = NSFormatter;
type Mutability = InteriorMutable;
}
);
#[cfg(feature = "Contacts_CNPostalAddressFormatter")]
unsafe impl NSCoding for CNPostalAddressFormatter {}
#[cfg(feature = "Contacts_CNPostalAddressFormatter")]
unsafe impl NSCopying for CNPostalAddressFormatter {}
#[cfg(feature = "Contacts_CNPostalAddressFormatter")]
unsafe impl NSObjectProtocol for CNPostalAddressFormatter {}
extern_methods!(
#[cfg(feature = "Contacts_CNPostalAddressFormatter")]
unsafe impl CNPostalAddressFormatter {
#[cfg(all(feature = "Contacts_CNPostalAddress", feature = "Foundation_NSString"))]
#[method_id(@__retain_semantics Other stringFromPostalAddress:style:)]
pub unsafe fn stringFromPostalAddress_style(
postal_address: &CNPostalAddress,
style: CNPostalAddressFormatterStyle,
) -> Id<NSString>;
#[cfg(all(
feature = "Contacts_CNPostalAddress",
feature = "Foundation_NSAttributedString",
feature = "Foundation_NSDictionary"
))]
#[method_id(@__retain_semantics Other attributedStringFromPostalAddress:style:withDefaultAttributes:)]
pub unsafe fn attributedStringFromPostalAddress_style_withDefaultAttributes(
postal_address: &CNPostalAddress,
style: CNPostalAddressFormatterStyle,
attributes: &NSDictionary,
) -> Id<NSAttributedString>;
#[method(style)]
pub unsafe fn style(&self) -> CNPostalAddressFormatterStyle;
#[method(setStyle:)]
pub unsafe fn setStyle(&self, style: CNPostalAddressFormatterStyle);
#[cfg(all(feature = "Contacts_CNPostalAddress", feature = "Foundation_NSString"))]
#[method_id(@__retain_semantics Other stringFromPostalAddress:)]
pub unsafe fn stringFromPostalAddress(
&self,
postal_address: &CNPostalAddress,
) -> Id<NSString>;
#[cfg(all(
feature = "Contacts_CNPostalAddress",
feature = "Foundation_NSAttributedString",
feature = "Foundation_NSDictionary"
))]
#[method_id(@__retain_semantics Other attributedStringFromPostalAddress:withDefaultAttributes:)]
pub unsafe fn attributedStringFromPostalAddress_withDefaultAttributes(
&self,
postal_address: &CNPostalAddress,
attributes: &NSDictionary,
) -> Id<NSAttributedString>;
}
);
extern_methods!(
#[cfg(feature = "Contacts_CNPostalAddressFormatter")]
unsafe impl CNPostalAddressFormatter {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self>;
}
);
extern_static!(CNPostalAddressPropertyAttribute: &'static NSString);
extern_static!(CNPostalAddressLocalizedPropertyNameAttribute: &'static NSString);