//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/corelocation/clmonitoringstate?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CLMonitoringState(pub NSUInteger);
impl CLMonitoringState {
    #[doc(alias = "CLMonitoringStateUnknown")]
    pub const Unknown: Self = Self(0);
    #[doc(alias = "CLMonitoringStateSatisfied")]
    pub const Satisfied: Self = Self(1);
    #[doc(alias = "CLMonitoringStateUnsatisfied")]
    pub const Unsatisfied: Self = Self(2);
    #[doc(alias = "CLMonitoringStateUnmonitored")]
    pub const Unmonitored: Self = Self(3);
}

unsafe impl Encode for CLMonitoringState {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for CLMonitoringState {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

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

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

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

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

impl CLMonitoringEvent {
    extern_methods!(
        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Retained<NSString>;

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

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

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

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

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

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

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

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

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

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

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

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

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

        #[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>;
    );
}
