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-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklookaroundbadgeposition?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MKLookAroundBadgePosition(pub NSInteger);
impl MKLookAroundBadgePosition {
    #[doc(alias = "MKLookAroundBadgePositionTopLeading")]
    pub const TopLeading: Self = Self(0);
    #[doc(alias = "MKLookAroundBadgePositionTopTrailing")]
    pub const TopTrailing: Self = Self(1);
    #[doc(alias = "MKLookAroundBadgePositionBottomTrailing")]
    pub const BottomTrailing: Self = Self(2);
}

unsafe impl Encode for MKLookAroundBadgePosition {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for MKLookAroundBadgePosition {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklookaroundviewcontroller?language=objc)
    #[unsafe(super(NSViewController, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    pub struct MKLookAroundViewController;
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSCoding for MKLookAroundViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSEditor for MKLookAroundViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSObjectProtocol for MKLookAroundViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSSecureCoding for MKLookAroundViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSSeguePerforming for MKLookAroundViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for MKLookAroundViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl MKLookAroundViewController {
    extern_methods!(
        #[cfg(feature = "MKLookAroundScene")]
        #[unsafe(method(initWithScene:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithScene(
            this: Allocated<Self>,
            scene: &MKLookAroundScene,
        ) -> Retained<Self>;

        #[unsafe(method(initWithNibName:bundle:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithNibName_bundle(
            this: Allocated<Self>,
            nib_name_or_nil: Option<&NSString>,
            nib_bundle_or_nil: Option<&NSBundle>,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn MKLookAroundViewControllerDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn MKLookAroundViewControllerDelegate>>,
        );

        #[cfg(feature = "MKLookAroundScene")]
        #[unsafe(method(scene))]
        #[unsafe(method_family = none)]
        pub unsafe fn scene(&self) -> Option<Retained<MKLookAroundScene>>;

        #[cfg(feature = "MKLookAroundScene")]
        /// Setter for [`scene`][Self::scene].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setScene:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setScene(&self, scene: Option<&MKLookAroundScene>);

        #[unsafe(method(isNavigationEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn isNavigationEnabled(&self) -> bool;

        /// Setter for [`isNavigationEnabled`][Self::isNavigationEnabled].
        #[unsafe(method(setNavigationEnabled:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setNavigationEnabled(&self, navigation_enabled: bool);

        #[unsafe(method(showsRoadLabels))]
        #[unsafe(method_family = none)]
        pub unsafe fn showsRoadLabels(&self) -> bool;

        /// Setter for [`showsRoadLabels`][Self::showsRoadLabels].
        #[unsafe(method(setShowsRoadLabels:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShowsRoadLabels(&self, shows_road_labels: bool);

        #[cfg(feature = "MKPointOfInterestFilter")]
        #[unsafe(method(pointOfInterestFilter))]
        #[unsafe(method_family = none)]
        pub unsafe fn pointOfInterestFilter(&self) -> Option<Retained<MKPointOfInterestFilter>>;

        #[cfg(feature = "MKPointOfInterestFilter")]
        /// Setter for [`pointOfInterestFilter`][Self::pointOfInterestFilter].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setPointOfInterestFilter:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPointOfInterestFilter(
            &self,
            point_of_interest_filter: Option<&MKPointOfInterestFilter>,
        );

        #[unsafe(method(badgePosition))]
        #[unsafe(method_family = none)]
        pub unsafe fn badgePosition(&self) -> MKLookAroundBadgePosition;

        /// Setter for [`badgePosition`][Self::badgePosition].
        #[unsafe(method(setBadgePosition:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setBadgePosition(&self, badge_position: MKLookAroundBadgePosition);
    );
}

/// Methods declared on superclass `NSResponder`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl MKLookAroundViewController {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl MKLookAroundViewController {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklookaroundviewcontrollerdelegate?language=objc)
    pub unsafe trait MKLookAroundViewControllerDelegate: NSObjectProtocol {
        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[optional]
        #[unsafe(method(lookAroundViewControllerWillUpdateScene:))]
        #[unsafe(method_family = none)]
        unsafe fn lookAroundViewControllerWillUpdateScene(
            &self,
            view_controller: &MKLookAroundViewController,
        );

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[optional]
        #[unsafe(method(lookAroundViewControllerDidUpdateScene:))]
        #[unsafe(method_family = none)]
        unsafe fn lookAroundViewControllerDidUpdateScene(
            &self,
            view_controller: &MKLookAroundViewController,
        );

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[optional]
        #[unsafe(method(lookAroundViewControllerWillPresentFullScreen:))]
        #[unsafe(method_family = none)]
        unsafe fn lookAroundViewControllerWillPresentFullScreen(
            &self,
            view_controller: &MKLookAroundViewController,
        );

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[optional]
        #[unsafe(method(lookAroundViewControllerDidPresentFullScreen:))]
        #[unsafe(method_family = none)]
        unsafe fn lookAroundViewControllerDidPresentFullScreen(
            &self,
            view_controller: &MKLookAroundViewController,
        );

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[optional]
        #[unsafe(method(lookAroundViewControllerWillDismissFullScreen:))]
        #[unsafe(method_family = none)]
        unsafe fn lookAroundViewControllerWillDismissFullScreen(
            &self,
            view_controller: &MKLookAroundViewController,
        );

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[optional]
        #[unsafe(method(lookAroundViewControllerDidDismissFullScreen:))]
        #[unsafe(method_family = none)]
        unsafe fn lookAroundViewControllerDidDismissFullScreen(
            &self,
            view_controller: &MKLookAroundViewController,
        );
    }
);