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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[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/mkmapcamera?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MKMapCamera;
);

extern_conformance!(
    unsafe impl NSCoding for MKMapCamera {}
);

extern_conformance!(
    unsafe impl NSCopying for MKMapCamera {}
);

unsafe impl CopyingHelper for MKMapCamera {
    type Result = Self;
}

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

extern_conformance!(
    unsafe impl NSSecureCoding for MKMapCamera {}
);

impl MKMapCamera {
    extern_methods!(
        #[cfg(feature = "objc2-core-location")]
        #[unsafe(method(centerCoordinate))]
        #[unsafe(method_family = none)]
        pub unsafe fn centerCoordinate(&self) -> CLLocationCoordinate2D;

        #[cfg(feature = "objc2-core-location")]
        /// Setter for [`centerCoordinate`][Self::centerCoordinate].
        #[unsafe(method(setCenterCoordinate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCenterCoordinate(&self, center_coordinate: CLLocationCoordinate2D);

        #[cfg(feature = "objc2-core-location")]
        #[unsafe(method(centerCoordinateDistance))]
        #[unsafe(method_family = none)]
        pub unsafe fn centerCoordinateDistance(&self) -> CLLocationDistance;

        #[cfg(feature = "objc2-core-location")]
        /// Setter for [`centerCoordinateDistance`][Self::centerCoordinateDistance].
        #[unsafe(method(setCenterCoordinateDistance:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCenterCoordinateDistance(
            &self,
            center_coordinate_distance: CLLocationDistance,
        );

        #[cfg(feature = "objc2-core-location")]
        #[unsafe(method(heading))]
        #[unsafe(method_family = none)]
        pub unsafe fn heading(&self) -> CLLocationDirection;

        #[cfg(feature = "objc2-core-location")]
        /// Setter for [`heading`][Self::heading].
        #[unsafe(method(setHeading:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setHeading(&self, heading: CLLocationDirection);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(pitch))]
        #[unsafe(method_family = none)]
        pub unsafe fn pitch(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`pitch`][Self::pitch].
        #[unsafe(method(setPitch:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPitch(&self, pitch: CGFloat);

        #[cfg(feature = "objc2-core-location")]
        #[deprecated = "Use centerCoordinateDistance"]
        #[unsafe(method(altitude))]
        #[unsafe(method_family = none)]
        pub unsafe fn altitude(&self) -> CLLocationDistance;

        #[cfg(feature = "objc2-core-location")]
        /// Setter for [`altitude`][Self::altitude].
        #[deprecated = "Use centerCoordinateDistance"]
        #[unsafe(method(setAltitude:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAltitude(&self, altitude: CLLocationDistance);

        #[unsafe(method(camera))]
        #[unsafe(method_family = none)]
        pub unsafe fn camera() -> Retained<Self>;

        #[cfg(feature = "objc2-core-location")]
        #[unsafe(method(cameraLookingAtCenterCoordinate:fromEyeCoordinate:eyeAltitude:))]
        #[unsafe(method_family = none)]
        pub unsafe fn cameraLookingAtCenterCoordinate_fromEyeCoordinate_eyeAltitude(
            center_coordinate: CLLocationCoordinate2D,
            eye_coordinate: CLLocationCoordinate2D,
            eye_altitude: CLLocationDistance,
        ) -> Retained<Self>;

        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-location"))]
        #[unsafe(method(cameraLookingAtCenterCoordinate:fromDistance:pitch:heading:))]
        #[unsafe(method_family = none)]
        pub unsafe fn cameraLookingAtCenterCoordinate_fromDistance_pitch_heading(
            center_coordinate: CLLocationCoordinate2D,
            distance: CLLocationDistance,
            pitch: CGFloat,
            heading: CLLocationDirection,
        ) -> Retained<Self>;

        #[cfg(all(feature = "MKMapItem", feature = "objc2-core-foundation"))]
        #[unsafe(method(cameraLookingAtMapItem:forViewSize:allowPitch:))]
        #[unsafe(method_family = none)]
        pub unsafe fn cameraLookingAtMapItem_forViewSize_allowPitch(
            map_item: &MKMapItem,
            view_size: CGSize,
            allow_pitch: bool,
        ) -> Retained<Self>;
    );
}

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