objc2_core_motion/generated/
CMBatchedSensorManager.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/coremotion/cmbatchedsensormanager?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct CMBatchedSensorManager;
15);
16
17extern_conformance!(
18    unsafe impl NSObjectProtocol for CMBatchedSensorManager {}
19);
20
21impl CMBatchedSensorManager {
22    extern_methods!(
23        #[cfg(feature = "CMAuthorization")]
24        #[unsafe(method(authorizationStatus))]
25        #[unsafe(method_family = none)]
26        pub unsafe fn authorizationStatus() -> CMAuthorizationStatus;
27
28        #[unsafe(method(isAccelerometerSupported))]
29        #[unsafe(method_family = none)]
30        pub unsafe fn isAccelerometerSupported() -> bool;
31
32        #[unsafe(method(isAccelerometerActive))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn isAccelerometerActive(&self) -> bool;
35
36        #[unsafe(method(accelerometerDataFrequency))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn accelerometerDataFrequency(&self) -> NSInteger;
39
40        #[cfg(all(feature = "CMAccelerometer", feature = "CMLogItem"))]
41        #[unsafe(method(accelerometerBatch))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn accelerometerBatch(&self) -> Option<Retained<NSArray<CMAccelerometerData>>>;
44
45        #[unsafe(method(startAccelerometerUpdates))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn startAccelerometerUpdates(&self);
48
49        #[cfg(all(feature = "CMAccelerometer", feature = "CMLogItem", feature = "block2"))]
50        #[unsafe(method(startAccelerometerUpdatesWithHandler:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn startAccelerometerUpdatesWithHandler(
53            &self,
54            handler: &block2::DynBlock<dyn Fn(*mut NSArray<CMAccelerometerData>, *mut NSError)>,
55        );
56
57        #[unsafe(method(stopAccelerometerUpdates))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn stopAccelerometerUpdates(&self);
60
61        #[unsafe(method(isDeviceMotionSupported))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn isDeviceMotionSupported() -> bool;
64
65        #[unsafe(method(deviceMotionDataFrequency))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn deviceMotionDataFrequency(&self) -> NSInteger;
68
69        #[unsafe(method(isDeviceMotionActive))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn isDeviceMotionActive(&self) -> bool;
72
73        #[cfg(all(feature = "CMDeviceMotion", feature = "CMLogItem"))]
74        #[unsafe(method(deviceMotionBatch))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn deviceMotionBatch(&self) -> Option<Retained<NSArray<CMDeviceMotion>>>;
77
78        #[unsafe(method(startDeviceMotionUpdates))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn startDeviceMotionUpdates(&self);
81
82        #[cfg(all(feature = "CMDeviceMotion", feature = "CMLogItem", feature = "block2"))]
83        #[unsafe(method(startDeviceMotionUpdatesWithHandler:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn startDeviceMotionUpdatesWithHandler(
86            &self,
87            handler: &block2::DynBlock<dyn Fn(*mut NSArray<CMDeviceMotion>, *mut NSError)>,
88        );
89
90        #[unsafe(method(stopDeviceMotionUpdates))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn stopDeviceMotionUpdates(&self);
93    );
94}
95
96/// Methods declared on superclass `NSObject`.
97impl CMBatchedSensorManager {
98    extern_methods!(
99        #[unsafe(method(init))]
100        #[unsafe(method_family = init)]
101        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
102
103        #[unsafe(method(new))]
104        #[unsafe(method_family = new)]
105        pub unsafe fn new() -> Retained<Self>;
106    );
107}