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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
#[cfg(feature = "block2")]
use block2::*;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MPRemoteCommandHandlerStatus(pub NSInteger);
impl MPRemoteCommandHandlerStatus {
    #[doc(alias = "MPRemoteCommandHandlerStatusSuccess")]
    pub const Success: Self = Self(0);
    #[doc(alias = "MPRemoteCommandHandlerStatusNoSuchContent")]
    pub const NoSuchContent: Self = Self(100);
    #[doc(alias = "MPRemoteCommandHandlerStatusNoActionableNowPlayingItem")]
    pub const NoActionableNowPlayingItem: Self = Self(110);
    #[doc(alias = "MPRemoteCommandHandlerStatusDeviceNotFound")]
    pub const DeviceNotFound: Self = Self(120);
    #[doc(alias = "MPRemoteCommandHandlerStatusCommandFailed")]
    pub const CommandFailed: Self = Self(200);
}

unsafe impl Encode for MPRemoteCommandHandlerStatus {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for MPRemoteCommandHandlerStatus {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MPRemoteCommand;

    unsafe impl ClassType for MPRemoteCommand {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for MPRemoteCommand {}

extern_methods!(
    unsafe impl MPRemoteCommand {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method(isEnabled)]
        pub unsafe fn isEnabled(&self) -> bool;

        #[method(setEnabled:)]
        pub unsafe fn setEnabled(&self, enabled: bool);

        #[method(addTarget:action:)]
        pub unsafe fn addTarget_action(&self, target: &AnyObject, action: Sel);

        #[method(removeTarget:action:)]
        pub unsafe fn removeTarget_action(&self, target: &AnyObject, action: Option<Sel>);

        #[method(removeTarget:)]
        pub unsafe fn removeTarget(&self, target: Option<&AnyObject>);

        #[cfg(all(feature = "MPRemoteCommandEvent", feature = "block2"))]
        #[method_id(@__retain_semantics Other addTargetWithHandler:)]
        pub unsafe fn addTargetWithHandler(
            &self,
            handler: &Block<dyn Fn(NonNull<MPRemoteCommandEvent>) -> MPRemoteCommandHandlerStatus>,
        ) -> Id<AnyObject>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MPSkipIntervalCommand;

    unsafe impl ClassType for MPSkipIntervalCommand {
        #[inherits(NSObject)]
        type Super = MPRemoteCommand;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for MPSkipIntervalCommand {}

extern_methods!(
    unsafe impl MPSkipIntervalCommand {
        #[method_id(@__retain_semantics Other preferredIntervals)]
        pub unsafe fn preferredIntervals(&self) -> Id<NSArray<NSNumber>>;

        #[method(setPreferredIntervals:)]
        pub unsafe fn setPreferredIntervals(&self, preferred_intervals: &NSArray<NSNumber>);
    }
);

extern_methods!(
    /// Methods declared on superclass `MPRemoteCommand`
    unsafe impl MPSkipIntervalCommand {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MPFeedbackCommand;

    unsafe impl ClassType for MPFeedbackCommand {
        #[inherits(NSObject)]
        type Super = MPRemoteCommand;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for MPFeedbackCommand {}

extern_methods!(
    unsafe impl MPFeedbackCommand {
        #[method(isActive)]
        pub unsafe fn isActive(&self) -> bool;

        #[method(setActive:)]
        pub unsafe fn setActive(&self, active: bool);

        #[method_id(@__retain_semantics Other localizedTitle)]
        pub unsafe fn localizedTitle(&self) -> Id<NSString>;

        #[method(setLocalizedTitle:)]
        pub unsafe fn setLocalizedTitle(&self, localized_title: &NSString);

        #[method_id(@__retain_semantics Other localizedShortTitle)]
        pub unsafe fn localizedShortTitle(&self) -> Id<NSString>;

        #[method(setLocalizedShortTitle:)]
        pub unsafe fn setLocalizedShortTitle(&self, localized_short_title: &NSString);
    }
);

extern_methods!(
    /// Methods declared on superclass `MPRemoteCommand`
    unsafe impl MPFeedbackCommand {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MPRatingCommand;

    unsafe impl ClassType for MPRatingCommand {
        #[inherits(NSObject)]
        type Super = MPRemoteCommand;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for MPRatingCommand {}

extern_methods!(
    unsafe impl MPRatingCommand {
        #[method(minimumRating)]
        pub unsafe fn minimumRating(&self) -> c_float;

        #[method(setMinimumRating:)]
        pub unsafe fn setMinimumRating(&self, minimum_rating: c_float);

        #[method(maximumRating)]
        pub unsafe fn maximumRating(&self) -> c_float;

        #[method(setMaximumRating:)]
        pub unsafe fn setMaximumRating(&self, maximum_rating: c_float);
    }
);

extern_methods!(
    /// Methods declared on superclass `MPRemoteCommand`
    unsafe impl MPRatingCommand {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MPChangePlaybackRateCommand;

    unsafe impl ClassType for MPChangePlaybackRateCommand {
        #[inherits(NSObject)]
        type Super = MPRemoteCommand;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for MPChangePlaybackRateCommand {}

extern_methods!(
    unsafe impl MPChangePlaybackRateCommand {
        #[method_id(@__retain_semantics Other supportedPlaybackRates)]
        pub unsafe fn supportedPlaybackRates(&self) -> Id<NSArray<NSNumber>>;

        #[method(setSupportedPlaybackRates:)]
        pub unsafe fn setSupportedPlaybackRates(
            &self,
            supported_playback_rates: &NSArray<NSNumber>,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `MPRemoteCommand`
    unsafe impl MPChangePlaybackRateCommand {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MPChangePlaybackPositionCommand;

    unsafe impl ClassType for MPChangePlaybackPositionCommand {
        #[inherits(NSObject)]
        type Super = MPRemoteCommand;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for MPChangePlaybackPositionCommand {}

extern_methods!(
    unsafe impl MPChangePlaybackPositionCommand {}
);

extern_methods!(
    /// Methods declared on superclass `MPRemoteCommand`
    unsafe impl MPChangePlaybackPositionCommand {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MPChangeShuffleModeCommand;

    unsafe impl ClassType for MPChangeShuffleModeCommand {
        #[inherits(NSObject)]
        type Super = MPRemoteCommand;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for MPChangeShuffleModeCommand {}

extern_methods!(
    unsafe impl MPChangeShuffleModeCommand {
        #[cfg(feature = "MPRemoteControlTypes")]
        #[method(currentShuffleType)]
        pub unsafe fn currentShuffleType(&self) -> MPShuffleType;

        #[cfg(feature = "MPRemoteControlTypes")]
        #[method(setCurrentShuffleType:)]
        pub unsafe fn setCurrentShuffleType(&self, current_shuffle_type: MPShuffleType);
    }
);

extern_methods!(
    /// Methods declared on superclass `MPRemoteCommand`
    unsafe impl MPChangeShuffleModeCommand {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MPChangeRepeatModeCommand;

    unsafe impl ClassType for MPChangeRepeatModeCommand {
        #[inherits(NSObject)]
        type Super = MPRemoteCommand;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for MPChangeRepeatModeCommand {}

extern_methods!(
    unsafe impl MPChangeRepeatModeCommand {
        #[cfg(feature = "MPRemoteControlTypes")]
        #[method(currentRepeatType)]
        pub unsafe fn currentRepeatType(&self) -> MPRepeatType;

        #[cfg(feature = "MPRemoteControlTypes")]
        #[method(setCurrentRepeatType:)]
        pub unsafe fn setCurrentRepeatType(&self, current_repeat_type: MPRepeatType);
    }
);

extern_methods!(
    /// Methods declared on superclass `MPRemoteCommand`
    unsafe impl MPChangeRepeatModeCommand {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);