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

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkmapitemdetailviewcontrollerdelegate?language=objc)
    pub unsafe trait MKMapItemDetailViewControllerDelegate:
        NSObjectProtocol + MainThreadOnly
    {
        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        #[unsafe(method(mapItemDetailViewControllerDidFinish:))]
        #[unsafe(method_family = none)]
        unsafe fn mapItemDetailViewControllerDidFinish(
            &self,
            detail_view_controller: &MKMapItemDetailViewController,
        );
    }
);

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

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

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

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

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

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

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl MKMapItemDetailViewController {
    extern_methods!(
        #[cfg(feature = "MKMapItem")]
        #[unsafe(method(mapItem))]
        #[unsafe(method_family = none)]
        pub unsafe fn mapItem(&self) -> Option<Retained<MKMapItem>>;

        #[cfg(feature = "MKMapItem")]
        /// Setter for [`mapItem`][Self::mapItem].
        #[unsafe(method(setMapItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMapItem(&self, map_item: Option<&MKMapItem>);

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

        /// 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 MKMapItemDetailViewControllerDelegate>>,
        );

        #[cfg(feature = "MKMapItem")]
        #[unsafe(method(initWithMapItem:displaysMap:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithMapItem_displaysMap(
            this: Allocated<Self>,
            map_item: Option<&MKMapItem>,
            displays_map: bool,
        ) -> Retained<Self>;

        #[cfg(feature = "MKMapItem")]
        #[unsafe(method(initWithMapItem:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithMapItem(
            this: Allocated<Self>,
            map_item: Option<&MKMapItem>,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSViewController`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl MKMapItemDetailViewController {
    extern_methods!(
        #[unsafe(method(initWithNibName:bundle:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithNibName_bundle(
            this: Allocated<Self>,
            nib_name_or_nil: Option<&NSNibName>,
            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>>;
    );
}

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