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