use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[cfg(all(feature = "CMDeviceMotion", feature = "CMLogItem", feature = "block2"))]
pub type CMHeadphoneDeviceMotionHandler =
*mut block2::DynBlock<dyn Fn(*mut CMDeviceMotion, *mut NSError)>;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CMHeadphoneMotionManager;
);
extern_conformance!(
unsafe impl NSObjectProtocol for CMHeadphoneMotionManager {}
);
impl CMHeadphoneMotionManager {
extern_methods!(
#[cfg(feature = "CMAuthorization")]
#[unsafe(method(authorizationStatus))]
#[unsafe(method_family = none)]
pub unsafe fn authorizationStatus() -> CMAuthorizationStatus;
#[cfg(feature = "CMHeadphoneMotionManagerDelegate")]
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn CMHeadphoneMotionManagerDelegate>>>;
#[cfg(feature = "CMHeadphoneMotionManagerDelegate")]
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn CMHeadphoneMotionManagerDelegate>>,
);
#[unsafe(method(isConnectionStatusActive))]
#[unsafe(method_family = none)]
pub unsafe fn isConnectionStatusActive(&self) -> bool;
#[unsafe(method(isDeviceMotionAvailable))]
#[unsafe(method_family = none)]
pub unsafe fn isDeviceMotionAvailable(&self) -> bool;
#[unsafe(method(isDeviceMotionActive))]
#[unsafe(method_family = none)]
pub unsafe fn isDeviceMotionActive(&self) -> bool;
#[cfg(all(feature = "CMDeviceMotion", feature = "CMLogItem"))]
#[unsafe(method(deviceMotion))]
#[unsafe(method_family = none)]
pub unsafe fn deviceMotion(&self) -> Option<Retained<CMDeviceMotion>>;
#[unsafe(method(startDeviceMotionUpdates))]
#[unsafe(method_family = none)]
pub unsafe fn startDeviceMotionUpdates(&self);
#[cfg(all(feature = "CMDeviceMotion", feature = "CMLogItem", feature = "block2"))]
#[unsafe(method(startDeviceMotionUpdatesToQueue:withHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn startDeviceMotionUpdatesToQueue_withHandler(
&self,
queue: &NSOperationQueue,
handler: CMHeadphoneDeviceMotionHandler,
);
#[unsafe(method(stopDeviceMotionUpdates))]
#[unsafe(method_family = none)]
pub unsafe fn stopDeviceMotionUpdates(&self);
#[unsafe(method(startConnectionStatusUpdates))]
#[unsafe(method_family = none)]
pub unsafe fn startConnectionStatusUpdates(&self);
#[unsafe(method(stopConnectionStatusUpdates))]
#[unsafe(method_family = none)]
pub unsafe fn stopConnectionStatusUpdates(&self);
);
}
impl CMHeadphoneMotionManager {
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>;
);
}