1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! 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_protocol!(
/// A protocol for querying mininum, maximum, and default values for a CHHapticEventParameter or CHHapticDynamicParameter.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/corehaptics/chhapticparameterattributes?language=objc)
pub unsafe trait CHHapticParameterAttributes: NSObjectProtocol {
/// The minimum value for the parameter.
#[unsafe(method(minValue))]
#[unsafe(method_family = none)]
unsafe fn minValue(&self) -> c_float;
/// The maximum value for the parameter.
#[unsafe(method(maxValue))]
#[unsafe(method_family = none)]
unsafe fn maxValue(&self) -> c_float;
/// The default value for the parameter.
#[unsafe(method(defaultValue))]
#[unsafe(method_family = none)]
unsafe fn defaultValue(&self) -> c_float;
}
);
extern_protocol!(
/// A protocol which defines properties describing haptics and audio capabilities for a particular device.
/// These properties include limitations and ranges of parameters.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/corehaptics/chhapticdevicecapability?language=objc)
pub unsafe trait CHHapticDeviceCapability {
/// Returns YES if the hardware supports haptic event playback.
#[unsafe(method(supportsHaptics))]
#[unsafe(method_family = none)]
unsafe fn supportsHaptics(&self) -> bool;
/// Returns YES if the hardware supports audio event playback.
#[unsafe(method(supportsAudio))]
#[unsafe(method_family = none)]
unsafe fn supportsAudio(&self) -> bool;
#[cfg(all(feature = "CHHapticEvent", feature = "CHHapticParameter"))]
/// Return information about the given CHHapticEventParameter as it applies to the specified event type.
///
/// Parameter `inParameter`: A CHHapticEventParameter to be queried.
///
/// Parameter `type`: A CHHapticEventType to be queried.
///
/// Parameter `outError`: If the operation fails, this will be set to a valid NSError describing the error.
///
/// These values may vary across different device types.
#[unsafe(method(attributesForEventParameter:eventType:error:_))]
#[unsafe(method_family = none)]
unsafe fn attributesForEventParameter_eventType_error(
&self,
in_parameter: &CHHapticEventParameterID,
r#type: &CHHapticEventType,
) -> Result<Retained<ProtocolObject<dyn CHHapticParameterAttributes>>, Retained<NSError>>;
#[cfg(feature = "CHHapticParameter")]
/// Return information about the given CHHapticDynamicParameter.
///
/// Parameter `inParameter`: A CHHapticDynamicParameter to be queried.
///
/// Parameter `outError`: If the operation fails, this will be set to a valid NSError describing the error.
///
/// These values may vary across different device types.
#[unsafe(method(attributesForDynamicParameter:error:_))]
#[unsafe(method_family = none)]
unsafe fn attributesForDynamicParameter_error(
&self,
in_parameter: &CHHapticDynamicParameterID,
) -> Result<Retained<ProtocolObject<dyn CHHapticParameterAttributes>>, Retained<NSError>>;
}
);