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-location")]
use objc2_core_location::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkmapitem?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MKMapItem;
);

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

impl MKMapItem {
    extern_methods!(
        #[cfg(feature = "MKMapItemIdentifier")]
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Option<Retained<MKMapItemIdentifier>>;

        #[cfg(feature = "MKMapItemIdentifier")]
        #[unsafe(method(alternateIdentifiers))]
        #[unsafe(method_family = none)]
        pub unsafe fn alternateIdentifiers(&self) -> Retained<NSSet<MKMapItemIdentifier>>;

        #[cfg(all(feature = "MKPlacemark", feature = "objc2-core-location"))]
        #[deprecated = "Use location, address and addressRepresentations instead"]
        #[unsafe(method(placemark))]
        #[unsafe(method_family = none)]
        pub unsafe fn placemark(&self) -> Retained<MKPlacemark>;

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

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

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

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

        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub unsafe fn name(&self) -> Option<Retained<NSString>>;

        /// Setter for [`name`][Self::name].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setName(&self, name: Option<&NSString>);

        #[unsafe(method(phoneNumber))]
        #[unsafe(method_family = none)]
        pub unsafe fn phoneNumber(&self) -> Option<Retained<NSString>>;

        /// Setter for [`phoneNumber`][Self::phoneNumber].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setPhoneNumber:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPhoneNumber(&self, phone_number: Option<&NSString>);

        #[unsafe(method(url))]
        #[unsafe(method_family = none)]
        pub unsafe fn url(&self) -> Option<Retained<NSURL>>;

        /// Setter for [`url`][Self::url].
        #[unsafe(method(setUrl:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUrl(&self, url: Option<&NSURL>);

        #[unsafe(method(timeZone))]
        #[unsafe(method_family = none)]
        pub unsafe fn timeZone(&self) -> Option<Retained<NSTimeZone>>;

        /// Setter for [`timeZone`][Self::timeZone].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTimeZone:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);

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

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

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

        #[cfg(all(feature = "MKPlacemark", feature = "objc2-core-location"))]
        #[deprecated = "Use init(location:address:)"]
        #[unsafe(method(initWithPlacemark:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithPlacemark(
            this: Allocated<Self>,
            placemark: &MKPlacemark,
        ) -> Retained<Self>;

        #[cfg(all(feature = "MKAddress", feature = "objc2-core-location"))]
        #[unsafe(method(initWithLocation:address:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithLocation_address(
            this: Allocated<Self>,
            location: &CLLocation,
            address: Option<&MKAddress>,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// `launch_options` generic should be of the correct type.
        #[unsafe(method(openInMapsWithLaunchOptions:))]
        #[unsafe(method_family = none)]
        pub unsafe fn openInMapsWithLaunchOptions(
            &self,
            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
        ) -> bool;

        /// # Safety
        ///
        /// `launch_options` generic should be of the correct type.
        #[unsafe(method(openMapsWithItems:launchOptions:))]
        #[unsafe(method_family = none)]
        pub unsafe fn openMapsWithItems_launchOptions(
            map_items: &NSArray<MKMapItem>,
            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
        ) -> bool;

        #[cfg(feature = "block2")]
        /// # Safety
        ///
        /// `launch_options` generic should be of the correct type.
        #[unsafe(method(openInMapsWithLaunchOptions:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn openInMapsWithLaunchOptions_completionHandler(
            &self,
            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
        );

        #[cfg(feature = "block2")]
        /// # Safety
        ///
        /// `launch_options` generic should be of the correct type.
        #[unsafe(method(openMapsWithItems:launchOptions:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn openMapsWithItems_launchOptions_completionHandler(
            map_items: &NSArray<MKMapItem>,
            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
            completion: Option<&block2::DynBlock<dyn Fn(Bool)>>,
        );
    );
}

/// Methods declared on superclass `NSObject`.
impl MKMapItem {
    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 "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodekey?language=objc)
    pub static MKLaunchOptionsDirectionsModeKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsmaptypekey?language=objc)
    pub static MKLaunchOptionsMapTypeKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsshowstraffickey?language=objc)
    pub static MKLaunchOptionsShowsTrafficKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodedefault?language=objc)
    pub static MKLaunchOptionsDirectionsModeDefault: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodedriving?language=objc)
    pub static MKLaunchOptionsDirectionsModeDriving: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodewalking?language=objc)
    pub static MKLaunchOptionsDirectionsModeWalking: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodetransit?language=objc)
    pub static MKLaunchOptionsDirectionsModeTransit: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsdirectionsmodecycling?language=objc)
    pub static MKLaunchOptionsDirectionsModeCycling: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsmapcenterkey?language=objc)
    pub static MKLaunchOptionsMapCenterKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionsmapspankey?language=objc)
    pub static MKLaunchOptionsMapSpanKey: &'static NSString;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mklaunchoptionscamerakey?language=objc)
    pub static MKLaunchOptionsCameraKey: &'static NSString;
}

/// MKMapItemSerialization.
impl MKMapItem {
    extern_methods!();
}

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

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkmapitemtypeidentifier?language=objc)
    pub static MKMapItemTypeIdentifier: &'static NSString;
}