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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;
use crate::*;
extern_class!(
/// Abstract superclass for a template object.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cptemplate?language=objc)
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct CPTemplate;
);
extern_conformance!(
unsafe impl NSCoding for CPTemplate {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for CPTemplate {}
);
extern_conformance!(
unsafe impl NSSecureCoding for CPTemplate {}
);
impl CPTemplate {
extern_methods!(
/// Any custom data or an object associated with this template can be stored in this property.
#[unsafe(method(userInfo))]
#[unsafe(method_family = none)]
pub unsafe fn userInfo(&self) -> Option<Retained<AnyObject>>;
/// Setter for [`userInfo`][Self::userInfo].
///
/// # Safety
///
/// `user_info` should be of the correct type.
#[unsafe(method(setUserInfo:))]
#[unsafe(method_family = none)]
pub unsafe fn setUserInfo(&self, user_info: Option<&AnyObject>);
/// When this template is the first template displayed in a
/// `CPTabBarTemplate's`tab, the tab will inherit
/// the
/// `tabTitle`specified in this template.
///
///
/// Note: If no
/// `tabTitle`is specified, the tab will inherit the template's title, if any.
///
///
/// Note: Your template should specify either a
/// `tabSystemItem`OR both a
/// `tabImage`and
/// `tabTitle.`
#[unsafe(method(tabTitle))]
#[unsafe(method_family = none)]
pub unsafe fn tabTitle(&self) -> Option<Retained<NSString>>;
/// Setter for [`tabTitle`][Self::tabTitle].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setTabTitle:))]
#[unsafe(method_family = none)]
pub unsafe fn setTabTitle(&self, tab_title: Option<&NSString>);
#[cfg(feature = "objc2-ui-kit")]
/// When this template is the first template displayed in a
/// `CPTabBarTemplate's`tab, the tab will inherit
/// the image specified in this template. If a tabSystemItem is also specified, tabImage will take precedence.
///
///
/// Note: Your template should specify either a
/// `tabSystemItem`OR both a
/// `tabImage`and
/// `tabTitle.`
#[unsafe(method(tabImage))]
#[unsafe(method_family = none)]
pub unsafe fn tabImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "objc2-ui-kit")]
/// Setter for [`tabImage`][Self::tabImage].
#[unsafe(method(setTabImage:))]
#[unsafe(method_family = none)]
pub unsafe fn setTabImage(&self, tab_image: Option<&UIImage>);
#[cfg(feature = "objc2-ui-kit")]
/// When this template is the first template displayed in a
/// `CPTabBarTemplate's`tab, the tab will inherit
/// the system image AND system title specified in this template.
///
///
/// Note: Your template should specify either a
/// `tabSystemItem`OR both a
/// `tabImage`and
/// `tabTitle.`
#[unsafe(method(tabSystemItem))]
#[unsafe(method_family = none)]
pub unsafe fn tabSystemItem(&self) -> UITabBarSystemItem;
#[cfg(feature = "objc2-ui-kit")]
/// Setter for [`tabSystemItem`][Self::tabSystemItem].
#[unsafe(method(setTabSystemItem:))]
#[unsafe(method_family = none)]
pub unsafe fn setTabSystemItem(&self, tab_system_item: UITabBarSystemItem);
/// When this template is the first template displayed in a
/// `CPTabBarTemplate's`tab, the tab may optionally
/// display a badge indicator.
///
///
/// Note: This defaults to NO. Specify YES to display a badge indicator on this tab.
#[unsafe(method(showsTabBadge))]
#[unsafe(method_family = none)]
pub unsafe fn showsTabBadge(&self) -> bool;
/// Setter for [`showsTabBadge`][Self::showsTabBadge].
#[unsafe(method(setShowsTabBadge:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowsTabBadge(&self, shows_tab_badge: bool);
);
}
/// Methods declared on superclass `NSObject`.
impl CPTemplate {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}