use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
pub type CHHapticPatternKey = NSString;
extern "C" {
pub static CHHapticPatternKeyVersion: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyPattern: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyEvent: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyEventType: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyTime: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyEventDuration: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyEventWaveformPath: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyEventParameters: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyEventWaveformUseVolumeEnvelope: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyEventWaveformLoopEnabled: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyParameter: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyParameterID: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyParameterValue: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyParameterCurve: &'static CHHapticPatternKey;
}
extern "C" {
pub static CHHapticPatternKeyParameterCurveControlPoints: &'static CHHapticPatternKey;
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CHHapticPattern;
);
extern_conformance!(
unsafe impl NSObjectProtocol for CHHapticPattern {}
);
impl CHHapticPattern {
extern_methods!(
#[unsafe(method(duration))]
#[unsafe(method_family = none)]
pub unsafe fn duration(&self) -> NSTimeInterval;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Option<Retained<Self>>;
#[cfg(all(feature = "CHHapticEvent", feature = "CHHapticParameter"))]
#[unsafe(method(initWithEvents:parameters:error:_))]
#[unsafe(method_family = init)]
pub unsafe fn initWithEvents_parameters_error(
this: Allocated<Self>,
events: &NSArray<CHHapticEvent>,
parameters: &NSArray<CHHapticDynamicParameter>,
) -> Result<Retained<Self>, Retained<NSError>>;
#[cfg(all(feature = "CHHapticEvent", feature = "CHHapticParameter"))]
#[unsafe(method(initWithEvents:parameterCurves:error:_))]
#[unsafe(method_family = init)]
pub unsafe fn initWithEvents_parameterCurves_error(
this: Allocated<Self>,
events: &NSArray<CHHapticEvent>,
parameter_curves: &NSArray<CHHapticParameterCurve>,
) -> Result<Retained<Self>, Retained<NSError>>;
#[unsafe(method(initWithDictionary:error:_))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDictionary_error(
this: Allocated<Self>,
pattern_dict: &NSDictionary<CHHapticPatternKey, AnyObject>,
) -> Result<Retained<Self>, Retained<NSError>>;
#[unsafe(method(initWithContentsOfURL:error:_))]
#[unsafe(method_family = init)]
pub unsafe fn initWithContentsOfURL_error(
this: Allocated<Self>,
ahap_url: &NSURL,
) -> Result<Retained<Self>, Retained<NSError>>;
#[unsafe(method(exportDictionaryAndReturnError:_))]
#[unsafe(method_family = none)]
pub unsafe fn exportDictionaryAndReturnError(
&self,
) -> Result<Retained<NSDictionary<CHHapticPatternKey, AnyObject>>, Retained<NSError>>;
);
}
impl CHHapticPattern {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}