use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
pub unsafe trait MKGeoJSONObject: NSObjectProtocol {}
);
extern_class!(
#[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>>;
);
}
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!(
#[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>>;
);
}
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>;
);
}
#[cfg(all(feature = "MKPointAnnotation", feature = "MKShape"))]
impl MKPointAnnotation {
extern_methods!();
}
#[cfg(all(feature = "MKPointAnnotation", feature = "MKShape"))]
extern_conformance!(
unsafe impl MKGeoJSONObject for MKPointAnnotation {}
);
#[cfg(all(feature = "MKMultiPoint", feature = "MKShape"))]
impl MKMultiPoint {
extern_methods!();
}
#[cfg(all(feature = "MKMultiPoint", feature = "MKShape"))]
extern_conformance!(
unsafe impl MKGeoJSONObject for MKMultiPoint {}
);
#[cfg(all(feature = "MKMultiPolyline", feature = "MKShape"))]
impl MKMultiPolyline {
extern_methods!();
}
#[cfg(all(feature = "MKMultiPolyline", feature = "MKShape"))]
extern_conformance!(
unsafe impl MKGeoJSONObject for MKMultiPolyline {}
);
#[cfg(all(feature = "MKMultiPolygon", feature = "MKShape"))]
impl MKMultiPolygon {
extern_methods!();
}
#[cfg(all(feature = "MKMultiPolygon", feature = "MKShape"))]
extern_conformance!(
unsafe impl MKGeoJSONObject for MKMultiPolygon {}
);
#[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 {}
);
#[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 {}
);