objc2_car_play/generated/
CPGridTemplate.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern "C" {
13    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cpgridtemplatemaximumitems?language=objc)
14    pub static CPGridTemplateMaximumItems: NSUInteger;
15}
16
17extern_class!(
18    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cpgridtemplate?language=objc)
19    #[unsafe(super(CPTemplate, NSObject))]
20    #[thread_kind = MainThreadOnly]
21    #[derive(Debug, PartialEq, Eq, Hash)]
22    #[cfg(feature = "CPTemplate")]
23    pub struct CPGridTemplate;
24);
25
26#[cfg(all(feature = "CPBarButtonProviding", feature = "CPTemplate"))]
27extern_conformance!(
28    unsafe impl CPBarButtonProviding for CPGridTemplate {}
29);
30
31#[cfg(feature = "CPTemplate")]
32extern_conformance!(
33    unsafe impl NSCoding for CPGridTemplate {}
34);
35
36#[cfg(feature = "CPTemplate")]
37extern_conformance!(
38    unsafe impl NSObjectProtocol for CPGridTemplate {}
39);
40
41#[cfg(feature = "CPTemplate")]
42extern_conformance!(
43    unsafe impl NSSecureCoding for CPGridTemplate {}
44);
45
46#[cfg(feature = "CPTemplate")]
47impl CPGridTemplate {
48    extern_methods!(
49        #[cfg(feature = "CPGridButton")]
50        /// Initialize a grid template with an array of
51        /// `CPGridButton`and a title.
52        ///
53        ///
54        /// Parameter `title`: Title shown in template's navigation bar.
55        ///
56        /// Parameter `gridButtons`: A list of grid buttons on the template. The maximum button count is
57        /// `CPGridTemplateMaximumItems.`
58        /// Note: A grid template will only display the first
59        /// `CPGridTemplateMaximumItems`buttons in the provided
60        /// `gridButtons`array.
61        #[unsafe(method(initWithTitle:gridButtons:))]
62        #[unsafe(method_family = init)]
63        pub unsafe fn initWithTitle_gridButtons(
64            this: Allocated<Self>,
65            title: Option<&NSString>,
66            grid_buttons: &NSArray<CPGridButton>,
67        ) -> Retained<Self>;
68
69        #[unsafe(method(init))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
72
73        #[unsafe(method(new))]
74        #[unsafe(method_family = new)]
75        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
76
77        #[cfg(feature = "objc2-core-foundation")]
78        /// The expected image size for your
79        /// `CPGridButton.`
80        /// To properly size your list images, your app should size them to the display scale of the car screen.
81        /// See -[CPInterfaceController carTraitCollection].
82        #[unsafe(method(maximumGridButtonImageSize))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn maximumGridButtonImageSize(mtm: MainThreadMarker) -> CGSize;
85
86        #[cfg(feature = "CPGridButton")]
87        /// Array of grid buttons displayed on the template
88        #[unsafe(method(gridButtons))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn gridButtons(&self) -> Retained<NSArray<CPGridButton>>;
91
92        #[cfg(feature = "CPGridButton")]
93        /// Update the grid buttons displayed in this template, reloading
94        /// the view displaying these buttons.
95        #[unsafe(method(updateGridButtons:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn updateGridButtons(&self, grid_buttons: &NSArray<CPGridButton>);
98
99        /// Title shown in template's navigation bar
100        #[unsafe(method(title))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn title(&self) -> Retained<NSString>;
103
104        /// Update the title displayed in this template.
105        #[unsafe(method(updateTitle:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn updateTitle(&self, title: &NSString);
108    );
109}