use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[deprecated = "UIAcceleration has been replaced by the CoreMotion framework"]
pub type UIAccelerationValue = c_double;
extern_class!(
#[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;
);
}
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!(
#[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;
#[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>>>;
#[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>>);
);
}
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!(
#[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,
);
}
);