objc2_app_kit/generated/
NSSliderCell.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSTickMarkPosition(pub NSUInteger);
17impl NSTickMarkPosition {
18 #[doc(alias = "NSTickMarkPositionBelow")]
19 pub const Below: Self = Self(0);
20 #[doc(alias = "NSTickMarkPositionAbove")]
21 pub const Above: Self = Self(1);
22 #[doc(alias = "NSTickMarkPositionLeading")]
23 pub const Leading: Self = Self(NSTickMarkPosition::Above.0);
24 #[doc(alias = "NSTickMarkPositionTrailing")]
25 pub const Trailing: Self = Self(NSTickMarkPosition::Below.0);
26}
27
28unsafe impl Encode for NSTickMarkPosition {
29 const ENCODING: Encoding = NSUInteger::ENCODING;
30}
31
32unsafe impl RefEncode for NSTickMarkPosition {
33 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36#[repr(transparent)]
39#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
40pub struct NSSliderType(pub NSUInteger);
41impl NSSliderType {
42 #[doc(alias = "NSSliderTypeLinear")]
43 pub const Linear: Self = Self(0);
44 #[doc(alias = "NSSliderTypeCircular")]
45 pub const Circular: Self = Self(1);
46}
47
48unsafe impl Encode for NSSliderType {
49 const ENCODING: Encoding = NSUInteger::ENCODING;
50}
51
52unsafe impl RefEncode for NSSliderType {
53 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
54}
55
56extern_class!(
57 #[unsafe(super(NSActionCell, NSCell, NSObject))]
59 #[derive(Debug, PartialEq, Eq, Hash)]
60 #[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
61 pub struct NSSliderCell;
62);
63
64#[cfg(all(
65 feature = "NSAccessibilityProtocols",
66 feature = "NSActionCell",
67 feature = "NSCell"
68))]
69extern_conformance!(
70 unsafe impl NSAccessibility for NSSliderCell {}
71);
72
73#[cfg(all(
74 feature = "NSAccessibilityProtocols",
75 feature = "NSActionCell",
76 feature = "NSCell"
77))]
78extern_conformance!(
79 unsafe impl NSAccessibilityElementProtocol for NSSliderCell {}
80);
81
82#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
83extern_conformance!(
84 unsafe impl NSCoding for NSSliderCell {}
85);
86
87#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
88extern_conformance!(
89 unsafe impl NSCopying for NSSliderCell {}
90);
91
92#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
93unsafe impl CopyingHelper for NSSliderCell {
94 type Result = Self;
95}
96
97#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
98extern_conformance!(
99 unsafe impl NSObjectProtocol for NSSliderCell {}
100);
101
102#[cfg(all(
103 feature = "NSActionCell",
104 feature = "NSCell",
105 feature = "NSUserInterfaceItemIdentification"
106))]
107extern_conformance!(
108 unsafe impl NSUserInterfaceItemIdentification for NSSliderCell {}
109);
110
111#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
112impl NSSliderCell {
113 extern_methods!(
114 #[unsafe(method(prefersTrackingUntilMouseUp))]
115 #[unsafe(method_family = none)]
116 pub fn prefersTrackingUntilMouseUp(mtm: MainThreadMarker) -> bool;
117
118 #[unsafe(method(minValue))]
119 #[unsafe(method_family = none)]
120 pub fn minValue(&self) -> c_double;
121
122 #[unsafe(method(setMinValue:))]
124 #[unsafe(method_family = none)]
125 pub fn setMinValue(&self, min_value: c_double);
126
127 #[unsafe(method(maxValue))]
128 #[unsafe(method_family = none)]
129 pub fn maxValue(&self) -> c_double;
130
131 #[unsafe(method(setMaxValue:))]
133 #[unsafe(method_family = none)]
134 pub fn setMaxValue(&self, max_value: c_double);
135
136 #[unsafe(method(altIncrementValue))]
137 #[unsafe(method_family = none)]
138 pub fn altIncrementValue(&self) -> c_double;
139
140 #[unsafe(method(setAltIncrementValue:))]
142 #[unsafe(method_family = none)]
143 pub fn setAltIncrementValue(&self, alt_increment_value: c_double);
144
145 #[unsafe(method(sliderType))]
146 #[unsafe(method_family = none)]
147 pub fn sliderType(&self) -> NSSliderType;
148
149 #[unsafe(method(setSliderType:))]
151 #[unsafe(method_family = none)]
152 pub fn setSliderType(&self, slider_type: NSSliderType);
153
154 #[unsafe(method(setVertical:))]
156 #[unsafe(method_family = none)]
157 pub fn setVertical(&self, vertical: bool);
158
159 #[unsafe(method(trackRect))]
160 #[unsafe(method_family = none)]
161 pub fn trackRect(&self) -> NSRect;
162
163 #[cfg(feature = "objc2-core-foundation")]
164 #[unsafe(method(knobThickness))]
165 #[unsafe(method_family = none)]
166 pub fn knobThickness(&self) -> CGFloat;
167
168 #[unsafe(method(knobRectFlipped:))]
169 #[unsafe(method_family = none)]
170 pub fn knobRectFlipped(&self, flipped: bool) -> NSRect;
171
172 #[unsafe(method(barRectFlipped:))]
173 #[unsafe(method_family = none)]
174 pub fn barRectFlipped(&self, flipped: bool) -> NSRect;
175
176 #[unsafe(method(drawKnob:))]
177 #[unsafe(method_family = none)]
178 pub fn drawKnob_(&self, knob_rect: NSRect);
179
180 #[unsafe(method(drawKnob))]
181 #[unsafe(method_family = none)]
182 pub fn drawKnob(&self);
183
184 #[unsafe(method(drawBarInside:flipped:))]
185 #[unsafe(method_family = none)]
186 pub fn drawBarInside_flipped(&self, rect: NSRect, flipped: bool);
187 );
188}
189
190#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
192impl NSSliderCell {
193 extern_methods!(
194 #[unsafe(method(init))]
195 #[unsafe(method_family = init)]
196 pub fn init(this: Allocated<Self>) -> Retained<Self>;
197
198 #[unsafe(method(initTextCell:))]
199 #[unsafe(method_family = init)]
200 pub fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
201
202 #[cfg(feature = "NSImage")]
203 #[unsafe(method(initImageCell:))]
204 #[unsafe(method_family = init)]
205 pub fn initImageCell(this: Allocated<Self>, image: Option<&NSImage>) -> Retained<Self>;
206
207 #[unsafe(method(initWithCoder:))]
211 #[unsafe(method_family = init)]
212 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
213 );
214}
215
216#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
218impl NSSliderCell {
219 extern_methods!(
220 #[unsafe(method(new))]
221 #[unsafe(method_family = new)]
222 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
223 );
224}
225
226#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
228impl NSSliderCell {
229 extern_methods!();
230}
231
232#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
234impl NSSliderCell {
235 extern_methods!(
236 #[unsafe(method(numberOfTickMarks))]
237 #[unsafe(method_family = none)]
238 pub fn numberOfTickMarks(&self) -> NSInteger;
239
240 #[unsafe(method(setNumberOfTickMarks:))]
242 #[unsafe(method_family = none)]
243 pub fn setNumberOfTickMarks(&self, number_of_tick_marks: NSInteger);
244
245 #[unsafe(method(tickMarkPosition))]
246 #[unsafe(method_family = none)]
247 pub fn tickMarkPosition(&self) -> NSTickMarkPosition;
248
249 #[unsafe(method(setTickMarkPosition:))]
251 #[unsafe(method_family = none)]
252 pub fn setTickMarkPosition(&self, tick_mark_position: NSTickMarkPosition);
253
254 #[unsafe(method(allowsTickMarkValuesOnly))]
255 #[unsafe(method_family = none)]
256 pub fn allowsTickMarkValuesOnly(&self) -> bool;
257
258 #[unsafe(method(setAllowsTickMarkValuesOnly:))]
260 #[unsafe(method_family = none)]
261 pub fn setAllowsTickMarkValuesOnly(&self, allows_tick_mark_values_only: bool);
262
263 #[unsafe(method(tickMarkValueAtIndex:))]
264 #[unsafe(method_family = none)]
265 pub fn tickMarkValueAtIndex(&self, index: NSInteger) -> c_double;
266
267 #[unsafe(method(rectOfTickMarkAtIndex:))]
268 #[unsafe(method_family = none)]
269 pub fn rectOfTickMarkAtIndex(&self, index: NSInteger) -> NSRect;
270
271 #[unsafe(method(indexOfTickMarkAtPoint:))]
272 #[unsafe(method_family = none)]
273 pub fn indexOfTickMarkAtPoint(&self, point: NSPoint) -> NSInteger;
274
275 #[unsafe(method(closestTickMarkValueToValue:))]
276 #[unsafe(method_family = none)]
277 pub fn closestTickMarkValueToValue(&self, value: c_double) -> c_double;
278
279 #[unsafe(method(drawTickMarks))]
280 #[unsafe(method_family = none)]
281 pub fn drawTickMarks(&self);
282 );
283}
284
285#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
287impl NSSliderCell {
288 extern_methods!(
289 #[deprecated = "-setTitleCell: had no effect since 10.0"]
293 #[unsafe(method(setTitleCell:))]
294 #[unsafe(method_family = none)]
295 pub unsafe fn setTitleCell(&self, cell: Option<&NSCell>);
296
297 #[deprecated = "-titleCell has returned nil since 10.0"]
298 #[unsafe(method(titleCell))]
299 #[unsafe(method_family = none)]
300 pub fn titleCell(&self) -> Option<Retained<AnyObject>>;
301
302 #[cfg(feature = "NSColor")]
303 #[deprecated = "-setTitleColor: had no effect since 10.0"]
307 #[unsafe(method(setTitleColor:))]
308 #[unsafe(method_family = none)]
309 pub unsafe fn setTitleColor(&self, new_color: Option<&NSColor>);
310
311 #[cfg(feature = "NSColor")]
312 #[deprecated = "-titleColor has returned nil since 10.0"]
313 #[unsafe(method(titleColor))]
314 #[unsafe(method_family = none)]
315 pub fn titleColor(&self) -> Option<Retained<NSColor>>;
316
317 #[cfg(feature = "NSFont")]
318 #[deprecated = "-setTitleFont: had no effect since 10.0"]
322 #[unsafe(method(setTitleFont:))]
323 #[unsafe(method_family = none)]
324 pub unsafe fn setTitleFont(&self, font_obj: Option<&NSFont>);
325
326 #[cfg(feature = "NSFont")]
327 #[deprecated = "-titleFont has returned nil since 10.0"]
328 #[unsafe(method(titleFont))]
329 #[unsafe(method_family = none)]
330 pub fn titleFont(&self) -> Option<Retained<NSFont>>;
331
332 #[deprecated = "-title has returned nil since 10.0"]
333 #[unsafe(method(title))]
334 #[unsafe(method_family = none)]
335 pub fn title(&self) -> Option<Retained<NSString>>;
336
337 #[deprecated = "-setTitle: had no effect since 10.0"]
341 #[unsafe(method(setTitle:))]
342 #[unsafe(method_family = none)]
343 pub unsafe fn setTitle(&self, string: Option<&NSString>);
344
345 #[cfg(feature = "objc2-core-foundation")]
346 #[deprecated = "-knobThickness has returned 0 since 10.0"]
347 #[unsafe(method(setKnobThickness:))]
348 #[unsafe(method_family = none)]
349 pub fn setKnobThickness(&self, thickness: CGFloat);
350
351 #[cfg(feature = "NSImage")]
352 #[deprecated = "-setImage: had no effect since 10.0"]
356 #[unsafe(method(setImage:))]
357 #[unsafe(method_family = none)]
358 pub unsafe fn setImage(&self, background_image: Option<&NSImage>);
359
360 #[cfg(feature = "NSImage")]
361 #[deprecated = "-image has returned nil since 10.0"]
362 #[unsafe(method(image))]
363 #[unsafe(method_family = none)]
364 pub fn image(&self) -> Option<Retained<NSImage>>;
365 );
366}
367
368#[deprecated]
370pub static NSTickMarkBelow: NSTickMarkPosition = NSTickMarkPosition(NSTickMarkPosition::Below.0);
371
372#[deprecated]
374pub static NSTickMarkAbove: NSTickMarkPosition = NSTickMarkPosition(NSTickMarkPosition::Above.0);
375
376#[deprecated]
378pub static NSTickMarkLeft: NSTickMarkPosition = NSTickMarkPosition(NSTickMarkPosition::Leading.0);
379
380#[deprecated]
382pub static NSTickMarkRight: NSTickMarkPosition = NSTickMarkPosition(NSTickMarkPosition::Trailing.0);
383
384#[deprecated]
386pub static NSLinearSlider: NSSliderType = NSSliderType(NSSliderType::Linear.0);
387
388#[deprecated]
390pub static NSCircularSlider: NSSliderType = NSSliderType(NSSliderType::Circular.0);