objc2-core-location 0.3.2

Bindings to the CoreLocation framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
#[cfg(feature = "dispatch2")]
use dispatch2::*;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

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

unsafe impl Send for CLMonitorConfiguration {}

unsafe impl Sync for CLMonitorConfiguration {}

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

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

        #[cfg(feature = "dispatch2")]
        #[unsafe(method(queue))]
        #[unsafe(method_family = none)]
        pub unsafe fn queue(&self) -> Retained<DispatchQueue>;

        #[cfg(all(
            feature = "CLMonitor",
            feature = "CLMonitoringEvent",
            feature = "block2"
        ))]
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// - The returned block's argument 1 must be a valid pointer.
        /// - The returned block's argument 2 must be a valid pointer.
        /// - This might not be thread-safe.
        #[unsafe(method(eventHandler))]
        #[unsafe(method_family = none)]
        pub unsafe fn eventHandler(
            &self,
        ) -> NonNull<block2::DynBlock<dyn Fn(NonNull<CLMonitor>, NonNull<CLMonitoringEvent>)>>;

        #[cfg(all(
            feature = "CLMonitor",
            feature = "CLMonitoringEvent",
            feature = "block2",
            feature = "dispatch2"
        ))]
        /// # Safety
        ///
        /// `queue` possibly has additional threading requirements.
        #[unsafe(method(configWithMonitorName:queue:eventHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn configWithMonitorName_queue_eventHandler(
            name: &NSString,
            queue: &DispatchQueue,
            event_handler: &block2::DynBlock<
                dyn Fn(NonNull<CLMonitor>, NonNull<CLMonitoringEvent>),
            >,
        ) -> Retained<CLMonitorConfiguration>;
    );
}

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