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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkstandardmapemphasisstyle?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MKStandardMapEmphasisStyle(pub NSInteger);
impl MKStandardMapEmphasisStyle {
    #[doc(alias = "MKStandardMapEmphasisStyleDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "MKStandardMapEmphasisStyleMuted")]
    pub const Muted: Self = Self(1);
}

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

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

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

#[cfg(feature = "MKMapConfiguration")]
extern_conformance!(
    unsafe impl NSCoding for MKStandardMapConfiguration {}
);

#[cfg(feature = "MKMapConfiguration")]
extern_conformance!(
    unsafe impl NSCopying for MKStandardMapConfiguration {}
);

#[cfg(feature = "MKMapConfiguration")]
unsafe impl CopyingHelper for MKStandardMapConfiguration {
    type Result = Self;
}

#[cfg(feature = "MKMapConfiguration")]
extern_conformance!(
    unsafe impl NSObjectProtocol for MKStandardMapConfiguration {}
);

#[cfg(feature = "MKMapConfiguration")]
extern_conformance!(
    unsafe impl NSSecureCoding for MKStandardMapConfiguration {}
);

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

        #[unsafe(method(initWithElevationStyle:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithElevationStyle(
            this: Allocated<Self>,
            elevation_style: MKMapElevationStyle,
        ) -> Retained<Self>;

        #[unsafe(method(initWithElevationStyle:emphasisStyle:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithElevationStyle_emphasisStyle(
            this: Allocated<Self>,
            elevation_style: MKMapElevationStyle,
            emphasis_style: MKStandardMapEmphasisStyle,
        ) -> Retained<Self>;

        #[unsafe(method(initWithEmphasisStyle:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithEmphasisStyle(
            this: Allocated<Self>,
            emphasis_style: MKStandardMapEmphasisStyle,
        ) -> Retained<Self>;

        #[unsafe(method(emphasisStyle))]
        #[unsafe(method_family = none)]
        pub unsafe fn emphasisStyle(&self) -> MKStandardMapEmphasisStyle;

        /// Setter for [`emphasisStyle`][Self::emphasisStyle].
        #[unsafe(method(setEmphasisStyle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setEmphasisStyle(&self, emphasis_style: MKStandardMapEmphasisStyle);

        #[cfg(feature = "MKPointOfInterestFilter")]
        #[unsafe(method(pointOfInterestFilter))]
        #[unsafe(method_family = none)]
        pub unsafe fn pointOfInterestFilter(&self) -> Option<Retained<MKPointOfInterestFilter>>;

        #[cfg(feature = "MKPointOfInterestFilter")]
        /// Setter for [`pointOfInterestFilter`][Self::pointOfInterestFilter].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setPointOfInterestFilter:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPointOfInterestFilter(
            &self,
            point_of_interest_filter: Option<&MKPointOfInterestFilter>,
        );

        #[unsafe(method(showsTraffic))]
        #[unsafe(method_family = none)]
        pub unsafe fn showsTraffic(&self) -> bool;

        /// Setter for [`showsTraffic`][Self::showsTraffic].
        #[unsafe(method(setShowsTraffic:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShowsTraffic(&self, shows_traffic: bool);
    );
}

/// Methods declared on superclass `MKMapConfiguration`.
#[cfg(feature = "MKMapConfiguration")]
impl MKStandardMapConfiguration {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}