use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[cfg(feature = "block2")]
pub type CMStepQueryHandler = *mut block2::DynBlock<dyn Fn(NSInteger, *mut NSError)>;
#[cfg(feature = "block2")]
pub type CMStepUpdateHandler =
*mut block2::DynBlock<dyn Fn(NSInteger, NonNull<NSDate>, *mut NSError)>;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CMStepCounter;
);
extern_conformance!(
unsafe impl NSObjectProtocol for CMStepCounter {}
);
impl CMStepCounter {
extern_methods!(
#[unsafe(method(isStepCountingAvailable))]
#[unsafe(method_family = none)]
pub unsafe fn isStepCountingAvailable() -> bool;
#[cfg(feature = "block2")]
#[unsafe(method(queryStepCountStartingFrom:to:toQueue:withHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn queryStepCountStartingFrom_to_toQueue_withHandler(
&self,
start: &NSDate,
end: &NSDate,
queue: &NSOperationQueue,
handler: CMStepQueryHandler,
);
#[cfg(feature = "block2")]
#[unsafe(method(startStepCountingUpdatesToQueue:updateOn:withHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn startStepCountingUpdatesToQueue_updateOn_withHandler(
&self,
queue: &NSOperationQueue,
step_counts: NSInteger,
handler: CMStepUpdateHandler,
);
#[unsafe(method(stopStepCountingUpdates))]
#[unsafe(method_family = none)]
pub unsafe fn stopStepCountingUpdates(&self);
);
}
impl CMStepCounter {
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>;
);
}