objc2-core-motion 0.3.2

Bindings to the CoreMotion framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coremotion/cmsensordatalist?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CMSensorDataList;
);

extern_conformance!(
    unsafe impl NSFastEnumeration for CMSensorDataList {}
);

extern_conformance!(
    unsafe impl NSObjectProtocol for CMSensorDataList {}
);

impl CMSensorDataList {
    extern_methods!();
}

/// Methods declared on superclass `NSObject`.
impl CMSensorDataList {
    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>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coremotion/cmsensorrecorder?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CMSensorRecorder;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for CMSensorRecorder {}
);

impl CMSensorRecorder {
    extern_methods!(
        #[unsafe(method(isAccelerometerRecordingAvailable))]
        #[unsafe(method_family = none)]
        pub unsafe fn isAccelerometerRecordingAvailable() -> bool;

        #[cfg(feature = "CMAuthorization")]
        #[unsafe(method(authorizationStatus))]
        #[unsafe(method_family = none)]
        pub unsafe fn authorizationStatus() -> CMAuthorizationStatus;

        #[deprecated]
        #[unsafe(method(isAuthorizedForRecording))]
        #[unsafe(method_family = none)]
        pub unsafe fn isAuthorizedForRecording() -> bool;

        #[unsafe(method(accelerometerDataFromDate:toDate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn accelerometerDataFromDate_toDate(
            &self,
            from_date: &NSDate,
            to_date: &NSDate,
        ) -> Option<Retained<CMSensorDataList>>;

        #[unsafe(method(recordAccelerometerForDuration:))]
        #[unsafe(method_family = none)]
        pub unsafe fn recordAccelerometerForDuration(&self, duration: NSTimeInterval);
    );
}

/// Methods declared on superclass `NSObject`.
impl CMSensorRecorder {
    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>;
    );
}