objc2_car_play/generated/
CPListImageRowItemCondensedElement.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
12/// Types of shape used to draw a condensed row element.
13///
14/// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cplistimagerowitemcondensedelementshape?language=objc)
15// NS_ENUM
16#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct CPListImageRowItemCondensedElementShape(pub NSInteger);
19impl CPListImageRowItemCondensedElementShape {
20    /// The list item will render an element with a circular image.
21    #[doc(alias = "CPListImageRowItemCondensedElementShapeCircular")]
22    pub const Circular: Self = Self(0);
23    /// The list item will render an element with a rounded rectangle image.
24    #[doc(alias = "CPListImageRowItemCondensedElementShapeRoundedRectangle")]
25    pub const RoundedRectangle: Self = Self(1);
26}
27
28unsafe impl Encode for CPListImageRowItemCondensedElementShape {
29    const ENCODING: Encoding = NSInteger::ENCODING;
30}
31
32unsafe impl RefEncode for CPListImageRowItemCondensedElementShape {
33    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36extern_class!(
37    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cplistimagerowitemcondensedelement?language=objc)
38    #[unsafe(super(CPListImageRowItemElement, NSObject))]
39    #[thread_kind = MainThreadOnly]
40    #[derive(Debug, PartialEq, Eq, Hash)]
41    #[cfg(feature = "CPListImageRowItemElement")]
42    pub struct CPListImageRowItemCondensedElement;
43);
44
45#[cfg(feature = "CPListImageRowItemElement")]
46extern_conformance!(
47    unsafe impl NSObjectProtocol for CPListImageRowItemCondensedElement {}
48);
49
50#[cfg(feature = "CPListImageRowItemElement")]
51impl CPListImageRowItemCondensedElement {
52    extern_methods!(
53        #[cfg(feature = "objc2-ui-kit")]
54        /// Initialize a list image row condensed element with an image, an image shape, a title, subtitle and a system symbol name.
55        ///
56        ///
57        /// Parameter `image`: The image associated to the element.
58        ///
59        /// Parameter `imageShape`: The
60        /// `CPListImageRowItemCondensedElementShape`shape being applied on the image.
61        ///
62        /// Parameter `title`: The title of the element.
63        ///
64        /// Parameter `subtitle`: The subtitle of the element.
65        ///
66        /// Parameter `accessorySymbolName`: The system symbol used as an accessory view.
67        #[unsafe(method(initWithImage:imageShape:title:subtitle:accessorySymbolName:))]
68        #[unsafe(method_family = init)]
69        pub unsafe fn initWithImage_imageShape_title_subtitle_accessorySymbolName(
70            this: Allocated<Self>,
71            image: &UIImage,
72            image_shape: CPListImageRowItemCondensedElementShape,
73            title: &NSString,
74            subtitle: Option<&NSString>,
75            accessory_symbol_name: Option<&NSString>,
76        ) -> Retained<Self>;
77
78        /// The title associated with this element.
79        #[unsafe(method(title))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn title(&self) -> Retained<NSString>;
82
83        /// Setter for [`title`][Self::title].
84        ///
85        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
86        #[unsafe(method(setTitle:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn setTitle(&self, title: &NSString);
89
90        /// The subtitle associated with this element.
91        #[unsafe(method(subtitle))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn subtitle(&self) -> Option<Retained<NSString>>;
94
95        /// Setter for [`subtitle`][Self::subtitle].
96        ///
97        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
98        #[unsafe(method(setSubtitle:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn setSubtitle(&self, subtitle: Option<&NSString>);
101
102        /// The name of the system symbol image to use as accessory.
103        #[unsafe(method(accessorySymbolName))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn accessorySymbolName(&self) -> Option<Retained<NSString>>;
106
107        /// Setter for [`accessorySymbolName`][Self::accessorySymbolName].
108        ///
109        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
110        #[unsafe(method(setAccessorySymbolName:))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn setAccessorySymbolName(&self, accessory_symbol_name: Option<&NSString>);
113
114        /// Shape used to draw the image of the element.
115        #[unsafe(method(imageShape))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn imageShape(&self) -> CPListImageRowItemCondensedElementShape;
118    );
119}
120
121/// Methods declared on superclass `CPListImageRowItemElement`.
122#[cfg(feature = "CPListImageRowItemElement")]
123impl CPListImageRowItemCondensedElement {
124    extern_methods!(
125        #[unsafe(method(init))]
126        #[unsafe(method_family = init)]
127        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
128    );
129}
130
131/// Methods declared on superclass `NSObject`.
132#[cfg(feature = "CPListImageRowItemElement")]
133impl CPListImageRowItemCondensedElement {
134    extern_methods!(
135        #[unsafe(method(new))]
136        #[unsafe(method_family = new)]
137        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
138    );
139}