use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
pub type CHHapticEventType = NSString;
extern "C" {
pub static CHHapticEventTypeHapticTransient: &'static CHHapticEventType;
}
extern "C" {
pub static CHHapticEventTypeHapticContinuous: &'static CHHapticEventType;
}
extern "C" {
pub static CHHapticEventTypeAudioContinuous: &'static CHHapticEventType;
}
extern "C" {
pub static CHHapticEventTypeAudioCustom: &'static CHHapticEventType;
}
pub type CHHapticAudioResourceID = NSUInteger;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CHHapticEvent;
);
extern_conformance!(
unsafe impl NSObjectProtocol for CHHapticEvent {}
);
impl CHHapticEvent {
extern_methods!(
#[unsafe(method(type))]
#[unsafe(method_family = none)]
pub unsafe fn r#type(&self) -> Retained<CHHapticEventType>;
#[cfg(feature = "CHHapticParameter")]
#[unsafe(method(eventParameters))]
#[unsafe(method_family = none)]
pub unsafe fn eventParameters(&self) -> Retained<NSArray<CHHapticEventParameter>>;
#[unsafe(method(relativeTime))]
#[unsafe(method_family = none)]
pub unsafe fn relativeTime(&self) -> NSTimeInterval;
#[unsafe(method(setRelativeTime:))]
#[unsafe(method_family = none)]
pub unsafe fn setRelativeTime(&self, relative_time: NSTimeInterval);
#[unsafe(method(duration))]
#[unsafe(method_family = none)]
pub unsafe fn duration(&self) -> NSTimeInterval;
#[unsafe(method(setDuration:))]
#[unsafe(method_family = none)]
pub unsafe fn setDuration(&self, duration: NSTimeInterval);
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Option<Retained<Self>>;
#[cfg(feature = "CHHapticParameter")]
#[unsafe(method(initWithEventType:parameters:relativeTime:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithEventType_parameters_relativeTime(
this: Allocated<Self>,
r#type: &CHHapticEventType,
event_params: &NSArray<CHHapticEventParameter>,
time: NSTimeInterval,
) -> Retained<Self>;
#[cfg(feature = "CHHapticParameter")]
#[unsafe(method(initWithEventType:parameters:relativeTime:duration:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithEventType_parameters_relativeTime_duration(
this: Allocated<Self>,
r#type: &CHHapticEventType,
event_params: &NSArray<CHHapticEventParameter>,
time: NSTimeInterval,
duration: NSTimeInterval,
) -> Retained<Self>;
#[cfg(feature = "CHHapticParameter")]
#[unsafe(method(initWithAudioResourceID:parameters:relativeTime:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithAudioResourceID_parameters_relativeTime(
this: Allocated<Self>,
res_id: CHHapticAudioResourceID,
event_params: &NSArray<CHHapticEventParameter>,
time: NSTimeInterval,
) -> Retained<Self>;
#[cfg(feature = "CHHapticParameter")]
#[unsafe(method(initWithAudioResourceID:parameters:relativeTime:duration:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithAudioResourceID_parameters_relativeTime_duration(
this: Allocated<Self>,
res_id: CHHapticAudioResourceID,
event_params: &NSArray<CHHapticEventParameter>,
time: NSTimeInterval,
duration: NSTimeInterval,
) -> Retained<Self>;
);
}
impl CHHapticEvent {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}