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::*;

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkgeojsonobject?language=objc)
    pub unsafe trait MKGeoJSONObject: NSObjectProtocol {}
);

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

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

impl MKGeoJSONDecoder {
    extern_methods!(
        #[unsafe(method(geoJSONObjectsWithData:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn geoJSONObjectsWithData_error(
            &self,
            data: &NSData,
        ) -> Result<Retained<NSArray<ProtocolObject<dyn MKGeoJSONObject>>>, Retained<NSError>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl MKGeoJSONDecoder {
    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>;
    );
}

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

extern_conformance!(
    unsafe impl MKGeoJSONObject for MKGeoJSONFeature {}
);

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

impl MKGeoJSONFeature {
    extern_methods!(
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;

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

        #[cfg(feature = "MKShape")]
        #[unsafe(method(geometry))]
        #[unsafe(method_family = none)]
        pub unsafe fn geometry(&self) -> Retained<NSArray<MKShape>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl MKGeoJSONFeature {
    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>;
    );
}

/// MKGeoJSONSerialization.
#[cfg(all(feature = "MKPointAnnotation", feature = "MKShape"))]
impl MKPointAnnotation {
    extern_methods!();
}

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

/// MKGeoJSONSerialization.
#[cfg(all(feature = "MKMultiPoint", feature = "MKShape"))]
impl MKMultiPoint {
    extern_methods!();
}

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

/// MKGeoJSONSerialization.
#[cfg(all(feature = "MKMultiPolyline", feature = "MKShape"))]
impl MKMultiPolyline {
    extern_methods!();
}

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

/// MKGeoJSONSerialization.
#[cfg(all(feature = "MKMultiPolygon", feature = "MKShape"))]
impl MKMultiPolygon {
    extern_methods!();
}

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

/// MKGeoJSONSerialization.
#[cfg(all(feature = "MKMultiPoint", feature = "MKPolyline", feature = "MKShape"))]
impl MKPolyline {
    extern_methods!();
}

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

/// MKGeoJSONSerialization.
#[cfg(all(feature = "MKMultiPoint", feature = "MKPolygon", feature = "MKShape"))]
impl MKPolygon {
    extern_methods!();
}

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