icrate/generated/AppKit/
NSSlider.rs1use crate::common::*;
4use crate::AppKit::*;
5use crate::CoreData::*;
6use crate::Foundation::*;
7
8extern_class!(
9 #[derive(Debug, PartialEq, Eq, Hash)]
10 #[cfg(feature = "AppKit_NSSlider")]
11 pub struct NSSlider;
12
13 #[cfg(feature = "AppKit_NSSlider")]
14 unsafe impl ClassType for NSSlider {
15 #[inherits(NSView, NSResponder, NSObject)]
16 type Super = NSControl;
17 type Mutability = MainThreadOnly;
18 }
19);
20
21#[cfg(feature = "AppKit_NSSlider")]
22unsafe impl NSAccessibility for NSSlider {}
23
24#[cfg(feature = "AppKit_NSSlider")]
25unsafe impl NSAccessibilityElementProtocol for NSSlider {}
26
27#[cfg(feature = "AppKit_NSSlider")]
28unsafe impl NSAccessibilitySlider for NSSlider {}
29
30#[cfg(feature = "AppKit_NSSlider")]
31unsafe impl NSAnimatablePropertyContainer for NSSlider {}
32
33#[cfg(feature = "AppKit_NSSlider")]
34unsafe impl NSAppearanceCustomization for NSSlider {}
35
36#[cfg(feature = "AppKit_NSSlider")]
37unsafe impl NSCoding for NSSlider {}
38
39#[cfg(feature = "AppKit_NSSlider")]
40unsafe impl NSDraggingDestination for NSSlider {}
41
42#[cfg(feature = "AppKit_NSSlider")]
43unsafe impl NSObjectProtocol for NSSlider {}
44
45#[cfg(feature = "AppKit_NSSlider")]
46unsafe impl NSUserInterfaceItemIdentification for NSSlider {}
47
48extern_methods!(
49 #[cfg(feature = "AppKit_NSSlider")]
50 unsafe impl NSSlider {
51 #[method(sliderType)]
52 pub unsafe fn sliderType(&self) -> NSSliderType;
53
54 #[method(setSliderType:)]
55 pub unsafe fn setSliderType(&self, slider_type: NSSliderType);
56
57 #[method(minValue)]
58 pub unsafe fn minValue(&self) -> c_double;
59
60 #[method(setMinValue:)]
61 pub unsafe fn setMinValue(&self, min_value: c_double);
62
63 #[method(maxValue)]
64 pub unsafe fn maxValue(&self) -> c_double;
65
66 #[method(setMaxValue:)]
67 pub unsafe fn setMaxValue(&self, max_value: c_double);
68
69 #[method(altIncrementValue)]
70 pub unsafe fn altIncrementValue(&self) -> c_double;
71
72 #[method(setAltIncrementValue:)]
73 pub unsafe fn setAltIncrementValue(&self, alt_increment_value: c_double);
74
75 #[method(knobThickness)]
76 pub unsafe fn knobThickness(&self) -> CGFloat;
77
78 #[cfg(feature = "AppKit_NSEvent")]
79 #[method(acceptsFirstMouse:)]
80 pub unsafe fn acceptsFirstMouse(&self, event: Option<&NSEvent>) -> bool;
81
82 #[method(setVertical:)]
83 pub unsafe fn setVertical(&self, vertical: bool);
84
85 #[cfg(feature = "AppKit_NSColor")]
86 #[method_id(@__retain_semantics Other trackFillColor)]
87 pub unsafe fn trackFillColor(&self) -> Option<Id<NSColor>>;
88
89 #[cfg(feature = "AppKit_NSColor")]
90 #[method(setTrackFillColor:)]
91 pub unsafe fn setTrackFillColor(&self, track_fill_color: Option<&NSColor>);
92 }
93);
94
95extern_methods!(
96 #[cfg(feature = "AppKit_NSSlider")]
98 unsafe impl NSSlider {
99 #[method_id(@__retain_semantics Init initWithFrame:)]
100 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Id<Self>;
101
102 #[cfg(feature = "Foundation_NSCoder")]
103 #[method_id(@__retain_semantics Init initWithCoder:)]
104 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Option<Id<Self>>;
105 }
106);
107
108extern_methods!(
109 #[cfg(feature = "AppKit_NSSlider")]
111 unsafe impl NSSlider {
112 #[method_id(@__retain_semantics Init init)]
113 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
114 }
115);
116
117extern_methods!(
118 #[cfg(feature = "AppKit_NSSlider")]
120 unsafe impl NSSlider {
121 #[method_id(@__retain_semantics New new)]
122 pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
123 }
124);
125
126extern_methods!(
127 #[cfg(feature = "AppKit_NSSlider")]
129 unsafe impl NSSlider {}
130);
131
132extern_methods!(
133 #[cfg(feature = "AppKit_NSSlider")]
135 unsafe impl NSSlider {
136 #[method(numberOfTickMarks)]
137 pub unsafe fn numberOfTickMarks(&self) -> NSInteger;
138
139 #[method(setNumberOfTickMarks:)]
140 pub unsafe fn setNumberOfTickMarks(&self, number_of_tick_marks: NSInteger);
141
142 #[method(tickMarkPosition)]
143 pub unsafe fn tickMarkPosition(&self) -> NSTickMarkPosition;
144
145 #[method(setTickMarkPosition:)]
146 pub unsafe fn setTickMarkPosition(&self, tick_mark_position: NSTickMarkPosition);
147
148 #[method(allowsTickMarkValuesOnly)]
149 pub unsafe fn allowsTickMarkValuesOnly(&self) -> bool;
150
151 #[method(setAllowsTickMarkValuesOnly:)]
152 pub unsafe fn setAllowsTickMarkValuesOnly(&self, allows_tick_mark_values_only: bool);
153
154 #[method(tickMarkValueAtIndex:)]
155 pub unsafe fn tickMarkValueAtIndex(&self, index: NSInteger) -> c_double;
156
157 #[method(rectOfTickMarkAtIndex:)]
158 pub unsafe fn rectOfTickMarkAtIndex(&self, index: NSInteger) -> NSRect;
159
160 #[method(indexOfTickMarkAtPoint:)]
161 pub unsafe fn indexOfTickMarkAtPoint(&self, point: NSPoint) -> NSInteger;
162
163 #[method(closestTickMarkValueToValue:)]
164 pub unsafe fn closestTickMarkValueToValue(&self, value: c_double) -> c_double;
165 }
166);
167
168extern_methods!(
169 #[cfg(feature = "AppKit_NSSlider")]
171 unsafe impl NSSlider {
172 #[method_id(@__retain_semantics Other sliderWithTarget:action:)]
173 pub unsafe fn sliderWithTarget_action(
174 target: Option<&AnyObject>,
175 action: Option<Sel>,
176 mtm: MainThreadMarker,
177 ) -> Id<Self>;
178
179 #[method_id(@__retain_semantics Other sliderWithValue:minValue:maxValue:target:action:)]
180 pub unsafe fn sliderWithValue_minValue_maxValue_target_action(
181 value: c_double,
182 min_value: c_double,
183 max_value: c_double,
184 target: Option<&AnyObject>,
185 action: Option<Sel>,
186 mtm: MainThreadMarker,
187 ) -> Id<Self>;
188 }
189);
190
191extern_methods!(
192 #[cfg(feature = "AppKit_NSSlider")]
194 unsafe impl NSSlider {
195 #[cfg(feature = "AppKit_NSCell")]
196 #[deprecated = "-setTitleCell: had no effect since 10.0"]
197 #[method(setTitleCell:)]
198 pub unsafe fn setTitleCell(&self, cell: Option<&NSCell>);
199
200 #[deprecated = "-titleCell has returned nil since 10.0"]
201 #[method_id(@__retain_semantics Other titleCell)]
202 pub unsafe fn titleCell(&self) -> Option<Id<AnyObject>>;
203
204 #[cfg(feature = "AppKit_NSColor")]
205 #[deprecated = "-setTitleColor: had no effect since 10.0"]
206 #[method(setTitleColor:)]
207 pub unsafe fn setTitleColor(&self, new_color: Option<&NSColor>);
208
209 #[cfg(feature = "AppKit_NSColor")]
210 #[deprecated = "-titleColor has returned nil since 10.0"]
211 #[method_id(@__retain_semantics Other titleColor)]
212 pub unsafe fn titleColor(&self) -> Option<Id<NSColor>>;
213
214 #[cfg(feature = "AppKit_NSFont")]
215 #[deprecated = "-setTitleFont: had no effect since 10.0"]
216 #[method(setTitleFont:)]
217 pub unsafe fn setTitleFont(&self, font_obj: Option<&NSFont>);
218
219 #[cfg(feature = "AppKit_NSFont")]
220 #[deprecated = "-titleFont has returned nil since 10.0"]
221 #[method_id(@__retain_semantics Other titleFont)]
222 pub unsafe fn titleFont(&self) -> Option<Id<NSFont>>;
223
224 #[cfg(feature = "Foundation_NSString")]
225 #[deprecated = "-title has returned nil since 10.0"]
226 #[method_id(@__retain_semantics Other title)]
227 pub unsafe fn title(&self) -> Option<Id<NSString>>;
228
229 #[cfg(feature = "Foundation_NSString")]
230 #[deprecated = "-setTitle: had no effect since 10.0"]
231 #[method(setTitle:)]
232 pub unsafe fn setTitle(&self, string: Option<&NSString>);
233
234 #[deprecated = "-knobThickness has returned 0 since 10.0"]
235 #[method(setKnobThickness:)]
236 pub unsafe fn setKnobThickness(&self, thickness: CGFloat);
237
238 #[cfg(feature = "AppKit_NSImage")]
239 #[deprecated = "-setImage: had no effect since 10.0"]
240 #[method(setImage:)]
241 pub unsafe fn setImage(&self, background_image: Option<&NSImage>);
242
243 #[cfg(feature = "AppKit_NSImage")]
244 #[deprecated = "-image has returned nil since 10.0"]
245 #[method_id(@__retain_semantics Other image)]
246 pub unsafe fn image(&self) -> Option<Id<NSImage>>;
247 }
248);