objc2_car_play/generated/
CPListTemplate.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
10use crate::*;
11
12#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct CPAssistantCellActionType(pub NSInteger);
17impl CPAssistantCellActionType {
18 #[doc(alias = "CPAssistantCellActionTypePlayMedia")]
19 pub const PlayMedia: Self = Self(0);
20 #[doc(alias = "CPAssistantCellActionTypeStartCall")]
21 pub const StartCall: Self = Self(1);
22}
23
24unsafe impl Encode for CPAssistantCellActionType {
25 const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for CPAssistantCellActionType {
29 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32#[repr(transparent)]
35#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
36pub struct CPAssistantCellVisibility(pub NSInteger);
37impl CPAssistantCellVisibility {
38 #[doc(alias = "CPAssistantCellVisibilityOff")]
39 pub const Off: Self = Self(0);
40 #[doc(alias = "CPAssistantCellVisibilityWhileLimitedUIActive")]
41 pub const WhileLimitedUIActive: Self = Self(1);
42 #[doc(alias = "CPAssistantCellVisibilityAlways")]
43 pub const Always: Self = Self(2);
44}
45
46unsafe impl Encode for CPAssistantCellVisibility {
47 const ENCODING: Encoding = NSInteger::ENCODING;
48}
49
50unsafe impl RefEncode for CPAssistantCellVisibility {
51 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
52}
53
54#[repr(transparent)]
57#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
58pub struct CPAssistantCellPosition(pub NSInteger);
59impl CPAssistantCellPosition {
60 #[doc(alias = "CPAssistantCellPositionTop")]
61 pub const Top: Self = Self(0);
62 #[doc(alias = "CPAssistantCellPositionBottom")]
63 pub const Bottom: Self = Self(1);
64}
65
66unsafe impl Encode for CPAssistantCellPosition {
67 const ENCODING: Encoding = NSInteger::ENCODING;
68}
69
70unsafe impl RefEncode for CPAssistantCellPosition {
71 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
72}
73
74extern_class!(
75 #[unsafe(super(NSObject))]
82 #[derive(Debug, PartialEq, Eq, Hash)]
83 pub struct CPAssistantCellConfiguration;
84);
85
86extern_conformance!(
87 unsafe impl NSCoding for CPAssistantCellConfiguration {}
88);
89
90extern_conformance!(
91 unsafe impl NSObjectProtocol for CPAssistantCellConfiguration {}
92);
93
94extern_conformance!(
95 unsafe impl NSSecureCoding for CPAssistantCellConfiguration {}
96);
97
98impl CPAssistantCellConfiguration {
99 extern_methods!(
100 #[unsafe(method(initWithPosition:visibility:assistantAction:))]
102 #[unsafe(method_family = init)]
103 pub unsafe fn initWithPosition_visibility_assistantAction(
104 this: Allocated<Self>,
105 position: CPAssistantCellPosition,
106 visibility: CPAssistantCellVisibility,
107 assistant_action: CPAssistantCellActionType,
108 ) -> Retained<Self>;
109
110 #[unsafe(method(position))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn position(&self) -> CPAssistantCellPosition;
118
119 #[unsafe(method(visibility))]
125 #[unsafe(method_family = none)]
126 pub unsafe fn visibility(&self) -> CPAssistantCellVisibility;
127
128 #[unsafe(method(assistantAction))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn assistantAction(&self) -> CPAssistantCellActionType;
132 );
133}
134
135impl CPAssistantCellConfiguration {
137 extern_methods!(
138 #[unsafe(method(init))]
139 #[unsafe(method_family = init)]
140 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
141
142 #[unsafe(method(new))]
143 #[unsafe(method_family = new)]
144 pub unsafe fn new() -> Retained<Self>;
145 );
146}
147
148extern_class!(
149 #[unsafe(super(CPTemplate, NSObject))]
151 #[thread_kind = MainThreadOnly]
152 #[derive(Debug, PartialEq, Eq, Hash)]
153 #[cfg(feature = "CPTemplate")]
154 pub struct CPListTemplate;
155);
156
157#[cfg(all(feature = "CPBarButtonProviding", feature = "CPTemplate"))]
158extern_conformance!(
159 unsafe impl CPBarButtonProviding for CPListTemplate {}
160);
161
162#[cfg(feature = "CPTemplate")]
163extern_conformance!(
164 unsafe impl NSCoding for CPListTemplate {}
165);
166
167#[cfg(feature = "CPTemplate")]
168extern_conformance!(
169 unsafe impl NSObjectProtocol for CPListTemplate {}
170);
171
172#[cfg(feature = "CPTemplate")]
173extern_conformance!(
174 unsafe impl NSSecureCoding for CPListTemplate {}
175);
176
177#[cfg(feature = "CPTemplate")]
178impl CPListTemplate {
179 extern_methods!(
180 #[unsafe(method(init))]
181 #[unsafe(method_family = init)]
182 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
183
184 #[unsafe(method(new))]
185 #[unsafe(method_family = new)]
186 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
187
188 #[cfg(feature = "CPListSection")]
189 #[unsafe(method(initWithTitle:sections:))]
191 #[unsafe(method_family = init)]
192 pub unsafe fn initWithTitle_sections(
193 this: Allocated<Self>,
194 title: Option<&NSString>,
195 sections: &NSArray<CPListSection>,
196 ) -> Retained<Self>;
197
198 #[cfg(feature = "CPListSection")]
199 #[unsafe(method(initWithTitle:sections:assistantCellConfiguration:))]
211 #[unsafe(method_family = init)]
212 pub unsafe fn initWithTitle_sections_assistantCellConfiguration(
213 this: Allocated<Self>,
214 title: Option<&NSString>,
215 sections: &NSArray<CPListSection>,
216 assistant_cell_configuration: Option<&CPAssistantCellConfiguration>,
217 ) -> Retained<Self>;
218
219 #[cfg(all(feature = "CPGridButton", feature = "CPListSection"))]
220 #[unsafe(method(initWithTitle:sections:assistantCellConfiguration:headerGridButtons:))]
222 #[unsafe(method_family = init)]
223 pub unsafe fn initWithTitle_sections_assistantCellConfiguration_headerGridButtons(
224 this: Allocated<Self>,
225 title: Option<&NSString>,
226 sections: &NSArray<CPListSection>,
227 assistant_cell_configuration: Option<&CPAssistantCellConfiguration>,
228 header_grid_buttons: Option<&NSArray<CPGridButton>>,
229 ) -> Retained<Self>;
230
231 #[deprecated]
233 #[unsafe(method(delegate))]
234 #[unsafe(method_family = none)]
235 pub unsafe fn delegate(
236 &self,
237 ) -> Option<Retained<ProtocolObject<dyn CPListTemplateDelegate>>>;
238
239 #[deprecated]
243 #[unsafe(method(setDelegate:))]
244 #[unsafe(method_family = none)]
245 pub unsafe fn setDelegate(
246 &self,
247 delegate: Option<&ProtocolObject<dyn CPListTemplateDelegate>>,
248 );
249
250 #[unsafe(method(maximumItemCount))]
256 #[unsafe(method_family = none)]
257 pub unsafe fn maximumItemCount(mtm: MainThreadMarker) -> NSUInteger;
258
259 #[unsafe(method(maximumSectionCount))]
265 #[unsafe(method_family = none)]
266 pub unsafe fn maximumSectionCount(mtm: MainThreadMarker) -> NSUInteger;
267
268 #[cfg(feature = "CPListSection")]
269 #[unsafe(method(sections))]
271 #[unsafe(method_family = none)]
272 pub unsafe fn sections(&self) -> Retained<NSArray<CPListSection>>;
273
274 #[unsafe(method(title))]
276 #[unsafe(method_family = none)]
277 pub unsafe fn title(&self) -> Option<Retained<NSString>>;
278
279 #[cfg(feature = "CPListSection")]
280 #[unsafe(method(updateSections:))]
283 #[unsafe(method_family = none)]
284 pub unsafe fn updateSections(&self, sections: &NSArray<CPListSection>);
285
286 #[unsafe(method(sectionCount))]
288 #[unsafe(method_family = none)]
289 pub unsafe fn sectionCount(&self) -> NSUInteger;
290
291 #[unsafe(method(itemCount))]
293 #[unsafe(method_family = none)]
294 pub unsafe fn itemCount(&self) -> NSUInteger;
295
296 #[cfg(feature = "CPListItemTypes")]
297 #[unsafe(method(indexPathForItem:))]
301 #[unsafe(method_family = none)]
302 pub unsafe fn indexPathForItem(
303 &self,
304 item: &ProtocolObject<dyn CPListTemplateItem>,
305 ) -> Option<Retained<NSIndexPath>>;
306
307 #[unsafe(method(emptyViewTitleVariants))]
318 #[unsafe(method_family = none)]
319 pub unsafe fn emptyViewTitleVariants(&self) -> Retained<NSArray<NSString>>;
320
321 #[unsafe(method(setEmptyViewTitleVariants:))]
325 #[unsafe(method_family = none)]
326 pub unsafe fn setEmptyViewTitleVariants(
327 &self,
328 empty_view_title_variants: &NSArray<NSString>,
329 );
330
331 #[unsafe(method(emptyViewSubtitleVariants))]
342 #[unsafe(method_family = none)]
343 pub unsafe fn emptyViewSubtitleVariants(&self) -> Retained<NSArray<NSString>>;
344
345 #[unsafe(method(setEmptyViewSubtitleVariants:))]
349 #[unsafe(method_family = none)]
350 pub unsafe fn setEmptyViewSubtitleVariants(
351 &self,
352 empty_view_subtitle_variants: &NSArray<NSString>,
353 );
354
355 #[unsafe(method(showsSpinnerWhileEmpty))]
360 #[unsafe(method_family = none)]
361 pub unsafe fn showsSpinnerWhileEmpty(&self) -> bool;
362
363 #[unsafe(method(setShowsSpinnerWhileEmpty:))]
365 #[unsafe(method_family = none)]
366 pub unsafe fn setShowsSpinnerWhileEmpty(&self, shows_spinner_while_empty: bool);
367
368 #[unsafe(method(assistantCellConfiguration))]
381 #[unsafe(method_family = none)]
382 pub unsafe fn assistantCellConfiguration(
383 &self,
384 ) -> Option<Retained<CPAssistantCellConfiguration>>;
385
386 #[unsafe(method(setAssistantCellConfiguration:))]
388 #[unsafe(method_family = none)]
389 pub unsafe fn setAssistantCellConfiguration(
390 &self,
391 assistant_cell_configuration: Option<&CPAssistantCellConfiguration>,
392 );
393
394 #[unsafe(method(maximumHeaderGridButtonCount))]
400 #[unsafe(method_family = none)]
401 pub unsafe fn maximumHeaderGridButtonCount(mtm: MainThreadMarker) -> NSUInteger;
402
403 #[cfg(feature = "objc2-core-foundation")]
404 #[unsafe(method(maximumGridButtonImageSize))]
409 #[unsafe(method_family = none)]
410 pub unsafe fn maximumGridButtonImageSize(mtm: MainThreadMarker) -> CGSize;
411
412 #[cfg(feature = "CPGridButton")]
413 #[unsafe(method(headerGridButtons))]
415 #[unsafe(method_family = none)]
416 pub unsafe fn headerGridButtons(&self) -> Option<Retained<NSArray<CPGridButton>>>;
417
418 #[cfg(feature = "CPGridButton")]
419 #[unsafe(method(setHeaderGridButtons:))]
423 #[unsafe(method_family = none)]
424 pub unsafe fn setHeaderGridButtons(
425 &self,
426 header_grid_buttons: Option<&NSArray<CPGridButton>>,
427 );
428 );
429}
430
431extern_protocol!(
432 #[deprecated]
434 pub unsafe trait CPListTemplateDelegate: NSObjectProtocol {
435 #[cfg(all(feature = "CPListItem", feature = "CPTemplate", feature = "block2"))]
436 #[deprecated]
450 #[unsafe(method(listTemplate:didSelectListItem:completionHandler:))]
451 #[unsafe(method_family = none)]
452 unsafe fn listTemplate_didSelectListItem_completionHandler(
453 &self,
454 list_template: &CPListTemplate,
455 item: &CPListItem,
456 completion_handler: &block2::DynBlock<dyn Fn()>,
457 );
458 }
459);