objc2_core_motion/generated/
CMStepCounter.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[cfg(feature = "block2")]
12pub type CMStepQueryHandler = *mut block2::DynBlock<dyn Fn(NSInteger, *mut NSError)>;
13
14#[cfg(feature = "block2")]
16pub type CMStepUpdateHandler =
17 *mut block2::DynBlock<dyn Fn(NSInteger, NonNull<NSDate>, *mut NSError)>;
18
19extern_class!(
20 #[unsafe(super(NSObject))]
22 #[derive(Debug, PartialEq, Eq, Hash)]
23 pub struct CMStepCounter;
24);
25
26extern_conformance!(
27 unsafe impl NSObjectProtocol for CMStepCounter {}
28);
29
30impl CMStepCounter {
31 extern_methods!(
32 #[unsafe(method(isStepCountingAvailable))]
33 #[unsafe(method_family = none)]
34 pub unsafe fn isStepCountingAvailable() -> bool;
35
36 #[cfg(feature = "block2")]
37 #[unsafe(method(queryStepCountStartingFrom:to:toQueue:withHandler:))]
42 #[unsafe(method_family = none)]
43 pub unsafe fn queryStepCountStartingFrom_to_toQueue_withHandler(
44 &self,
45 start: &NSDate,
46 end: &NSDate,
47 queue: &NSOperationQueue,
48 handler: CMStepQueryHandler,
49 );
50
51 #[cfg(feature = "block2")]
52 #[unsafe(method(startStepCountingUpdatesToQueue:updateOn:withHandler:))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn startStepCountingUpdatesToQueue_updateOn_withHandler(
59 &self,
60 queue: &NSOperationQueue,
61 step_counts: NSInteger,
62 handler: CMStepUpdateHandler,
63 );
64
65 #[unsafe(method(stopStepCountingUpdates))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn stopStepCountingUpdates(&self);
68 );
69}
70
71impl CMStepCounter {
73 extern_methods!(
74 #[unsafe(method(init))]
75 #[unsafe(method_family = init)]
76 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
77
78 #[unsafe(method(new))]
79 #[unsafe(method_family = new)]
80 pub unsafe fn new() -> Retained<Self>;
81 );
82}