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
//! 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::*;
/// Types of shape used to draw a list item.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cplistimagerowitemimagegridelementshape?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CPListImageRowItemImageGridElementShape(pub NSInteger);
impl CPListImageRowItemImageGridElementShape {
/// The list item will render a row of elements.
#[doc(alias = "CPListImageRowItemImageGridElementShapeCircular")]
pub const Circular: Self = Self(0);
/// The list item will render a condensed list of rounded rectangle elements.
#[doc(alias = "CPListImageRowItemImageGridElementShapeRoundedRectangle")]
pub const RoundedRectangle: Self = Self(1);
}
unsafe impl Encode for CPListImageRowItemImageGridElementShape {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for CPListImageRowItemImageGridElementShape {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/carplay/cplistimagerowitemimagegridelement?language=objc)
#[unsafe(super(CPListImageRowItemElement, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "CPListImageRowItemElement")]
pub struct CPListImageRowItemImageGridElement;
);
#[cfg(feature = "CPListImageRowItemElement")]
extern_conformance!(
unsafe impl NSObjectProtocol for CPListImageRowItemImageGridElement {}
);
#[cfg(feature = "CPListImageRowItemElement")]
impl CPListImageRowItemImageGridElement {
extern_methods!(
#[cfg(feature = "objc2-ui-kit")]
/// Initialize an element that is constituted of an image and an image shape.
///
/// When providing an image, your app should provide a
/// `UIImage`that is display-ready. If necessary for the image, provide
/// light and dark styles by using an asset from your asset catalog, prepared with light and dark styles
/// or by using
/// `UIImageAsset`to combine two
/// `UIImage`instances into a single image with
/// both styles.
///
/// UIImageAsset is used to combine multiple UIImages with different trait collections into a single UIImage.
///
///
/// Note: The expected image size is given by +[CPListImageRowItemImageGridElement maximumImageSize]. Images provided will be resized to this size if necessary.
///
///
/// To properly size your images, your app should size them to the display scale of the car screen.
/// See -[CPInterfaceController carTraitCollection].
///
///
/// Parameter `image`: The image associated to the element.
///
/// Parameter `imageShape`: The
/// `CPListImageRowItemImageGridElementShape`shape being applied on the image.
///
/// Parameter `title`: The title of the element.
///
/// Parameter `accessorySymbolName`: The system symbol used as an accessory view.
#[unsafe(method(initWithImage:imageShape:title:accessorySymbolName:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithImage_imageShape_title_accessorySymbolName(
this: Allocated<Self>,
image: &UIImage,
image_shape: CPListImageRowItemImageGridElementShape,
title: &NSString,
accessory_symbol_name: Option<&NSString>,
) -> Retained<Self>;
/// The title associated with this element.
#[unsafe(method(title))]
#[unsafe(method_family = none)]
pub unsafe fn title(&self) -> Retained<NSString>;
/// Setter for [`title`][Self::title].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setTitle:))]
#[unsafe(method_family = none)]
pub unsafe fn setTitle(&self, title: &NSString);
/// The name of the system symbol image to use as accessory.
#[unsafe(method(accessorySymbolName))]
#[unsafe(method_family = none)]
pub unsafe fn accessorySymbolName(&self) -> Option<Retained<NSString>>;
/// Setter for [`accessorySymbolName`][Self::accessorySymbolName].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setAccessorySymbolName:))]
#[unsafe(method_family = none)]
pub unsafe fn setAccessorySymbolName(&self, accessory_symbol_name: Option<&NSString>);
/// Shape used to draw the image of the element.
#[unsafe(method(imageShape))]
#[unsafe(method_family = none)]
pub unsafe fn imageShape(&self) -> CPListImageRowItemImageGridElementShape;
);
}
/// Methods declared on superclass `CPListImageRowItemElement`.
#[cfg(feature = "CPListImageRowItemElement")]
impl CPListImageRowItemImageGridElement {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(feature = "CPListImageRowItemElement")]
impl CPListImageRowItemImageGridElement {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}