//! 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::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/corelocation/clbeaconregion?language=objc)
    #[unsafe(super(CLRegion, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "CLRegion")]
    #[deprecated]
    pub struct CLBeaconRegion;
);

#[cfg(feature = "CLRegion")]
extern_conformance!(
    unsafe impl NSCoding for CLBeaconRegion {}
);

#[cfg(feature = "CLRegion")]
extern_conformance!(
    unsafe impl NSCopying for CLBeaconRegion {}
);

#[cfg(feature = "CLRegion")]
unsafe impl CopyingHelper for CLBeaconRegion {
    type Result = Self;
}

#[cfg(feature = "CLRegion")]
extern_conformance!(
    unsafe impl NSObjectProtocol for CLBeaconRegion {}
);

#[cfg(feature = "CLRegion")]
extern_conformance!(
    unsafe impl NSSecureCoding for CLBeaconRegion {}
);

#[cfg(feature = "CLRegion")]
impl CLBeaconRegion {
    extern_methods!(
        #[unsafe(method(initWithUUID:identifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithUUID_identifier(
            this: Allocated<Self>,
            uuid: &NSUUID,
            identifier: &NSString,
        ) -> Retained<Self>;

        #[deprecated]
        #[unsafe(method(initWithProximityUUID:identifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithProximityUUID_identifier(
            this: Allocated<Self>,
            proximity_uuid: &NSUUID,
            identifier: &NSString,
        ) -> Retained<Self>;

        #[cfg(feature = "CLBeaconIdentityCondition")]
        #[unsafe(method(initWithUUID:major:identifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithUUID_major_identifier(
            this: Allocated<Self>,
            uuid: &NSUUID,
            major: CLBeaconMajorValue,
            identifier: &NSString,
        ) -> Retained<Self>;

        #[cfg(feature = "CLBeaconIdentityCondition")]
        #[deprecated]
        #[unsafe(method(initWithProximityUUID:major:identifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithProximityUUID_major_identifier(
            this: Allocated<Self>,
            proximity_uuid: &NSUUID,
            major: CLBeaconMajorValue,
            identifier: &NSString,
        ) -> Retained<Self>;

        #[cfg(feature = "CLBeaconIdentityCondition")]
        #[unsafe(method(initWithUUID:major:minor:identifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithUUID_major_minor_identifier(
            this: Allocated<Self>,
            uuid: &NSUUID,
            major: CLBeaconMajorValue,
            minor: CLBeaconMinorValue,
            identifier: &NSString,
        ) -> Retained<Self>;

        #[cfg(feature = "CLBeaconIdentityCondition")]
        #[deprecated]
        #[unsafe(method(initWithProximityUUID:major:minor:identifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithProximityUUID_major_minor_identifier(
            this: Allocated<Self>,
            proximity_uuid: &NSUUID,
            major: CLBeaconMajorValue,
            minor: CLBeaconMinorValue,
            identifier: &NSString,
        ) -> Retained<Self>;

        #[cfg(all(
            feature = "CLBeaconIdentityCondition",
            feature = "CLBeaconIdentityConstraint",
            feature = "CLCondition"
        ))]
        #[unsafe(method(initWithBeaconIdentityConstraint:identifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithBeaconIdentityConstraint_identifier(
            this: Allocated<Self>,
            beacon_identity_constraint: &CLBeaconIdentityConstraint,
            identifier: &NSString,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// The returned generic should be of the correct type.
        #[deprecated]
        #[unsafe(method(peripheralDataWithMeasuredPower:))]
        #[unsafe(method_family = none)]
        pub unsafe fn peripheralDataWithMeasuredPower(
            &self,
            measured_power: Option<&NSNumber>,
        ) -> Retained<NSMutableDictionary<NSString, AnyObject>>;

        #[cfg(all(
            feature = "CLBeaconIdentityCondition",
            feature = "CLBeaconIdentityConstraint",
            feature = "CLCondition"
        ))]
        #[unsafe(method(beaconIdentityConstraint))]
        #[unsafe(method_family = none)]
        pub unsafe fn beaconIdentityConstraint(&self) -> Retained<CLBeaconIdentityConstraint>;

        #[unsafe(method(UUID))]
        #[unsafe(method_family = none)]
        pub unsafe fn UUID(&self) -> Retained<NSUUID>;

        #[deprecated]
        #[unsafe(method(proximityUUID))]
        #[unsafe(method_family = none)]
        pub unsafe fn proximityUUID(&self) -> Retained<NSUUID>;

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

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

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

        /// Setter for [`notifyEntryStateOnDisplay`][Self::notifyEntryStateOnDisplay].
        #[deprecated]
        #[unsafe(method(setNotifyEntryStateOnDisplay:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setNotifyEntryStateOnDisplay(&self, notify_entry_state_on_display: bool);
    );
}

/// Methods declared on superclass `CLRegion`.
#[cfg(feature = "CLRegion")]
impl CLBeaconRegion {
    extern_methods!(
        #[cfg(feature = "CLLocation")]
        #[deprecated = "Please see CLCircularRegion"]
        #[unsafe(method(initCircularRegionWithCenter:radius:identifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initCircularRegionWithCenter_radius_identifier(
            this: Allocated<Self>,
            center: CLLocationCoordinate2D,
            radius: CLLocationDistance,
            identifier: &NSString,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "CLRegion")]
impl CLBeaconRegion {
    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_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/corelocation/clbeacon?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CLBeacon;
);

extern_conformance!(
    unsafe impl NSCoding for CLBeacon {}
);

extern_conformance!(
    unsafe impl NSCopying for CLBeacon {}
);

unsafe impl CopyingHelper for CLBeacon {
    type Result = Self;
}

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

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

impl CLBeacon {
    extern_methods!(
        #[unsafe(method(timestamp))]
        #[unsafe(method_family = none)]
        pub unsafe fn timestamp(&self) -> Retained<NSDate>;

        #[unsafe(method(UUID))]
        #[unsafe(method_family = none)]
        pub unsafe fn UUID(&self) -> Retained<NSUUID>;

        #[deprecated]
        #[unsafe(method(proximityUUID))]
        #[unsafe(method_family = none)]
        pub unsafe fn proximityUUID(&self) -> Retained<NSUUID>;

        #[unsafe(method(major))]
        #[unsafe(method_family = none)]
        pub unsafe fn major(&self) -> Retained<NSNumber>;

        #[unsafe(method(minor))]
        #[unsafe(method_family = none)]
        pub unsafe fn minor(&self) -> Retained<NSNumber>;

        #[cfg(feature = "CLRegion")]
        #[unsafe(method(proximity))]
        #[unsafe(method_family = none)]
        pub unsafe fn proximity(&self) -> CLProximity;

        #[cfg(feature = "CLLocation")]
        #[unsafe(method(accuracy))]
        #[unsafe(method_family = none)]
        pub unsafe fn accuracy(&self) -> CLLocationAccuracy;

        #[unsafe(method(rssi))]
        #[unsafe(method_family = none)]
        pub unsafe fn rssi(&self) -> NSInteger;
    );
}

/// Methods declared on superclass `NSObject`.
impl CLBeacon {
    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>;
    );
}
