objc2_car_play/generated/
CPTemplate.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::*;
6use objc2_foundation::*;
7#[cfg(feature = "objc2-ui-kit")]
8use objc2_ui_kit::*;
9
10use crate::*;
11
12extern_class!(
13    /// Abstract superclass for a template object.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cptemplate?language=objc)
16    #[unsafe(super(NSObject))]
17    #[thread_kind = MainThreadOnly]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct CPTemplate;
20);
21
22extern_conformance!(
23    unsafe impl NSCoding for CPTemplate {}
24);
25
26extern_conformance!(
27    unsafe impl NSObjectProtocol for CPTemplate {}
28);
29
30extern_conformance!(
31    unsafe impl NSSecureCoding for CPTemplate {}
32);
33
34impl CPTemplate {
35    extern_methods!(
36        /// Any custom data or an object associated with this template can be stored in this property.
37        #[unsafe(method(userInfo))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn userInfo(&self) -> Option<Retained<AnyObject>>;
40
41        /// Setter for [`userInfo`][Self::userInfo].
42        ///
43        /// # Safety
44        ///
45        /// `user_info` should be of the correct type.
46        #[unsafe(method(setUserInfo:))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn setUserInfo(&self, user_info: Option<&AnyObject>);
49
50        /// When this template is the first template displayed in a
51        /// `CPTabBarTemplate's`tab, the tab will inherit
52        /// the
53        /// `tabTitle`specified in this template.
54        ///
55        ///
56        /// Note: If no
57        /// `tabTitle`is specified, the tab will inherit the template's title, if any.
58        ///
59        ///
60        /// Note: Your template should specify either a
61        /// `tabSystemItem`OR both a
62        /// `tabImage`and
63        /// `tabTitle.`
64        #[unsafe(method(tabTitle))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn tabTitle(&self) -> Option<Retained<NSString>>;
67
68        /// Setter for [`tabTitle`][Self::tabTitle].
69        ///
70        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
71        #[unsafe(method(setTabTitle:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn setTabTitle(&self, tab_title: Option<&NSString>);
74
75        #[cfg(feature = "objc2-ui-kit")]
76        /// When this template is the first template displayed in a
77        /// `CPTabBarTemplate's`tab, the tab will inherit
78        /// the image specified in this template. If a tabSystemItem is also specified, tabImage will take precedence.
79        ///
80        ///
81        /// Note: Your template should specify either a
82        /// `tabSystemItem`OR both a
83        /// `tabImage`and
84        /// `tabTitle.`
85        #[unsafe(method(tabImage))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn tabImage(&self) -> Option<Retained<UIImage>>;
88
89        #[cfg(feature = "objc2-ui-kit")]
90        /// Setter for [`tabImage`][Self::tabImage].
91        #[unsafe(method(setTabImage:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn setTabImage(&self, tab_image: Option<&UIImage>);
94
95        #[cfg(feature = "objc2-ui-kit")]
96        /// When this template is the first template displayed in a
97        /// `CPTabBarTemplate's`tab, the tab will inherit
98        /// the system image AND system title specified in this template.
99        ///
100        ///
101        /// Note: Your template should specify either a
102        /// `tabSystemItem`OR both a
103        /// `tabImage`and
104        /// `tabTitle.`
105        #[unsafe(method(tabSystemItem))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn tabSystemItem(&self) -> UITabBarSystemItem;
108
109        #[cfg(feature = "objc2-ui-kit")]
110        /// Setter for [`tabSystemItem`][Self::tabSystemItem].
111        #[unsafe(method(setTabSystemItem:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn setTabSystemItem(&self, tab_system_item: UITabBarSystemItem);
114
115        /// When this template is the first template displayed in a
116        /// `CPTabBarTemplate's`tab, the tab may optionally
117        /// display a badge indicator.
118        ///
119        ///
120        /// Note: This defaults to NO. Specify YES to display a badge indicator on this tab.
121        #[unsafe(method(showsTabBadge))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn showsTabBadge(&self) -> bool;
124
125        /// Setter for [`showsTabBadge`][Self::showsTabBadge].
126        #[unsafe(method(setShowsTabBadge:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn setShowsTabBadge(&self, shows_tab_badge: bool);
129    );
130}
131
132/// Methods declared on superclass `NSObject`.
133impl CPTemplate {
134    extern_methods!(
135        #[unsafe(method(init))]
136        #[unsafe(method_family = init)]
137        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
138
139        #[unsafe(method(new))]
140        #[unsafe(method_family = new)]
141        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
142    );
143}