icrate 0.1.2

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AppKit::*;
use crate::Contacts::*;
use crate::CoreLocation::*;
use crate::Foundation::*;
use crate::MapKit::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "MapKit_MKMapItem")]
    pub struct MKMapItem;

    #[cfg(feature = "MapKit_MKMapItem")]
    unsafe impl ClassType for MKMapItem {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "MapKit_MKMapItem")]
unsafe impl NSObjectProtocol for MKMapItem {}

extern_methods!(
    #[cfg(feature = "MapKit_MKMapItem")]
    unsafe impl MKMapItem {
        #[cfg(feature = "MapKit_MKPlacemark")]
        #[method_id(@__retain_semantics Other placemark)]
        pub unsafe fn placemark(&self) -> Id<MKPlacemark>;

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

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other name)]
        pub unsafe fn name(&self) -> Option<Id<NSString>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(setName:)]
        pub unsafe fn setName(&self, name: Option<&NSString>);

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other phoneNumber)]
        pub unsafe fn phoneNumber(&self) -> Option<Id<NSString>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(setPhoneNumber:)]
        pub unsafe fn setPhoneNumber(&self, phone_number: Option<&NSString>);

        #[cfg(feature = "Foundation_NSURL")]
        #[method_id(@__retain_semantics Other url)]
        pub unsafe fn url(&self) -> Option<Id<NSURL>>;

        #[cfg(feature = "Foundation_NSURL")]
        #[method(setUrl:)]
        pub unsafe fn setUrl(&self, url: Option<&NSURL>);

        #[cfg(feature = "Foundation_NSTimeZone")]
        #[method_id(@__retain_semantics Other timeZone)]
        pub unsafe fn timeZone(&self) -> Option<Id<NSTimeZone>>;

        #[cfg(feature = "Foundation_NSTimeZone")]
        #[method(setTimeZone:)]
        pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);

        #[method_id(@__retain_semantics Other pointOfInterestCategory)]
        pub unsafe fn pointOfInterestCategory(&self) -> Option<Id<MKPointOfInterestCategory>>;

        #[method(setPointOfInterestCategory:)]
        pub unsafe fn setPointOfInterestCategory(
            &self,
            point_of_interest_category: Option<&MKPointOfInterestCategory>,
        );

        #[method_id(@__retain_semantics Other mapItemForCurrentLocation)]
        pub unsafe fn mapItemForCurrentLocation() -> Id<MKMapItem>;

        #[cfg(feature = "MapKit_MKPlacemark")]
        #[method_id(@__retain_semantics Init initWithPlacemark:)]
        pub unsafe fn initWithPlacemark(this: Allocated<Self>, placemark: &MKPlacemark)
            -> Id<Self>;

        #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
        #[method(openInMapsWithLaunchOptions:)]
        pub unsafe fn openInMapsWithLaunchOptions(
            &self,
            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
        ) -> bool;

        #[cfg(all(
            feature = "Foundation_NSArray",
            feature = "Foundation_NSDictionary",
            feature = "Foundation_NSString"
        ))]
        #[method(openMapsWithItems:launchOptions:)]
        pub unsafe fn openMapsWithItems_launchOptions(
            map_items: &NSArray<MKMapItem>,
            launch_options: Option<&NSDictionary<NSString, AnyObject>>,
        ) -> bool;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "MapKit_MKMapItem")]
    unsafe impl MKMapItem {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_static!(MKLaunchOptionsDirectionsModeKey: &'static NSString);

extern_static!(MKLaunchOptionsMapTypeKey: &'static NSString);

extern_static!(MKLaunchOptionsShowsTrafficKey: &'static NSString);

extern_static!(MKLaunchOptionsDirectionsModeDefault: &'static NSString);

extern_static!(MKLaunchOptionsDirectionsModeDriving: &'static NSString);

extern_static!(MKLaunchOptionsDirectionsModeWalking: &'static NSString);

extern_static!(MKLaunchOptionsDirectionsModeTransit: &'static NSString);

extern_static!(MKLaunchOptionsMapCenterKey: &'static NSString);

extern_static!(MKLaunchOptionsMapSpanKey: &'static NSString);

extern_static!(MKLaunchOptionsCameraKey: &'static NSString);

extern_methods!(
    /// MKMapItemSerialization
    #[cfg(feature = "MapKit_MKMapItem")]
    unsafe impl MKMapItem {}
);

#[cfg(feature = "MapKit_MKMapItem")]
unsafe impl NSSecureCoding for MKMapItem {}

extern_static!(MKMapItemTypeIdentifier: &'static NSString);