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:))]
38 #[unsafe(method_family = none)]
39 pub unsafe fn queryStepCountStartingFrom_to_toQueue_withHandler(
40 &self,
41 start: &NSDate,
42 end: &NSDate,
43 queue: &NSOperationQueue,
44 handler: CMStepQueryHandler,
45 );
46
47 #[cfg(feature = "block2")]
48 #[unsafe(method(startStepCountingUpdatesToQueue:updateOn:withHandler:))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn startStepCountingUpdatesToQueue_updateOn_withHandler(
51 &self,
52 queue: &NSOperationQueue,
53 step_counts: NSInteger,
54 handler: CMStepUpdateHandler,
55 );
56
57 #[unsafe(method(stopStepCountingUpdates))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn stopStepCountingUpdates(&self);
60 );
61}
62
63impl CMStepCounter {
65 extern_methods!(
66 #[unsafe(method(init))]
67 #[unsafe(method_family = init)]
68 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
69
70 #[unsafe(method(new))]
71 #[unsafe(method_family = new)]
72 pub unsafe fn new() -> Retained<Self>;
73 );
74}