objc2_car_play/generated/
CPLane.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
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/carplay/cplanestatus?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct CPLaneStatus(pub NSInteger);
15impl CPLaneStatus {
16    #[doc(alias = "CPLaneStatusNotGood")]
17    pub const NotGood: Self = Self(0);
18    #[doc(alias = "CPLaneStatusGood")]
19    pub const Good: Self = Self(1);
20    #[doc(alias = "CPLaneStatusPreferred")]
21    pub const Preferred: Self = Self(2);
22}
23
24unsafe impl Encode for CPLaneStatus {
25    const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for CPLaneStatus {
29    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32extern_class!(
33    /// `CPLane`represents information about a single lane.
34    ///
35    /// See also [Apple's documentation](https://developer.apple.com/documentation/carplay/cplane?language=objc)
36    #[unsafe(super(NSObject))]
37    #[derive(Debug, PartialEq, Eq, Hash)]
38    pub struct CPLane;
39);
40
41extern_conformance!(
42    unsafe impl NSCoding for CPLane {}
43);
44
45extern_conformance!(
46    unsafe impl NSCopying for CPLane {}
47);
48
49unsafe impl CopyingHelper for CPLane {
50    type Result = Self;
51}
52
53extern_conformance!(
54    unsafe impl NSObjectProtocol for CPLane {}
55);
56
57extern_conformance!(
58    unsafe impl NSSecureCoding for CPLane {}
59);
60
61impl CPLane {
62    extern_methods!(
63        #[deprecated = "-[CPLane initWithAngles:] or -[CPLane initWithHighlightedAngle:angles:isPreferred:]"]
64        #[unsafe(method(init))]
65        #[unsafe(method_family = init)]
66        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
67
68        #[unsafe(method(initWithAngles:))]
69        #[unsafe(method_family = init)]
70        pub unsafe fn initWithAngles(
71            this: Allocated<Self>,
72            angles: &NSArray<NSMeasurement<NSUnitAngle>>,
73        ) -> Retained<Self>;
74
75        #[unsafe(method(initWithAngles:highlightedAngle:isPreferred:))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn initWithAngles_highlightedAngle_isPreferred(
78            this: Allocated<Self>,
79            angles: &NSArray<NSMeasurement<NSUnitAngle>>,
80            highlighted_angle: &NSMeasurement<NSUnitAngle>,
81            preferred: bool,
82        ) -> Retained<Self>;
83
84        /// status is a
85        /// `CPLaneStatus`representing the status of this lane.
86        #[unsafe(method(status))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn status(&self) -> CPLaneStatus;
89
90        /// Setter for [`status`][Self::status].
91        #[unsafe(method(setStatus:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn setStatus(&self, status: CPLaneStatus);
94
95        /// primaryAngle is the angle to be highlighted if this lane is preferred or good. If primaryAngle is present it can not be included in secondaryAngles.
96        #[deprecated = "Use highlightedAngle to get value, use -[CPLane initAngles:highlightedAngle:isPreferred:] to create a CPLane with highlightedAngle set"]
97        #[unsafe(method(primaryAngle))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn primaryAngle(&self) -> Retained<NSMeasurement<NSUnitAngle>>;
100
101        /// Setter for [`primaryAngle`][Self::primaryAngle].
102        #[deprecated = "Use highlightedAngle to get value, use -[CPLane initAngles:highlightedAngle:isPreferred:] to create a CPLane with highlightedAngle set"]
103        #[unsafe(method(setPrimaryAngle:))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn setPrimaryAngle(&self, primary_angle: &NSMeasurement<NSUnitAngle>);
106
107        /// `highlightedAngle`is the angle to be highlighted. If
108        /// `highlightedAngle`is present it can not be included in
109        /// `angles.``highlightedAngle`must not be set if status is
110        /// `CPLaneStatusNotGood`
111        #[unsafe(method(highlightedAngle))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn highlightedAngle(&self) -> Option<Retained<NSMeasurement<NSUnitAngle>>>;
114
115        /// secondaryAngles is a list of the remaining angles of this lane guidance.
116        #[deprecated = "Use angles to get value, Use -[CPLane initWithAngles:] or -[CPLane initAngles:highlightedAngle:isPreferred:] to create a CPLane with angles"]
117        #[unsafe(method(secondaryAngles))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn secondaryAngles(&self) -> Retained<NSArray<NSMeasurement<NSUnitAngle>>>;
120
121        /// Setter for [`secondaryAngles`][Self::secondaryAngles].
122        #[deprecated = "Use angles to get value, Use -[CPLane initWithAngles:] or -[CPLane initAngles:highlightedAngle:isPreferred:] to create a CPLane with angles"]
123        #[unsafe(method(setSecondaryAngles:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn setSecondaryAngles(
126            &self,
127            secondary_angles: &NSArray<NSMeasurement<NSUnitAngle>>,
128        );
129
130        /// `angles`is a list of the remaining angles of this lane guidance. If
131        /// `highlightedAngle`is set, that angle must not be included in
132        /// `angles`
133        #[unsafe(method(angles))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn angles(&self) -> Retained<NSArray<NSMeasurement<NSUnitAngle>>>;
136    );
137}
138
139/// Methods declared on superclass `NSObject`.
140impl CPLane {
141    extern_methods!(
142        #[unsafe(method(new))]
143        #[unsafe(method_family = new)]
144        pub unsafe fn new() -> Retained<Self>;
145    );
146}