objc2_app_kit/generated/
NSSlider.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
12extern_class!(
13 #[unsafe(super(NSControl, NSView, NSResponder, NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
17 pub struct NSSlider;
18);
19
20#[cfg(all(
21 feature = "NSAccessibilityProtocols",
22 feature = "NSControl",
23 feature = "NSResponder",
24 feature = "NSView"
25))]
26extern_conformance!(
27 unsafe impl NSAccessibility for NSSlider {}
28);
29
30#[cfg(all(
31 feature = "NSAccessibilityProtocols",
32 feature = "NSControl",
33 feature = "NSResponder",
34 feature = "NSView"
35))]
36extern_conformance!(
37 unsafe impl NSAccessibilityElementProtocol for NSSlider {}
38);
39
40#[cfg(all(
41 feature = "NSAccessibilityProtocols",
42 feature = "NSControl",
43 feature = "NSResponder",
44 feature = "NSView"
45))]
46extern_conformance!(
47 unsafe impl NSAccessibilitySlider for NSSlider {}
48);
49
50#[cfg(all(
51 feature = "NSAnimation",
52 feature = "NSControl",
53 feature = "NSResponder",
54 feature = "NSView"
55))]
56extern_conformance!(
57 unsafe impl NSAnimatablePropertyContainer for NSSlider {}
58);
59
60#[cfg(all(
61 feature = "NSAppearance",
62 feature = "NSControl",
63 feature = "NSResponder",
64 feature = "NSView"
65))]
66extern_conformance!(
67 unsafe impl NSAppearanceCustomization for NSSlider {}
68);
69
70#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
71extern_conformance!(
72 unsafe impl NSCoding for NSSlider {}
73);
74
75#[cfg(all(
76 feature = "NSControl",
77 feature = "NSDragging",
78 feature = "NSResponder",
79 feature = "NSView"
80))]
81extern_conformance!(
82 unsafe impl NSDraggingDestination for NSSlider {}
83);
84
85#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
86extern_conformance!(
87 unsafe impl NSObjectProtocol for NSSlider {}
88);
89
90#[cfg(all(
91 feature = "NSControl",
92 feature = "NSResponder",
93 feature = "NSUserInterfaceItemIdentification",
94 feature = "NSView"
95))]
96extern_conformance!(
97 unsafe impl NSUserInterfaceItemIdentification for NSSlider {}
98);
99
100#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
101impl NSSlider {
102 extern_methods!(
103 #[cfg(feature = "NSSliderCell")]
104 #[unsafe(method(sliderType))]
105 #[unsafe(method_family = none)]
106 pub fn sliderType(&self) -> NSSliderType;
107
108 #[cfg(feature = "NSSliderCell")]
109 #[unsafe(method(setSliderType:))]
111 #[unsafe(method_family = none)]
112 pub fn setSliderType(&self, slider_type: NSSliderType);
113
114 #[unsafe(method(minValue))]
115 #[unsafe(method_family = none)]
116 pub fn minValue(&self) -> c_double;
117
118 #[unsafe(method(setMinValue:))]
120 #[unsafe(method_family = none)]
121 pub fn setMinValue(&self, min_value: c_double);
122
123 #[unsafe(method(maxValue))]
124 #[unsafe(method_family = none)]
125 pub fn maxValue(&self) -> c_double;
126
127 #[unsafe(method(setMaxValue:))]
129 #[unsafe(method_family = none)]
130 pub fn setMaxValue(&self, max_value: c_double);
131
132 #[unsafe(method(neutralValue))]
134 #[unsafe(method_family = none)]
135 pub fn neutralValue(&self) -> c_double;
136
137 #[unsafe(method(setNeutralValue:))]
139 #[unsafe(method_family = none)]
140 pub fn setNeutralValue(&self, neutral_value: c_double);
141
142 #[unsafe(method(altIncrementValue))]
143 #[unsafe(method_family = none)]
144 pub fn altIncrementValue(&self) -> c_double;
145
146 #[unsafe(method(setAltIncrementValue:))]
148 #[unsafe(method_family = none)]
149 pub fn setAltIncrementValue(&self, alt_increment_value: c_double);
150
151 #[cfg(feature = "objc2-core-foundation")]
152 #[unsafe(method(knobThickness))]
153 #[unsafe(method_family = none)]
154 pub fn knobThickness(&self) -> CGFloat;
155
156 #[cfg(feature = "NSEvent")]
157 #[unsafe(method(acceptsFirstMouse:))]
158 #[unsafe(method_family = none)]
159 pub fn acceptsFirstMouse(&self, event: Option<&NSEvent>) -> bool;
160
161 #[unsafe(method(setVertical:))]
163 #[unsafe(method_family = none)]
164 pub fn setVertical(&self, vertical: bool);
165
166 #[cfg(feature = "NSColor")]
167 #[unsafe(method(trackFillColor))]
168 #[unsafe(method_family = none)]
169 pub fn trackFillColor(&self) -> Option<Retained<NSColor>>;
170
171 #[cfg(feature = "NSColor")]
172 #[unsafe(method(setTrackFillColor:))]
176 #[unsafe(method_family = none)]
177 pub fn setTrackFillColor(&self, track_fill_color: Option<&NSColor>);
178
179 #[cfg(feature = "NSTintProminence")]
180 #[unsafe(method(tintProminence))]
182 #[unsafe(method_family = none)]
183 pub fn tintProminence(&self) -> NSTintProminence;
184
185 #[cfg(feature = "NSTintProminence")]
186 #[unsafe(method(setTintProminence:))]
188 #[unsafe(method_family = none)]
189 pub fn setTintProminence(&self, tint_prominence: NSTintProminence);
190 );
191}
192
193#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
195impl NSSlider {
196 extern_methods!(
197 #[unsafe(method(initWithFrame:))]
198 #[unsafe(method_family = init)]
199 pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
200
201 #[unsafe(method(initWithCoder:))]
205 #[unsafe(method_family = init)]
206 pub unsafe fn initWithCoder(
207 this: Allocated<Self>,
208 coder: &NSCoder,
209 ) -> Option<Retained<Self>>;
210 );
211}
212
213#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
215impl NSSlider {
216 extern_methods!(
217 #[unsafe(method(init))]
218 #[unsafe(method_family = init)]
219 pub fn init(this: Allocated<Self>) -> Retained<Self>;
220 );
221}
222
223#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
225impl NSSlider {
226 extern_methods!(
227 #[unsafe(method(new))]
228 #[unsafe(method_family = new)]
229 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
230 );
231}
232
233#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
235impl NSSlider {
236 extern_methods!();
237}
238
239#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
241impl NSSlider {
242 extern_methods!(
243 #[unsafe(method(numberOfTickMarks))]
244 #[unsafe(method_family = none)]
245 pub fn numberOfTickMarks(&self) -> NSInteger;
246
247 #[unsafe(method(setNumberOfTickMarks:))]
249 #[unsafe(method_family = none)]
250 pub fn setNumberOfTickMarks(&self, number_of_tick_marks: NSInteger);
251
252 #[cfg(feature = "NSSliderCell")]
253 #[unsafe(method(tickMarkPosition))]
254 #[unsafe(method_family = none)]
255 pub fn tickMarkPosition(&self) -> NSTickMarkPosition;
256
257 #[cfg(feature = "NSSliderCell")]
258 #[unsafe(method(setTickMarkPosition:))]
260 #[unsafe(method_family = none)]
261 pub fn setTickMarkPosition(&self, tick_mark_position: NSTickMarkPosition);
262
263 #[unsafe(method(allowsTickMarkValuesOnly))]
264 #[unsafe(method_family = none)]
265 pub fn allowsTickMarkValuesOnly(&self) -> bool;
266
267 #[unsafe(method(setAllowsTickMarkValuesOnly:))]
269 #[unsafe(method_family = none)]
270 pub fn setAllowsTickMarkValuesOnly(&self, allows_tick_mark_values_only: bool);
271
272 #[unsafe(method(tickMarkValueAtIndex:))]
273 #[unsafe(method_family = none)]
274 pub fn tickMarkValueAtIndex(&self, index: NSInteger) -> c_double;
275
276 #[unsafe(method(rectOfTickMarkAtIndex:))]
277 #[unsafe(method_family = none)]
278 pub fn rectOfTickMarkAtIndex(&self, index: NSInteger) -> NSRect;
279
280 #[unsafe(method(indexOfTickMarkAtPoint:))]
281 #[unsafe(method_family = none)]
282 pub fn indexOfTickMarkAtPoint(&self, point: NSPoint) -> NSInteger;
283
284 #[unsafe(method(closestTickMarkValueToValue:))]
285 #[unsafe(method_family = none)]
286 pub fn closestTickMarkValueToValue(&self, value: c_double) -> c_double;
287 );
288}
289
290#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
292impl NSSlider {
293 extern_methods!(
294 #[unsafe(method(sliderWithTarget:action:))]
307 #[unsafe(method_family = none)]
308 pub unsafe fn sliderWithTarget_action(
309 target: Option<&AnyObject>,
310 action: Option<Sel>,
311 mtm: MainThreadMarker,
312 ) -> Retained<Self>;
313
314 #[unsafe(method(sliderWithValue:minValue:maxValue:target:action:))]
333 #[unsafe(method_family = none)]
334 pub unsafe fn sliderWithValue_minValue_maxValue_target_action(
335 value: c_double,
336 min_value: c_double,
337 max_value: c_double,
338 target: Option<&AnyObject>,
339 action: Option<Sel>,
340 mtm: MainThreadMarker,
341 ) -> Retained<Self>;
342 );
343}
344
345#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
347impl NSSlider {
348 extern_methods!(
349 #[cfg(feature = "NSCell")]
350 #[deprecated = "-setTitleCell: had no effect since 10.0"]
354 #[unsafe(method(setTitleCell:))]
355 #[unsafe(method_family = none)]
356 pub unsafe fn setTitleCell(&self, cell: Option<&NSCell>);
357
358 #[deprecated = "-titleCell has returned nil since 10.0"]
359 #[unsafe(method(titleCell))]
360 #[unsafe(method_family = none)]
361 pub fn titleCell(&self) -> Option<Retained<AnyObject>>;
362
363 #[cfg(feature = "NSColor")]
364 #[deprecated = "-setTitleColor: had no effect since 10.0"]
368 #[unsafe(method(setTitleColor:))]
369 #[unsafe(method_family = none)]
370 pub unsafe fn setTitleColor(&self, new_color: Option<&NSColor>);
371
372 #[cfg(feature = "NSColor")]
373 #[deprecated = "-titleColor has returned nil since 10.0"]
374 #[unsafe(method(titleColor))]
375 #[unsafe(method_family = none)]
376 pub fn titleColor(&self) -> Option<Retained<NSColor>>;
377
378 #[cfg(feature = "NSFont")]
379 #[deprecated = "-setTitleFont: had no effect since 10.0"]
383 #[unsafe(method(setTitleFont:))]
384 #[unsafe(method_family = none)]
385 pub unsafe fn setTitleFont(&self, font_obj: Option<&NSFont>);
386
387 #[cfg(feature = "NSFont")]
388 #[deprecated = "-titleFont has returned nil since 10.0"]
389 #[unsafe(method(titleFont))]
390 #[unsafe(method_family = none)]
391 pub fn titleFont(&self) -> Option<Retained<NSFont>>;
392
393 #[deprecated = "-title has returned nil since 10.0"]
394 #[unsafe(method(title))]
395 #[unsafe(method_family = none)]
396 pub fn title(&self) -> Option<Retained<NSString>>;
397
398 #[deprecated = "-setTitle: had no effect since 10.0"]
402 #[unsafe(method(setTitle:))]
403 #[unsafe(method_family = none)]
404 pub unsafe fn setTitle(&self, string: Option<&NSString>);
405
406 #[cfg(feature = "objc2-core-foundation")]
407 #[deprecated = "-knobThickness has returned 0 since 10.0"]
408 #[unsafe(method(setKnobThickness:))]
409 #[unsafe(method_family = none)]
410 pub fn setKnobThickness(&self, thickness: CGFloat);
411
412 #[cfg(feature = "NSImage")]
413 #[deprecated = "-setImage: had no effect since 10.0"]
417 #[unsafe(method(setImage:))]
418 #[unsafe(method_family = none)]
419 pub unsafe fn setImage(&self, background_image: Option<&NSImage>);
420
421 #[cfg(feature = "NSImage")]
422 #[deprecated = "-image has returned nil since 10.0"]
423 #[unsafe(method(image))]
424 #[unsafe(method_family = none)]
425 pub fn image(&self) -> Option<Retained<NSImage>>;
426 );
427}