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::*;
#[cfg(feature = "objc2-core-location")]
use objc2_core_location::*;
use objc2_foundation::*;

use crate::*;

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

#[cfg(all(
    feature = "MKAnnotation",
    feature = "MKMultiPoint",
    feature = "MKShape"
))]
extern_conformance!(
    unsafe impl MKAnnotation for MKPolygon {}
);

#[cfg(all(
    feature = "MKAnnotation",
    feature = "MKMultiPoint",
    feature = "MKOverlay",
    feature = "MKShape"
))]
extern_conformance!(
    unsafe impl MKOverlay for MKPolygon {}
);

#[cfg(all(feature = "MKMultiPoint", feature = "MKShape"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for MKPolygon {}
);

#[cfg(all(feature = "MKMultiPoint", feature = "MKShape"))]
impl MKPolygon {
    extern_methods!(
        #[cfg(feature = "MKGeometry")]
        /// # Safety
        ///
        /// `points` must be a valid pointer.
        #[unsafe(method(polygonWithPoints:count:))]
        #[unsafe(method_family = none)]
        pub unsafe fn polygonWithPoints_count(
            points: NonNull<MKMapPoint>,
            count: NSUInteger,
        ) -> Retained<Self>;

        #[cfg(feature = "MKGeometry")]
        /// # Safety
        ///
        /// `points` must be a valid pointer.
        #[unsafe(method(polygonWithPoints:count:interiorPolygons:))]
        #[unsafe(method_family = none)]
        pub unsafe fn polygonWithPoints_count_interiorPolygons(
            points: NonNull<MKMapPoint>,
            count: NSUInteger,
            interior_polygons: Option<&NSArray<MKPolygon>>,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-location")]
        /// # Safety
        ///
        /// `coords` must be a valid pointer.
        #[unsafe(method(polygonWithCoordinates:count:))]
        #[unsafe(method_family = none)]
        pub unsafe fn polygonWithCoordinates_count(
            coords: NonNull<CLLocationCoordinate2D>,
            count: NSUInteger,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-location")]
        /// # Safety
        ///
        /// `coords` must be a valid pointer.
        #[unsafe(method(polygonWithCoordinates:count:interiorPolygons:))]
        #[unsafe(method_family = none)]
        pub unsafe fn polygonWithCoordinates_count_interiorPolygons(
            coords: NonNull<CLLocationCoordinate2D>,
            count: NSUInteger,
            interior_polygons: Option<&NSArray<MKPolygon>>,
        ) -> Retained<Self>;

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

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "MKMultiPoint", feature = "MKShape"))]
impl MKPolygon {
    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>;
    );
}