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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
//! 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_class!(
/// This class represents a collection of action objects that can be executed.
/// The order of execution of these actions is undefined.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmactionset?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct HMActionSet;
);
unsafe impl Send for HMActionSet {}
unsafe impl Sync for HMActionSet {}
extern_conformance!(
unsafe impl NSObjectProtocol for HMActionSet {}
);
impl HMActionSet {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// The name of the action set.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Retained<NSString>;
#[cfg(feature = "HMAction")]
/// Set of HMAction objects that represent the individual items of the action set.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(actions))]
#[unsafe(method_family = none)]
pub unsafe fn actions(&self) -> Retained<NSSet<HMAction>>;
/// Specifies whether the action set is currently executing or not.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(isExecuting))]
#[unsafe(method_family = none)]
pub unsafe fn isExecuting(&self) -> bool;
/// Specifies the action set type - user-defined, trigger-owned or one of the builtin types.
/// Builtin action sets cannot be removed from the home. trigger-owned action sets cannot
/// be executed, renamed or associated with another trigger.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(actionSetType))]
#[unsafe(method_family = none)]
pub unsafe fn actionSetType(&self) -> Retained<NSString>;
/// A unique identifier for the action set.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(uniqueIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn uniqueIdentifier(&self) -> Retained<NSUUID>;
/// Specifies the last execution date for the action set.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(lastExecutionDate))]
#[unsafe(method_family = none)]
pub unsafe fn lastExecutionDate(&self) -> Option<Retained<NSDate>>;
#[cfg(all(feature = "HMDefines", feature = "block2"))]
/// This method is used to change the name of the action set.
///
///
/// Parameter `name`: New name for the action set.
///
///
/// Parameter `completion`: Block that is invoked once the request is processed.
/// The NSError provides more information on the status of the request, error
/// will be nil on success.
///
/// # Safety
///
/// `completion` must be a valid pointer.
#[unsafe(method(updateName:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn updateName_completionHandler(
&self,
name: &NSString,
completion: HMErrorBlock,
);
#[cfg(all(feature = "HMAction", feature = "HMDefines", feature = "block2"))]
/// Adds an action to the action set.
///
///
/// Parameter `action`: Action object to add to the action set.
///
///
/// Parameter `completion`: Block that is invoked once the request is processed.
/// The NSError provides more information on the status of the request, error
/// will be nil on success.
///
/// # Safety
///
/// `completion` must be a valid pointer.
#[unsafe(method(addAction:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn addAction_completionHandler(
&self,
action: &HMAction,
completion: HMErrorBlock,
);
#[cfg(all(feature = "HMAction", feature = "HMDefines", feature = "block2"))]
/// Removes an existing action from the action set.
///
///
/// Parameter `action`: Action object to remove from the action set.
///
///
/// Parameter `completion`: Block that is invoked once the request is processed.
/// The NSError provides more information on the status of the request, error
/// will be nil on success.
///
/// # Safety
///
/// `completion` must be a valid pointer.
#[unsafe(method(removeAction:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn removeAction_completionHandler(
&self,
action: &HMAction,
completion: HMErrorBlock,
);
);
}
/// Methods declared on superclass `NSObject`.
impl HMActionSet {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern "C" {
/// Builtin action set type for WakeUp.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmactionsettypewakeup?language=objc)
pub static HMActionSetTypeWakeUp: &'static NSString;
}
extern "C" {
/// Type for builtin action set Sleep.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmactionsettypesleep?language=objc)
pub static HMActionSetTypeSleep: &'static NSString;
}
extern "C" {
/// Type for builtin action set HomeDeparture.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmactionsettypehomedeparture?language=objc)
pub static HMActionSetTypeHomeDeparture: &'static NSString;
}
extern "C" {
/// Type for builtin action set HomeArrival.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmactionsettypehomearrival?language=objc)
pub static HMActionSetTypeHomeArrival: &'static NSString;
}
extern "C" {
/// Type for user-defined action sets.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmactionsettypeuserdefined?language=objc)
pub static HMActionSetTypeUserDefined: &'static NSString;
}
extern "C" {
/// Type for trigger-owned action sets.
///
///
/// An action set of this type is owned by a trigger and is not listed
/// as part of the home. An action set of this type cannot be executed,
/// renamed, or associated with a different trigger.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmactionsettypetriggerowned?language=objc)
pub static HMActionSetTypeTriggerOwned: &'static NSString;
}