objc2-map-kit 0.3.2

Bindings to the MapKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkaddressrepresentationscontextstyle?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MKAddressRepresentationsContextStyle(pub NSInteger);
impl MKAddressRepresentationsContextStyle {
    #[doc(alias = "MKAddressRepresentationsContextStyleAutomatic")]
    pub const Automatic: Self = Self(0);
    #[doc(alias = "MKAddressRepresentationsContextStyleShort")]
    pub const Short: Self = Self(1);
    #[doc(alias = "MKAddressRepresentationsContextStyleFull")]
    pub const Full: Self = Self(2);
}

unsafe impl Encode for MKAddressRepresentationsContextStyle {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for MKAddressRepresentationsContextStyle {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkaddressrepresentations?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MKAddressRepresentations;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for MKAddressRepresentations {}
);

impl MKAddressRepresentations {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[unsafe(method(fullAddressIncludingRegion:singleLine:))]
        #[unsafe(method_family = none)]
        pub unsafe fn fullAddressIncludingRegion_singleLine(
            &self,
            including_region: bool,
            single_line: bool,
        ) -> Option<Retained<NSString>>;

        #[unsafe(method(cityName))]
        #[unsafe(method_family = none)]
        pub unsafe fn cityName(&self) -> Option<Retained<NSString>>;

        #[unsafe(method(cityWithContext))]
        #[unsafe(method_family = none)]
        pub unsafe fn cityWithContext(&self) -> Option<Retained<NSString>>;

        #[unsafe(method(cityWithContextUsingStyle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn cityWithContextUsingStyle(
            &self,
            style: MKAddressRepresentationsContextStyle,
        ) -> Option<Retained<NSString>>;

        #[unsafe(method(regionName))]
        #[unsafe(method_family = none)]
        pub unsafe fn regionName(&self) -> Option<Retained<NSString>>;

        #[unsafe(method(regionCode))]
        #[unsafe(method_family = none)]
        pub unsafe fn regionCode(&self) -> Option<Retained<NSString>>;
    );
}