use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-location")]
use objc2_core_location::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-map-kit")]
use objc2_map_kit::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKInterfaceMapPinColor(pub NSInteger);
impl WKInterfaceMapPinColor {
#[doc(alias = "WKInterfaceMapPinColorRed")]
pub const Red: Self = Self(0);
#[doc(alias = "WKInterfaceMapPinColorGreen")]
pub const Green: Self = Self(1);
#[doc(alias = "WKInterfaceMapPinColorPurple")]
pub const Purple: Self = Self(2);
}
unsafe impl Encode for WKInterfaceMapPinColor {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for WKInterfaceMapPinColor {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKInterfaceMapUserTrackingMode(pub NSInteger);
impl WKInterfaceMapUserTrackingMode {
#[doc(alias = "WKInterfaceMapUserTrackingModeNone")]
pub const None: Self = Self(0);
#[doc(alias = "WKInterfaceMapUserTrackingModeFollow")]
pub const Follow: Self = Self(1);
}
unsafe impl Encode for WKInterfaceMapUserTrackingMode {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for WKInterfaceMapUserTrackingMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(WKInterfaceObject, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "WKInterfaceObject")]
pub struct WKInterfaceMap;
);
#[cfg(feature = "WKInterfaceObject")]
extern_conformance!(
unsafe impl NSObjectProtocol for WKInterfaceMap {}
);
#[cfg(feature = "WKInterfaceObject")]
impl WKInterfaceMap {
extern_methods!(
#[deprecated = "Use MapKit.MapView instead."]
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(setShowsUserLocation:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowsUserLocation(&self, shows_user_location: bool);
#[unsafe(method(setShowsUserHeading:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowsUserHeading(&self, shows_user_heading: bool);
#[unsafe(method(setUserTrackingMode:animated:))]
#[unsafe(method_family = none)]
pub unsafe fn setUserTrackingMode_animated(
&self,
mode: WKInterfaceMapUserTrackingMode,
animated: bool,
);
#[cfg(feature = "objc2-map-kit")]
#[unsafe(method(setVisibleMapRect:))]
#[unsafe(method_family = none)]
pub unsafe fn setVisibleMapRect(&self, map_rect: MKMapRect);
#[cfg(feature = "objc2-map-kit")]
#[unsafe(method(setRegion:))]
#[unsafe(method_family = none)]
pub unsafe fn setRegion(&self, coordinate_region: MKCoordinateRegion);
#[cfg(all(
feature = "objc2-core-foundation",
feature = "objc2-core-location",
feature = "objc2-ui-kit"
))]
#[unsafe(method(addAnnotation:withImage:centerOffset:))]
#[unsafe(method_family = none)]
pub unsafe fn addAnnotation_withImage_centerOffset(
&self,
location: CLLocationCoordinate2D,
image: Option<&UIImage>,
offset: CGPoint,
);
#[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-location"))]
#[unsafe(method(addAnnotation:withImageNamed:centerOffset:))]
#[unsafe(method_family = none)]
pub unsafe fn addAnnotation_withImageNamed_centerOffset(
&self,
location: CLLocationCoordinate2D,
name: Option<&NSString>,
offset: CGPoint,
);
#[cfg(feature = "objc2-core-location")]
#[unsafe(method(addAnnotation:withPinColor:))]
#[unsafe(method_family = none)]
pub unsafe fn addAnnotation_withPinColor(
&self,
location: CLLocationCoordinate2D,
pin_color: WKInterfaceMapPinColor,
);
#[unsafe(method(removeAllAnnotations))]
#[unsafe(method_family = none)]
pub unsafe fn removeAllAnnotations(&self);
);
}
#[cfg(feature = "WKInterfaceObject")]
impl WKInterfaceMap {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}