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))]
26unsafe impl NSAccessibility for NSSlider {}
27
28#[cfg(all(
29 feature = "NSAccessibilityProtocols",
30 feature = "NSControl",
31 feature = "NSResponder",
32 feature = "NSView"
33))]
34unsafe impl NSAccessibilityElementProtocol for NSSlider {}
35
36#[cfg(all(
37 feature = "NSAccessibilityProtocols",
38 feature = "NSControl",
39 feature = "NSResponder",
40 feature = "NSView"
41))]
42unsafe impl NSAccessibilitySlider for NSSlider {}
43
44#[cfg(all(
45 feature = "NSAnimation",
46 feature = "NSControl",
47 feature = "NSResponder",
48 feature = "NSView"
49))]
50unsafe impl NSAnimatablePropertyContainer for NSSlider {}
51
52#[cfg(all(
53 feature = "NSAppearance",
54 feature = "NSControl",
55 feature = "NSResponder",
56 feature = "NSView"
57))]
58unsafe impl NSAppearanceCustomization for NSSlider {}
59
60#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
61unsafe impl NSCoding for NSSlider {}
62
63#[cfg(all(
64 feature = "NSControl",
65 feature = "NSDragging",
66 feature = "NSResponder",
67 feature = "NSView"
68))]
69unsafe impl NSDraggingDestination for NSSlider {}
70
71#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
72unsafe impl NSObjectProtocol for NSSlider {}
73
74#[cfg(all(
75 feature = "NSControl",
76 feature = "NSResponder",
77 feature = "NSUserInterfaceItemIdentification",
78 feature = "NSView"
79))]
80unsafe impl NSUserInterfaceItemIdentification for NSSlider {}
81
82#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
83impl NSSlider {
84 extern_methods!(
85 #[cfg(feature = "NSSliderCell")]
86 #[unsafe(method(sliderType))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn sliderType(&self) -> NSSliderType;
89
90 #[cfg(feature = "NSSliderCell")]
91 #[unsafe(method(setSliderType:))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn setSliderType(&self, slider_type: NSSliderType);
95
96 #[unsafe(method(minValue))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn minValue(&self) -> c_double;
99
100 #[unsafe(method(setMinValue:))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn setMinValue(&self, min_value: c_double);
104
105 #[unsafe(method(maxValue))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn maxValue(&self) -> c_double;
108
109 #[unsafe(method(setMaxValue:))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn setMaxValue(&self, max_value: c_double);
113
114 #[unsafe(method(altIncrementValue))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn altIncrementValue(&self) -> c_double;
117
118 #[unsafe(method(setAltIncrementValue:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn setAltIncrementValue(&self, alt_increment_value: c_double);
122
123 #[cfg(feature = "objc2-core-foundation")]
124 #[unsafe(method(knobThickness))]
125 #[unsafe(method_family = none)]
126 pub unsafe fn knobThickness(&self) -> CGFloat;
127
128 #[cfg(feature = "NSEvent")]
129 #[unsafe(method(acceptsFirstMouse:))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn acceptsFirstMouse(&self, event: Option<&NSEvent>) -> bool;
132
133 #[unsafe(method(setVertical:))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn setVertical(&self, vertical: bool);
137
138 #[cfg(feature = "NSColor")]
139 #[unsafe(method(trackFillColor))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn trackFillColor(&self) -> Option<Retained<NSColor>>;
142
143 #[cfg(feature = "NSColor")]
144 #[unsafe(method(setTrackFillColor:))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn setTrackFillColor(&self, track_fill_color: Option<&NSColor>);
148 );
149}
150
151#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
153impl NSSlider {
154 extern_methods!(
155 #[unsafe(method(initWithFrame:))]
156 #[unsafe(method_family = init)]
157 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
158
159 #[unsafe(method(initWithCoder:))]
160 #[unsafe(method_family = init)]
161 pub unsafe fn initWithCoder(
162 this: Allocated<Self>,
163 coder: &NSCoder,
164 ) -> Option<Retained<Self>>;
165 );
166}
167
168#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
170impl NSSlider {
171 extern_methods!(
172 #[unsafe(method(init))]
173 #[unsafe(method_family = init)]
174 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
175 );
176}
177
178#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
180impl NSSlider {
181 extern_methods!(
182 #[unsafe(method(new))]
183 #[unsafe(method_family = new)]
184 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
185 );
186}
187
188#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
190impl NSSlider {
191 extern_methods!();
192}
193
194#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
196impl NSSlider {
197 extern_methods!(
198 #[unsafe(method(numberOfTickMarks))]
199 #[unsafe(method_family = none)]
200 pub unsafe fn numberOfTickMarks(&self) -> NSInteger;
201
202 #[unsafe(method(setNumberOfTickMarks:))]
204 #[unsafe(method_family = none)]
205 pub unsafe fn setNumberOfTickMarks(&self, number_of_tick_marks: NSInteger);
206
207 #[cfg(feature = "NSSliderCell")]
208 #[unsafe(method(tickMarkPosition))]
209 #[unsafe(method_family = none)]
210 pub unsafe fn tickMarkPosition(&self) -> NSTickMarkPosition;
211
212 #[cfg(feature = "NSSliderCell")]
213 #[unsafe(method(setTickMarkPosition:))]
215 #[unsafe(method_family = none)]
216 pub unsafe fn setTickMarkPosition(&self, tick_mark_position: NSTickMarkPosition);
217
218 #[unsafe(method(allowsTickMarkValuesOnly))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn allowsTickMarkValuesOnly(&self) -> bool;
221
222 #[unsafe(method(setAllowsTickMarkValuesOnly:))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn setAllowsTickMarkValuesOnly(&self, allows_tick_mark_values_only: bool);
226
227 #[unsafe(method(tickMarkValueAtIndex:))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn tickMarkValueAtIndex(&self, index: NSInteger) -> c_double;
230
231 #[unsafe(method(rectOfTickMarkAtIndex:))]
232 #[unsafe(method_family = none)]
233 pub unsafe fn rectOfTickMarkAtIndex(&self, index: NSInteger) -> NSRect;
234
235 #[unsafe(method(indexOfTickMarkAtPoint:))]
236 #[unsafe(method_family = none)]
237 pub unsafe fn indexOfTickMarkAtPoint(&self, point: NSPoint) -> NSInteger;
238
239 #[unsafe(method(closestTickMarkValueToValue:))]
240 #[unsafe(method_family = none)]
241 pub unsafe fn closestTickMarkValueToValue(&self, value: c_double) -> c_double;
242 );
243}
244
245#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
247impl NSSlider {
248 extern_methods!(
249 #[unsafe(method(sliderWithTarget:action:))]
257 #[unsafe(method_family = none)]
258 pub unsafe fn sliderWithTarget_action(
259 target: Option<&AnyObject>,
260 action: Option<Sel>,
261 mtm: MainThreadMarker,
262 ) -> Retained<Self>;
263
264 #[unsafe(method(sliderWithValue:minValue:maxValue:target:action:))]
278 #[unsafe(method_family = none)]
279 pub unsafe fn sliderWithValue_minValue_maxValue_target_action(
280 value: c_double,
281 min_value: c_double,
282 max_value: c_double,
283 target: Option<&AnyObject>,
284 action: Option<Sel>,
285 mtm: MainThreadMarker,
286 ) -> Retained<Self>;
287 );
288}
289
290#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
292impl NSSlider {
293 extern_methods!(
294 #[cfg(feature = "NSCell")]
295 #[deprecated = "-setTitleCell: had no effect since 10.0"]
296 #[unsafe(method(setTitleCell:))]
297 #[unsafe(method_family = none)]
298 pub unsafe fn setTitleCell(&self, cell: Option<&NSCell>);
299
300 #[deprecated = "-titleCell has returned nil since 10.0"]
301 #[unsafe(method(titleCell))]
302 #[unsafe(method_family = none)]
303 pub unsafe fn titleCell(&self) -> Option<Retained<AnyObject>>;
304
305 #[cfg(feature = "NSColor")]
306 #[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 unsafe fn titleColor(&self) -> Option<Retained<NSColor>>;
316
317 #[cfg(feature = "NSFont")]
318 #[deprecated = "-setTitleFont: had no effect since 10.0"]
319 #[unsafe(method(setTitleFont:))]
320 #[unsafe(method_family = none)]
321 pub unsafe fn setTitleFont(&self, font_obj: Option<&NSFont>);
322
323 #[cfg(feature = "NSFont")]
324 #[deprecated = "-titleFont has returned nil since 10.0"]
325 #[unsafe(method(titleFont))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn titleFont(&self) -> Option<Retained<NSFont>>;
328
329 #[deprecated = "-title has returned nil since 10.0"]
330 #[unsafe(method(title))]
331 #[unsafe(method_family = none)]
332 pub unsafe fn title(&self) -> Option<Retained<NSString>>;
333
334 #[deprecated = "-setTitle: had no effect since 10.0"]
335 #[unsafe(method(setTitle:))]
336 #[unsafe(method_family = none)]
337 pub unsafe fn setTitle(&self, string: Option<&NSString>);
338
339 #[cfg(feature = "objc2-core-foundation")]
340 #[deprecated = "-knobThickness has returned 0 since 10.0"]
341 #[unsafe(method(setKnobThickness:))]
342 #[unsafe(method_family = none)]
343 pub unsafe fn setKnobThickness(&self, thickness: CGFloat);
344
345 #[cfg(feature = "NSImage")]
346 #[deprecated = "-setImage: had no effect since 10.0"]
347 #[unsafe(method(setImage:))]
348 #[unsafe(method_family = none)]
349 pub unsafe fn setImage(&self, background_image: Option<&NSImage>);
350
351 #[cfg(feature = "NSImage")]
352 #[deprecated = "-image has returned nil since 10.0"]
353 #[unsafe(method(image))]
354 #[unsafe(method_family = none)]
355 pub unsafe fn image(&self) -> Option<Retained<NSImage>>;
356 );
357}