objc2_car_play/generated/
CPNowPlayingButton.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-ui-kit")]
10use objc2_ui_kit::*;
11
12use crate::*;
13
14extern "C" {
15 #[cfg(feature = "objc2-core-foundation")]
17 pub static CPNowPlayingButtonMaximumImageSize: CGSize;
18}
19
20extern_class!(
21 #[unsafe(super(NSObject))]
23 #[thread_kind = MainThreadOnly]
24 #[derive(Debug, PartialEq, Eq, Hash)]
25 pub struct CPNowPlayingButton;
26);
27
28extern_conformance!(
29 unsafe impl NSCoding for CPNowPlayingButton {}
30);
31
32extern_conformance!(
33 unsafe impl NSObjectProtocol for CPNowPlayingButton {}
34);
35
36extern_conformance!(
37 unsafe impl NSSecureCoding for CPNowPlayingButton {}
38);
39
40impl CPNowPlayingButton {
41 extern_methods!(
42 #[unsafe(method(new))]
43 #[unsafe(method_family = new)]
44 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
45
46 #[unsafe(method(init))]
47 #[unsafe(method_family = init)]
48 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
49
50 #[cfg(feature = "block2")]
51 #[unsafe(method(initWithHandler:))]
58 #[unsafe(method_family = init)]
59 pub unsafe fn initWithHandler(
60 this: Allocated<Self>,
61 handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPNowPlayingButton>)>>,
62 ) -> Retained<Self>;
63
64 #[unsafe(method(isEnabled))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn isEnabled(&self) -> bool;
74
75 #[unsafe(method(setEnabled:))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn setEnabled(&self, enabled: bool);
79
80 #[unsafe(method(isSelected))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn isSelected(&self) -> bool;
89
90 #[unsafe(method(setSelected:))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn setSelected(&self, selected: bool);
94 );
95}
96
97extern_class!(
98 #[unsafe(super(CPNowPlayingButton, NSObject))]
102 #[thread_kind = MainThreadOnly]
103 #[derive(Debug, PartialEq, Eq, Hash)]
104 pub struct CPNowPlayingShuffleButton;
105);
106
107extern_conformance!(
108 unsafe impl NSCoding for CPNowPlayingShuffleButton {}
109);
110
111extern_conformance!(
112 unsafe impl NSObjectProtocol for CPNowPlayingShuffleButton {}
113);
114
115extern_conformance!(
116 unsafe impl NSSecureCoding for CPNowPlayingShuffleButton {}
117);
118
119impl CPNowPlayingShuffleButton {
120 extern_methods!();
121}
122
123impl CPNowPlayingShuffleButton {
125 extern_methods!(
126 #[unsafe(method(new))]
127 #[unsafe(method_family = new)]
128 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
129
130 #[unsafe(method(init))]
131 #[unsafe(method_family = init)]
132 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
133
134 #[cfg(feature = "block2")]
135 #[unsafe(method(initWithHandler:))]
142 #[unsafe(method_family = init)]
143 pub unsafe fn initWithHandler(
144 this: Allocated<Self>,
145 handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPNowPlayingButton>)>>,
146 ) -> Retained<Self>;
147 );
148}
149
150extern_class!(
151 #[unsafe(super(CPNowPlayingButton, NSObject))]
156 #[thread_kind = MainThreadOnly]
157 #[derive(Debug, PartialEq, Eq, Hash)]
158 pub struct CPNowPlayingAddToLibraryButton;
159);
160
161extern_conformance!(
162 unsafe impl NSCoding for CPNowPlayingAddToLibraryButton {}
163);
164
165extern_conformance!(
166 unsafe impl NSObjectProtocol for CPNowPlayingAddToLibraryButton {}
167);
168
169extern_conformance!(
170 unsafe impl NSSecureCoding for CPNowPlayingAddToLibraryButton {}
171);
172
173impl CPNowPlayingAddToLibraryButton {
174 extern_methods!();
175}
176
177impl CPNowPlayingAddToLibraryButton {
179 extern_methods!(
180 #[unsafe(method(new))]
181 #[unsafe(method_family = new)]
182 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
183
184 #[unsafe(method(init))]
185 #[unsafe(method_family = init)]
186 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
187
188 #[cfg(feature = "block2")]
189 #[unsafe(method(initWithHandler:))]
196 #[unsafe(method_family = init)]
197 pub unsafe fn initWithHandler(
198 this: Allocated<Self>,
199 handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPNowPlayingButton>)>>,
200 ) -> Retained<Self>;
201 );
202}
203
204extern_class!(
205 #[unsafe(super(CPNowPlayingButton, NSObject))]
212 #[thread_kind = MainThreadOnly]
213 #[derive(Debug, PartialEq, Eq, Hash)]
214 pub struct CPNowPlayingMoreButton;
215);
216
217extern_conformance!(
218 unsafe impl NSCoding for CPNowPlayingMoreButton {}
219);
220
221extern_conformance!(
222 unsafe impl NSObjectProtocol for CPNowPlayingMoreButton {}
223);
224
225extern_conformance!(
226 unsafe impl NSSecureCoding for CPNowPlayingMoreButton {}
227);
228
229impl CPNowPlayingMoreButton {
230 extern_methods!();
231}
232
233impl CPNowPlayingMoreButton {
235 extern_methods!(
236 #[unsafe(method(new))]
237 #[unsafe(method_family = new)]
238 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
239
240 #[unsafe(method(init))]
241 #[unsafe(method_family = init)]
242 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
243
244 #[cfg(feature = "block2")]
245 #[unsafe(method(initWithHandler:))]
252 #[unsafe(method_family = init)]
253 pub unsafe fn initWithHandler(
254 this: Allocated<Self>,
255 handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPNowPlayingButton>)>>,
256 ) -> Retained<Self>;
257 );
258}
259
260extern_class!(
261 #[unsafe(super(CPNowPlayingButton, NSObject))]
266 #[thread_kind = MainThreadOnly]
267 #[derive(Debug, PartialEq, Eq, Hash)]
268 pub struct CPNowPlayingPlaybackRateButton;
269);
270
271extern_conformance!(
272 unsafe impl NSCoding for CPNowPlayingPlaybackRateButton {}
273);
274
275extern_conformance!(
276 unsafe impl NSObjectProtocol for CPNowPlayingPlaybackRateButton {}
277);
278
279extern_conformance!(
280 unsafe impl NSSecureCoding for CPNowPlayingPlaybackRateButton {}
281);
282
283impl CPNowPlayingPlaybackRateButton {
284 extern_methods!();
285}
286
287impl CPNowPlayingPlaybackRateButton {
289 extern_methods!(
290 #[unsafe(method(new))]
291 #[unsafe(method_family = new)]
292 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
293
294 #[unsafe(method(init))]
295 #[unsafe(method_family = init)]
296 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
297
298 #[cfg(feature = "block2")]
299 #[unsafe(method(initWithHandler:))]
306 #[unsafe(method_family = init)]
307 pub unsafe fn initWithHandler(
308 this: Allocated<Self>,
309 handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPNowPlayingButton>)>>,
310 ) -> Retained<Self>;
311 );
312}
313
314extern_class!(
315 #[unsafe(super(CPNowPlayingButton, NSObject))]
320 #[thread_kind = MainThreadOnly]
321 #[derive(Debug, PartialEq, Eq, Hash)]
322 pub struct CPNowPlayingRepeatButton;
323);
324
325extern_conformance!(
326 unsafe impl NSCoding for CPNowPlayingRepeatButton {}
327);
328
329extern_conformance!(
330 unsafe impl NSObjectProtocol for CPNowPlayingRepeatButton {}
331);
332
333extern_conformance!(
334 unsafe impl NSSecureCoding for CPNowPlayingRepeatButton {}
335);
336
337impl CPNowPlayingRepeatButton {
338 extern_methods!();
339}
340
341impl CPNowPlayingRepeatButton {
343 extern_methods!(
344 #[unsafe(method(new))]
345 #[unsafe(method_family = new)]
346 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
347
348 #[unsafe(method(init))]
349 #[unsafe(method_family = init)]
350 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
351
352 #[cfg(feature = "block2")]
353 #[unsafe(method(initWithHandler:))]
360 #[unsafe(method_family = init)]
361 pub unsafe fn initWithHandler(
362 this: Allocated<Self>,
363 handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPNowPlayingButton>)>>,
364 ) -> Retained<Self>;
365 );
366}
367
368extern_class!(
369 #[unsafe(super(CPNowPlayingButton, NSObject))]
374 #[thread_kind = MainThreadOnly]
375 #[derive(Debug, PartialEq, Eq, Hash)]
376 pub struct CPNowPlayingImageButton;
377);
378
379extern_conformance!(
380 unsafe impl NSCoding for CPNowPlayingImageButton {}
381);
382
383extern_conformance!(
384 unsafe impl NSObjectProtocol for CPNowPlayingImageButton {}
385);
386
387extern_conformance!(
388 unsafe impl NSSecureCoding for CPNowPlayingImageButton {}
389);
390
391impl CPNowPlayingImageButton {
392 extern_methods!(
393 #[cfg(all(feature = "block2", feature = "objc2-ui-kit"))]
394 #[unsafe(method(initWithImage:handler:))]
404 #[unsafe(method_family = init)]
405 pub unsafe fn initWithImage_handler(
406 this: Allocated<Self>,
407 image: &UIImage,
408 handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPNowPlayingButton>)>>,
409 ) -> Retained<Self>;
410
411 #[cfg(feature = "objc2-ui-kit")]
412 #[unsafe(method(image))]
417 #[unsafe(method_family = none)]
418 pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
419 );
420}
421
422impl CPNowPlayingImageButton {
424 extern_methods!(
425 #[unsafe(method(new))]
426 #[unsafe(method_family = new)]
427 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
428
429 #[unsafe(method(init))]
430 #[unsafe(method_family = init)]
431 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
432
433 #[cfg(feature = "block2")]
434 #[unsafe(method(initWithHandler:))]
441 #[unsafe(method_family = init)]
442 pub unsafe fn initWithHandler(
443 this: Allocated<Self>,
444 handler: Option<&block2::DynBlock<dyn Fn(NonNull<CPNowPlayingButton>)>>,
445 ) -> Retained<Self>;
446 );
447}