objc2_home_kit/generated/
HMCharacteristicThresholdRangeEvent.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// This class represents an event when a characteristic's value falls within the specified
12    /// number range.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcharacteristicthresholdrangeevent?language=objc)
15    #[unsafe(super(HMEvent, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "HMEvent")]
18    pub struct HMCharacteristicThresholdRangeEvent;
19);
20
21#[cfg(feature = "HMEvent")]
22unsafe impl Send for HMCharacteristicThresholdRangeEvent {}
23
24#[cfg(feature = "HMEvent")]
25unsafe impl Sync for HMCharacteristicThresholdRangeEvent {}
26
27#[cfg(feature = "HMEvent")]
28unsafe impl NSCopying for HMCharacteristicThresholdRangeEvent {}
29
30#[cfg(feature = "HMEvent")]
31unsafe impl CopyingHelper for HMCharacteristicThresholdRangeEvent {
32    type Result = Self;
33}
34
35#[cfg(feature = "HMEvent")]
36unsafe impl NSMutableCopying for HMCharacteristicThresholdRangeEvent {}
37
38#[cfg(feature = "HMEvent")]
39unsafe impl MutableCopyingHelper for HMCharacteristicThresholdRangeEvent {
40    type Result = HMMutableCharacteristicThresholdRangeEvent;
41}
42
43#[cfg(feature = "HMEvent")]
44unsafe impl NSObjectProtocol for HMCharacteristicThresholdRangeEvent {}
45
46#[cfg(feature = "HMEvent")]
47impl HMCharacteristicThresholdRangeEvent {
48    extern_methods!(
49        #[unsafe(method(init))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
52
53        #[cfg(all(feature = "HMCharacteristic", feature = "HMNumberRange"))]
54        /// Initializes a new characteristic number range event object
55        ///
56        ///
57        /// Parameter `characteristic`: The characteristic bound to the event. The characteristic must
58        /// support notification. An exception will be thrown otherwise.
59        ///
60        ///
61        /// Parameter `thresholdRange`: The range for the characteristic value to trigger the event.
62        ///
63        ///
64        /// Returns: Instance object representing the characteristic event.
65        #[unsafe(method(initWithCharacteristic:thresholdRange:))]
66        #[unsafe(method_family = init)]
67        pub unsafe fn initWithCharacteristic_thresholdRange(
68            this: Allocated<Self>,
69            characteristic: &HMCharacteristic,
70            threshold_range: &HMNumberRange,
71        ) -> Retained<Self>;
72
73        #[cfg(feature = "HMCharacteristic")]
74        /// The characteristic associated with the event.
75        #[unsafe(method(characteristic))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn characteristic(&self) -> Retained<HMCharacteristic>;
78
79        #[cfg(feature = "HMNumberRange")]
80        /// The range of the characteristic value that triggers the event.
81        #[unsafe(method(thresholdRange))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn thresholdRange(&self) -> Retained<HMNumberRange>;
84    );
85}
86
87/// Methods declared on superclass `HMEvent`.
88#[cfg(feature = "HMEvent")]
89impl HMCharacteristicThresholdRangeEvent {
90    extern_methods!(
91        #[deprecated = "HMEvent is abstract"]
92        #[unsafe(method(new))]
93        #[unsafe(method_family = new)]
94        pub unsafe fn new() -> Retained<Self>;
95    );
96}
97
98extern_class!(
99    /// This class represents an event when a characteristic's value falls within the specified
100    /// number range.
101    ///
102    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmmutablecharacteristicthresholdrangeevent?language=objc)
103    #[unsafe(super(HMCharacteristicThresholdRangeEvent, HMEvent, NSObject))]
104    #[derive(Debug, PartialEq, Eq, Hash)]
105    #[cfg(feature = "HMEvent")]
106    pub struct HMMutableCharacteristicThresholdRangeEvent;
107);
108
109#[cfg(feature = "HMEvent")]
110unsafe impl Send for HMMutableCharacteristicThresholdRangeEvent {}
111
112#[cfg(feature = "HMEvent")]
113unsafe impl Sync for HMMutableCharacteristicThresholdRangeEvent {}
114
115#[cfg(feature = "HMEvent")]
116unsafe impl NSCopying for HMMutableCharacteristicThresholdRangeEvent {}
117
118#[cfg(feature = "HMEvent")]
119unsafe impl CopyingHelper for HMMutableCharacteristicThresholdRangeEvent {
120    type Result = HMCharacteristicThresholdRangeEvent;
121}
122
123#[cfg(feature = "HMEvent")]
124unsafe impl NSMutableCopying for HMMutableCharacteristicThresholdRangeEvent {}
125
126#[cfg(feature = "HMEvent")]
127unsafe impl MutableCopyingHelper for HMMutableCharacteristicThresholdRangeEvent {
128    type Result = Self;
129}
130
131#[cfg(feature = "HMEvent")]
132unsafe impl NSObjectProtocol for HMMutableCharacteristicThresholdRangeEvent {}
133
134#[cfg(feature = "HMEvent")]
135impl HMMutableCharacteristicThresholdRangeEvent {
136    extern_methods!(
137        #[unsafe(method(init))]
138        #[unsafe(method_family = init)]
139        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
140
141        #[cfg(feature = "HMCharacteristic")]
142        /// The characteristic associated with the event.
143        #[unsafe(method(characteristic))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn characteristic(&self) -> Retained<HMCharacteristic>;
146
147        #[cfg(feature = "HMCharacteristic")]
148        /// Setter for [`characteristic`][Self::characteristic].
149        #[unsafe(method(setCharacteristic:))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn setCharacteristic(&self, characteristic: &HMCharacteristic);
152
153        #[cfg(feature = "HMNumberRange")]
154        /// The range of the characteristic value that triggers the event.
155        #[unsafe(method(thresholdRange))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn thresholdRange(&self) -> Retained<HMNumberRange>;
158
159        #[cfg(feature = "HMNumberRange")]
160        /// Setter for [`thresholdRange`][Self::thresholdRange].
161        #[unsafe(method(setThresholdRange:))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn setThresholdRange(&self, threshold_range: &HMNumberRange);
164    );
165}
166
167/// Methods declared on superclass `HMCharacteristicThresholdRangeEvent`.
168#[cfg(feature = "HMEvent")]
169impl HMMutableCharacteristicThresholdRangeEvent {
170    extern_methods!(
171        #[cfg(all(feature = "HMCharacteristic", feature = "HMNumberRange"))]
172        /// Initializes a new characteristic number range event object
173        ///
174        ///
175        /// Parameter `characteristic`: The characteristic bound to the event. The characteristic must
176        /// support notification. An exception will be thrown otherwise.
177        ///
178        ///
179        /// Parameter `thresholdRange`: The range for the characteristic value to trigger the event.
180        ///
181        ///
182        /// Returns: Instance object representing the characteristic event.
183        #[unsafe(method(initWithCharacteristic:thresholdRange:))]
184        #[unsafe(method_family = init)]
185        pub unsafe fn initWithCharacteristic_thresholdRange(
186            this: Allocated<Self>,
187            characteristic: &HMCharacteristic,
188            threshold_range: &HMNumberRange,
189        ) -> Retained<Self>;
190    );
191}
192
193/// Methods declared on superclass `HMEvent`.
194#[cfg(feature = "HMEvent")]
195impl HMMutableCharacteristicThresholdRangeEvent {
196    extern_methods!(
197        #[deprecated = "HMEvent is abstract"]
198        #[unsafe(method(new))]
199        #[unsafe(method_family = new)]
200        pub unsafe fn new() -> Retained<Self>;
201    );
202}