objc2_car_play/generated/
CPInstrumentClusterController.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/// [Apple's documentation](https://developer.apple.com/documentation/carplay/cpinstrumentclustersetting?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct CPInstrumentClusterSetting(pub NSUInteger);
17impl CPInstrumentClusterSetting {
18    #[doc(alias = "CPInstrumentClusterSettingUnspecified")]
19    pub const Unspecified: Self = Self(0);
20    #[doc(alias = "CPInstrumentClusterSettingEnabled")]
21    pub const Enabled: Self = Self(1);
22    #[doc(alias = "CPInstrumentClusterSettingDisabled")]
23    pub const Disabled: Self = Self(2);
24    #[doc(alias = "CPInstrumentClusterSettingUserPreference")]
25    pub const UserPreference: Self = Self(3);
26}
27
28unsafe impl Encode for CPInstrumentClusterSetting {
29    const ENCODING: Encoding = NSUInteger::ENCODING;
30}
31
32unsafe impl RefEncode for CPInstrumentClusterSetting {
33    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36extern_class!(
37    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cpinstrumentclustercontroller?language=objc)
38    #[unsafe(super(NSObject))]
39    #[derive(Debug, PartialEq, Eq, Hash)]
40    pub struct CPInstrumentClusterController;
41);
42
43extern_conformance!(
44    unsafe impl NSObjectProtocol for CPInstrumentClusterController {}
45);
46
47impl CPInstrumentClusterController {
48    extern_methods!(
49        #[unsafe(method(init))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
52
53        #[unsafe(method(new))]
54        #[unsafe(method_family = new)]
55        pub unsafe fn new() -> Retained<Self>;
56
57        #[unsafe(method(delegate))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn delegate(
60            &self,
61        ) -> Option<Retained<ProtocolObject<dyn CPInstrumentClusterControllerDelegate>>>;
62
63        /// Setter for [`delegate`][Self::delegate].
64        ///
65        /// This is a [weak property][objc2::topics::weak_property].
66        #[unsafe(method(setDelegate:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn setDelegate(
69            &self,
70            delegate: Option<&ProtocolObject<dyn CPInstrumentClusterControllerDelegate>>,
71        );
72
73        #[cfg(feature = "objc2-ui-kit")]
74        /// The UIWindow created for this CPInstrumentClusterController
75        #[unsafe(method(instrumentClusterWindow))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn instrumentClusterWindow(
78            &self,
79            mtm: MainThreadMarker,
80        ) -> Option<Retained<UIWindow>>;
81
82        #[unsafe(method(speedLimitSetting))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn speedLimitSetting(&self) -> CPInstrumentClusterSetting;
85
86        #[unsafe(method(compassSetting))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn compassSetting(&self) -> CPInstrumentClusterSetting;
89
90        /// inactiveDescriptionVariants is an array of
91        /// `NSString`to be displayed when the user is not actively navigating,
92        /// arranged from most to least preferred.
93        #[unsafe(method(inactiveDescriptionVariants))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn inactiveDescriptionVariants(&self) -> Retained<NSArray<NSString>>;
96
97        /// Setter for [`inactiveDescriptionVariants`][Self::inactiveDescriptionVariants].
98        ///
99        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
100        #[unsafe(method(setInactiveDescriptionVariants:))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn setInactiveDescriptionVariants(
103            &self,
104            inactive_description_variants: &NSArray<NSString>,
105        );
106
107        /// attributedInactiveDescriptionVariants is an array of
108        /// `NSAttributedString`to be displayed when the user is not actively navigating,
109        /// arranged from most to least preferred.
110        ///
111        /// `attributedInactiveDescriptionVariants`will be preferred over inactiveDescriptionVariants.
112        ///
113        /// Only one type of attribute is presently supported: text attachments. You may annotate the string with images
114        /// by including one or more text attachments. The maximum text attachment image size is 64x25 points.
115        ///
116        ///
117        /// Warning: All attributes other than text attachment attributes will be removed from your attributed string.
118        ///
119        ///
120        /// See: +[NSAttributedString attributedStringWithAttachment:], -[NSTextAttachment image]
121        #[unsafe(method(attributedInactiveDescriptionVariants))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn attributedInactiveDescriptionVariants(
124            &self,
125        ) -> Retained<NSArray<NSAttributedString>>;
126
127        /// Setter for [`attributedInactiveDescriptionVariants`][Self::attributedInactiveDescriptionVariants].
128        ///
129        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
130        #[unsafe(method(setAttributedInactiveDescriptionVariants:))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn setAttributedInactiveDescriptionVariants(
133            &self,
134            attributed_inactive_description_variants: &NSArray<NSAttributedString>,
135        );
136    );
137}
138
139extern_protocol!(
140    /// [Apple's documentation](https://developer.apple.com/documentation/carplay/cpinstrumentclustercontrollerdelegate?language=objc)
141    pub unsafe trait CPInstrumentClusterControllerDelegate: NSObjectProtocol {
142        #[cfg(feature = "objc2-ui-kit")]
143        #[unsafe(method(instrumentClusterControllerDidConnectWindow:))]
144        #[unsafe(method_family = none)]
145        unsafe fn instrumentClusterControllerDidConnectWindow(
146            &self,
147            instrument_cluster_window: &UIWindow,
148        );
149
150        #[cfg(feature = "objc2-ui-kit")]
151        #[unsafe(method(instrumentClusterControllerDidDisconnectWindow:))]
152        #[unsafe(method_family = none)]
153        unsafe fn instrumentClusterControllerDidDisconnectWindow(
154            &self,
155            instrument_cluster_window: &UIWindow,
156        );
157
158        #[optional]
159        #[unsafe(method(instrumentClusterControllerDidZoomIn:))]
160        #[unsafe(method_family = none)]
161        unsafe fn instrumentClusterControllerDidZoomIn(
162            &self,
163            instrument_cluster_controller: &CPInstrumentClusterController,
164        );
165
166        #[optional]
167        #[unsafe(method(instrumentClusterControllerDidZoomOut:))]
168        #[unsafe(method_family = none)]
169        unsafe fn instrumentClusterControllerDidZoomOut(
170            &self,
171            instrument_cluster_controller: &CPInstrumentClusterController,
172        );
173
174        #[optional]
175        #[unsafe(method(instrumentClusterController:didChangeCompassSetting:))]
176        #[unsafe(method_family = none)]
177        unsafe fn instrumentClusterController_didChangeCompassSetting(
178            &self,
179            instrument_cluster_controller: &CPInstrumentClusterController,
180            compass_setting: CPInstrumentClusterSetting,
181        );
182
183        #[optional]
184        #[unsafe(method(instrumentClusterController:didChangeSpeedLimitSetting:))]
185        #[unsafe(method_family = none)]
186        unsafe fn instrumentClusterController_didChangeSpeedLimitSetting(
187            &self,
188            instrument_cluster_controller: &CPInstrumentClusterController,
189            speed_limit_setting: CPInstrumentClusterSetting,
190        );
191    }
192);