objc2_app_kit/generated/
NSLevelIndicatorCell.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSLevelIndicatorStyle(pub NSUInteger);
15impl NSLevelIndicatorStyle {
16 #[doc(alias = "NSLevelIndicatorStyleRelevancy")]
17 pub const Relevancy: Self = Self(0);
18 #[doc(alias = "NSLevelIndicatorStyleContinuousCapacity")]
19 pub const ContinuousCapacity: Self = Self(1);
20 #[doc(alias = "NSLevelIndicatorStyleDiscreteCapacity")]
21 pub const DiscreteCapacity: Self = Self(2);
22 #[doc(alias = "NSLevelIndicatorStyleRating")]
23 pub const Rating: Self = Self(3);
24}
25
26unsafe impl Encode for NSLevelIndicatorStyle {
27 const ENCODING: Encoding = NSUInteger::ENCODING;
28}
29
30unsafe impl RefEncode for NSLevelIndicatorStyle {
31 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34extern_class!(
35 #[unsafe(super(NSActionCell, NSCell, NSObject))]
37 #[derive(Debug, PartialEq, Eq, Hash)]
38 #[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
39 pub struct NSLevelIndicatorCell;
40);
41
42#[cfg(all(
43 feature = "NSAccessibilityProtocols",
44 feature = "NSActionCell",
45 feature = "NSCell"
46))]
47extern_conformance!(
48 unsafe impl NSAccessibility for NSLevelIndicatorCell {}
49);
50
51#[cfg(all(
52 feature = "NSAccessibilityProtocols",
53 feature = "NSActionCell",
54 feature = "NSCell"
55))]
56extern_conformance!(
57 unsafe impl NSAccessibilityElementProtocol for NSLevelIndicatorCell {}
58);
59
60#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
61extern_conformance!(
62 unsafe impl NSCoding for NSLevelIndicatorCell {}
63);
64
65#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
66extern_conformance!(
67 unsafe impl NSCopying for NSLevelIndicatorCell {}
68);
69
70#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
71unsafe impl CopyingHelper for NSLevelIndicatorCell {
72 type Result = Self;
73}
74
75#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
76extern_conformance!(
77 unsafe impl NSObjectProtocol for NSLevelIndicatorCell {}
78);
79
80#[cfg(all(
81 feature = "NSActionCell",
82 feature = "NSCell",
83 feature = "NSUserInterfaceItemIdentification"
84))]
85extern_conformance!(
86 unsafe impl NSUserInterfaceItemIdentification for NSLevelIndicatorCell {}
87);
88
89#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
90impl NSLevelIndicatorCell {
91 extern_methods!(
92 #[unsafe(method(initWithLevelIndicatorStyle:))]
93 #[unsafe(method_family = init)]
94 pub unsafe fn initWithLevelIndicatorStyle(
95 this: Allocated<Self>,
96 level_indicator_style: NSLevelIndicatorStyle,
97 ) -> Retained<Self>;
98
99 #[unsafe(method(levelIndicatorStyle))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn levelIndicatorStyle(&self) -> NSLevelIndicatorStyle;
102
103 #[unsafe(method(setLevelIndicatorStyle:))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn setLevelIndicatorStyle(&self, level_indicator_style: NSLevelIndicatorStyle);
107
108 #[unsafe(method(minValue))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn minValue(&self) -> c_double;
111
112 #[unsafe(method(setMinValue:))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn setMinValue(&self, min_value: c_double);
116
117 #[unsafe(method(maxValue))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn maxValue(&self) -> c_double;
120
121 #[unsafe(method(setMaxValue:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn setMaxValue(&self, max_value: c_double);
125
126 #[unsafe(method(warningValue))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn warningValue(&self) -> c_double;
129
130 #[unsafe(method(setWarningValue:))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn setWarningValue(&self, warning_value: c_double);
134
135 #[unsafe(method(criticalValue))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn criticalValue(&self) -> c_double;
138
139 #[unsafe(method(setCriticalValue:))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn setCriticalValue(&self, critical_value: c_double);
143
144 #[cfg(feature = "NSSliderCell")]
145 #[unsafe(method(tickMarkPosition))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn tickMarkPosition(&self) -> NSTickMarkPosition;
148
149 #[cfg(feature = "NSSliderCell")]
150 #[unsafe(method(setTickMarkPosition:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn setTickMarkPosition(&self, tick_mark_position: NSTickMarkPosition);
154
155 #[unsafe(method(numberOfTickMarks))]
156 #[unsafe(method_family = none)]
157 pub unsafe fn numberOfTickMarks(&self) -> NSInteger;
158
159 #[unsafe(method(setNumberOfTickMarks:))]
161 #[unsafe(method_family = none)]
162 pub unsafe fn setNumberOfTickMarks(&self, number_of_tick_marks: NSInteger);
163
164 #[unsafe(method(numberOfMajorTickMarks))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn numberOfMajorTickMarks(&self) -> NSInteger;
167
168 #[unsafe(method(setNumberOfMajorTickMarks:))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn setNumberOfMajorTickMarks(&self, number_of_major_tick_marks: NSInteger);
172
173 #[unsafe(method(rectOfTickMarkAtIndex:))]
174 #[unsafe(method_family = none)]
175 pub unsafe fn rectOfTickMarkAtIndex(&self, index: NSInteger) -> NSRect;
176
177 #[unsafe(method(tickMarkValueAtIndex:))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn tickMarkValueAtIndex(&self, index: NSInteger) -> c_double;
180 );
181}
182
183#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
185impl NSLevelIndicatorCell {
186 extern_methods!(
187 #[unsafe(method(init))]
188 #[unsafe(method_family = init)]
189 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
190
191 #[unsafe(method(initTextCell:))]
192 #[unsafe(method_family = init)]
193 pub unsafe fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
194
195 #[cfg(feature = "NSImage")]
196 #[unsafe(method(initImageCell:))]
197 #[unsafe(method_family = init)]
198 pub unsafe fn initImageCell(
199 this: Allocated<Self>,
200 image: Option<&NSImage>,
201 ) -> Retained<Self>;
202
203 #[unsafe(method(initWithCoder:))]
204 #[unsafe(method_family = init)]
205 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
206 );
207}
208
209#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
211impl NSLevelIndicatorCell {
212 extern_methods!(
213 #[unsafe(method(new))]
214 #[unsafe(method_family = new)]
215 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
216 );
217}
218
219pub static NSRelevancyLevelIndicatorStyle: NSLevelIndicatorStyle =
221 NSLevelIndicatorStyle(NSLevelIndicatorStyle::Relevancy.0);
222
223pub static NSContinuousCapacityLevelIndicatorStyle: NSLevelIndicatorStyle =
225 NSLevelIndicatorStyle(NSLevelIndicatorStyle::ContinuousCapacity.0);
226
227pub static NSDiscreteCapacityLevelIndicatorStyle: NSLevelIndicatorStyle =
229 NSLevelIndicatorStyle(NSLevelIndicatorStyle::DiscreteCapacity.0);
230
231pub static NSRatingLevelIndicatorStyle: NSLevelIndicatorStyle =
233 NSLevelIndicatorStyle(NSLevelIndicatorStyle::Rating.0);