//! 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::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccelerationvalue?language=objc)
#[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
pub type UIAccelerationValue = c_double;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiacceleration?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
    pub struct UIAcceleration;
);

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

impl UIAcceleration {
    extern_methods!(
        #[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
        #[unsafe(method(timestamp))]
        #[unsafe(method_family = none)]
        pub fn timestamp(&self) -> NSTimeInterval;

        #[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
        #[unsafe(method(x))]
        #[unsafe(method_family = none)]
        pub fn x(&self) -> UIAccelerationValue;

        #[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
        #[unsafe(method(y))]
        #[unsafe(method_family = none)]
        pub fn y(&self) -> UIAccelerationValue;

        #[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
        #[unsafe(method(z))]
        #[unsafe(method_family = none)]
        pub fn z(&self) -> UIAccelerationValue;
    );
}

/// Methods declared on superclass `NSObject`.
impl UIAcceleration {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccelerometer?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
    pub struct UIAccelerometer;
);

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

impl UIAccelerometer {
    extern_methods!(
        #[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
        #[unsafe(method(sharedAccelerometer))]
        #[unsafe(method_family = none)]
        pub fn sharedAccelerometer(mtm: MainThreadMarker) -> Retained<UIAccelerometer>;

        #[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
        #[unsafe(method(updateInterval))]
        #[unsafe(method_family = none)]
        pub fn updateInterval(&self) -> NSTimeInterval;

        /// Setter for [`updateInterval`][Self::updateInterval].
        #[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
        #[unsafe(method(setUpdateInterval:))]
        #[unsafe(method_family = none)]
        pub fn setUpdateInterval(&self, update_interval: NSTimeInterval);

        #[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UIAccelerometerDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[deprecated = "UIAccelerometer has been replaced by the CoreMotion framework"]
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn UIAccelerometerDelegate>>);
    );
}

/// Methods declared on superclass `NSObject`.
impl UIAccelerometer {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccelerometerdelegate?language=objc)
    #[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
    pub unsafe trait UIAccelerometerDelegate: NSObjectProtocol + MainThreadOnly {
        #[deprecated]
        #[optional]
        #[unsafe(method(accelerometer:didAccelerate:))]
        #[unsafe(method_family = none)]
        fn accelerometer_didAccelerate(
            &self,
            accelerometer: &UIAccelerometer,
            acceleration: &UIAcceleration,
        );
    }
);
