//! 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/clmonitor?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CLMonitor;
);

unsafe impl Send for CLMonitor {}

unsafe impl Sync for CLMonitor {}

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

impl CLMonitor {
    extern_methods!(
        #[cfg(all(feature = "CLMonitorConfiguration", feature = "block2"))]
        #[unsafe(method(requestMonitorWithConfiguration:completion:))]
        #[unsafe(method_family = none)]
        pub unsafe fn requestMonitorWithConfiguration_completion(
            config: &CLMonitorConfiguration,
            completion_handler: &block2::DynBlock<dyn Fn(NonNull<CLMonitor>)>,
        );

        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub unsafe fn name(&self) -> Retained<NSString>;

        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(monitoredIdentifiers))]
        #[unsafe(method_family = none)]
        pub unsafe fn monitoredIdentifiers(&self) -> Retained<NSArray<NSString>>;

        #[cfg(feature = "CLCondition")]
        #[unsafe(method(addConditionForMonitoring:identifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addConditionForMonitoring_identifier(
            &self,
            condition: &CLCondition,
            identifier: &NSString,
        );

        #[cfg(all(feature = "CLCondition", feature = "CLMonitoringEvent"))]
        #[unsafe(method(addConditionForMonitoring:identifier:assumedState:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addConditionForMonitoring_identifier_assumedState(
            &self,
            condition: &CLCondition,
            identifier: &NSString,
            state: CLMonitoringState,
        );

        #[unsafe(method(removeConditionFromMonitoringWithIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeConditionFromMonitoringWithIdentifier(&self, identifier: &NSString);

        #[cfg(feature = "CLMonitoringRecord")]
        #[unsafe(method(monitoringRecordForIdentifier:))]
        #[unsafe(method_family = none)]
        pub unsafe fn monitoringRecordForIdentifier(
            &self,
            identifier: &NSString,
        ) -> Option<Retained<CLMonitoringRecord>>;

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