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::Contacts::*;
use crate::CoreLocation::*;
use crate::Foundation::*;

ns_closed_enum!(
    #[underlying(NSInteger)]
    pub enum CLRegionState {
        CLRegionStateUnknown = 0,
        CLRegionStateInside = 1,
        CLRegionStateOutside = 2,
    }
);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum CLProximity {
        CLProximityUnknown = 0,
        CLProximityImmediate = 1,
        CLProximityNear = 2,
        CLProximityFar = 3,
    }
);

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

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

#[cfg(feature = "CoreLocation_CLRegion")]
unsafe impl NSCoding for CLRegion {}

#[cfg(feature = "CoreLocation_CLRegion")]
unsafe impl NSCopying for CLRegion {}

#[cfg(feature = "CoreLocation_CLRegion")]
unsafe impl NSObjectProtocol for CLRegion {}

#[cfg(feature = "CoreLocation_CLRegion")]
unsafe impl NSSecureCoding for CLRegion {}

extern_methods!(
    #[cfg(feature = "CoreLocation_CLRegion")]
    unsafe impl CLRegion {
        #[cfg(feature = "Foundation_NSString")]
        #[deprecated = "Please see CLCircularRegion"]
        #[method_id(@__retain_semantics Init initCircularRegionWithCenter:radius:identifier:)]
        pub unsafe fn initCircularRegionWithCenter_radius_identifier(
            this: Allocated<Self>,
            center: CLLocationCoordinate2D,
            radius: CLLocationDistance,
            identifier: &NSString,
        ) -> Id<Self>;

        #[deprecated = "Please see CLCircularRegion"]
        #[method(center)]
        pub unsafe fn center(&self) -> CLLocationCoordinate2D;

        #[deprecated = "Please see CLCircularRegion"]
        #[method(radius)]
        pub unsafe fn radius(&self) -> CLLocationDistance;

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

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

        #[method(setNotifyOnEntry:)]
        pub unsafe fn setNotifyOnEntry(&self, notify_on_entry: bool);

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

        #[method(setNotifyOnExit:)]
        pub unsafe fn setNotifyOnExit(&self, notify_on_exit: bool);

        #[deprecated = "Please see CLCircularRegion"]
        #[method(containsCoordinate:)]
        pub unsafe fn containsCoordinate(&self, coordinate: CLLocationCoordinate2D) -> bool;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "CoreLocation_CLRegion")]
    unsafe impl CLRegion {
        #[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>;
    }
);