objc2_app_kit/generated/
NSProgressIndicator.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsprogressindicatorstyle?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSProgressIndicatorStyle(pub NSUInteger);
15impl NSProgressIndicatorStyle {
16    #[doc(alias = "NSProgressIndicatorStyleBar")]
17    pub const Bar: Self = Self(0);
18    #[doc(alias = "NSProgressIndicatorStyleSpinning")]
19    pub const Spinning: Self = Self(1);
20}
21
22unsafe impl Encode for NSProgressIndicatorStyle {
23    const ENCODING: Encoding = NSUInteger::ENCODING;
24}
25
26unsafe impl RefEncode for NSProgressIndicatorStyle {
27    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
28}
29
30extern_class!(
31    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsprogressindicator?language=objc)
32    #[unsafe(super(NSView, NSResponder, NSObject))]
33    #[derive(Debug, PartialEq, Eq, Hash)]
34    #[cfg(all(feature = "NSResponder", feature = "NSView"))]
35    pub struct NSProgressIndicator;
36);
37
38#[cfg(all(
39    feature = "NSAccessibilityProtocols",
40    feature = "NSResponder",
41    feature = "NSView"
42))]
43unsafe impl NSAccessibility for NSProgressIndicator {}
44
45#[cfg(all(
46    feature = "NSAccessibilityProtocols",
47    feature = "NSResponder",
48    feature = "NSView"
49))]
50unsafe impl NSAccessibilityElementProtocol for NSProgressIndicator {}
51
52#[cfg(all(
53    feature = "NSAccessibilityProtocols",
54    feature = "NSResponder",
55    feature = "NSView"
56))]
57unsafe impl NSAccessibilityGroup for NSProgressIndicator {}
58
59#[cfg(all(
60    feature = "NSAccessibilityProtocols",
61    feature = "NSResponder",
62    feature = "NSView"
63))]
64unsafe impl NSAccessibilityProgressIndicator for NSProgressIndicator {}
65
66#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
67unsafe impl NSAnimatablePropertyContainer for NSProgressIndicator {}
68
69#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
70unsafe impl NSAppearanceCustomization for NSProgressIndicator {}
71
72#[cfg(all(feature = "NSResponder", feature = "NSView"))]
73unsafe impl NSCoding for NSProgressIndicator {}
74
75#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
76unsafe impl NSDraggingDestination for NSProgressIndicator {}
77
78#[cfg(all(feature = "NSResponder", feature = "NSView"))]
79unsafe impl NSObjectProtocol for NSProgressIndicator {}
80
81#[cfg(all(
82    feature = "NSResponder",
83    feature = "NSUserInterfaceItemIdentification",
84    feature = "NSView"
85))]
86unsafe impl NSUserInterfaceItemIdentification for NSProgressIndicator {}
87
88#[cfg(all(feature = "NSResponder", feature = "NSView"))]
89impl NSProgressIndicator {
90    extern_methods!(
91        #[unsafe(method(isIndeterminate))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn isIndeterminate(&self) -> bool;
94
95        /// Setter for [`isIndeterminate`][Self::isIndeterminate].
96        #[unsafe(method(setIndeterminate:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn setIndeterminate(&self, indeterminate: bool);
99
100        #[cfg(feature = "NSCell")]
101        #[unsafe(method(controlSize))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn controlSize(&self) -> NSControlSize;
104
105        #[cfg(feature = "NSCell")]
106        /// Setter for [`controlSize`][Self::controlSize].
107        #[unsafe(method(setControlSize:))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn setControlSize(&self, control_size: NSControlSize);
110
111        #[unsafe(method(doubleValue))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn doubleValue(&self) -> c_double;
114
115        /// Setter for [`doubleValue`][Self::doubleValue].
116        #[unsafe(method(setDoubleValue:))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn setDoubleValue(&self, double_value: c_double);
119
120        #[unsafe(method(incrementBy:))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn incrementBy(&self, delta: c_double);
123
124        #[unsafe(method(minValue))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn minValue(&self) -> c_double;
127
128        /// Setter for [`minValue`][Self::minValue].
129        #[unsafe(method(setMinValue:))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn setMinValue(&self, min_value: c_double);
132
133        #[unsafe(method(maxValue))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn maxValue(&self) -> c_double;
136
137        /// Setter for [`maxValue`][Self::maxValue].
138        #[unsafe(method(setMaxValue:))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn setMaxValue(&self, max_value: c_double);
141
142        #[unsafe(method(observedProgress))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn observedProgress(&self) -> Option<Retained<NSProgress>>;
145
146        /// Setter for [`observedProgress`][Self::observedProgress].
147        #[unsafe(method(setObservedProgress:))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn setObservedProgress(&self, observed_progress: Option<&NSProgress>);
150
151        #[unsafe(method(usesThreadedAnimation))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn usesThreadedAnimation(&self) -> bool;
154
155        /// Setter for [`usesThreadedAnimation`][Self::usesThreadedAnimation].
156        #[unsafe(method(setUsesThreadedAnimation:))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn setUsesThreadedAnimation(&self, uses_threaded_animation: bool);
159
160        #[unsafe(method(startAnimation:))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn startAnimation(&self, sender: Option<&AnyObject>);
163
164        #[unsafe(method(stopAnimation:))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn stopAnimation(&self, sender: Option<&AnyObject>);
167
168        #[unsafe(method(style))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn style(&self) -> NSProgressIndicatorStyle;
171
172        /// Setter for [`style`][Self::style].
173        #[unsafe(method(setStyle:))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn setStyle(&self, style: NSProgressIndicatorStyle);
176
177        #[unsafe(method(sizeToFit))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn sizeToFit(&self);
180
181        #[unsafe(method(isDisplayedWhenStopped))]
182        #[unsafe(method_family = none)]
183        pub unsafe fn isDisplayedWhenStopped(&self) -> bool;
184
185        /// Setter for [`isDisplayedWhenStopped`][Self::isDisplayedWhenStopped].
186        #[unsafe(method(setDisplayedWhenStopped:))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn setDisplayedWhenStopped(&self, displayed_when_stopped: bool);
189    );
190}
191
192/// Methods declared on superclass `NSView`.
193#[cfg(all(feature = "NSResponder", feature = "NSView"))]
194impl NSProgressIndicator {
195    extern_methods!(
196        #[unsafe(method(initWithFrame:))]
197        #[unsafe(method_family = init)]
198        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
199
200        #[unsafe(method(initWithCoder:))]
201        #[unsafe(method_family = init)]
202        pub unsafe fn initWithCoder(
203            this: Allocated<Self>,
204            coder: &NSCoder,
205        ) -> Option<Retained<Self>>;
206    );
207}
208
209/// Methods declared on superclass `NSResponder`.
210#[cfg(all(feature = "NSResponder", feature = "NSView"))]
211impl NSProgressIndicator {
212    extern_methods!(
213        #[unsafe(method(init))]
214        #[unsafe(method_family = init)]
215        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
216    );
217}
218
219/// Methods declared on superclass `NSObject`.
220#[cfg(all(feature = "NSResponder", feature = "NSView"))]
221impl NSProgressIndicator {
222    extern_methods!(
223        #[unsafe(method(new))]
224        #[unsafe(method_family = new)]
225        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
226    );
227}
228
229/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsprogressindicatorthickness?language=objc)
230// NS_ENUM
231#[deprecated = "These constants do not accurately represent the geometry of NSProgressIndicator.  Use `controlSize` and `sizeToFit` instead."]
232#[repr(transparent)]
233#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
234pub struct NSProgressIndicatorThickness(pub NSUInteger);
235impl NSProgressIndicatorThickness {
236    #[deprecated = "These constants do not accurately represent the geometry of NSProgressIndicator.  Use `controlSize` and `sizeToFit` instead."]
237    #[doc(alias = "NSProgressIndicatorPreferredThickness")]
238    pub const PreferredThickness: Self = Self(14);
239    #[deprecated = "These constants do not accurately represent the geometry of NSProgressIndicator.  Use `controlSize` and `sizeToFit` instead."]
240    #[doc(alias = "NSProgressIndicatorPreferredSmallThickness")]
241    pub const PreferredSmallThickness: Self = Self(10);
242    #[deprecated = "These constants do not accurately represent the geometry of NSProgressIndicator.  Use `controlSize` and `sizeToFit` instead."]
243    #[doc(alias = "NSProgressIndicatorPreferredLargeThickness")]
244    pub const PreferredLargeThickness: Self = Self(18);
245    #[deprecated = "These constants do not accurately represent the geometry of NSProgressIndicator.  Use `controlSize` and `sizeToFit` instead."]
246    #[doc(alias = "NSProgressIndicatorPreferredAquaThickness")]
247    pub const PreferredAquaThickness: Self = Self(12);
248}
249
250unsafe impl Encode for NSProgressIndicatorThickness {
251    const ENCODING: Encoding = NSUInteger::ENCODING;
252}
253
254unsafe impl RefEncode for NSProgressIndicatorThickness {
255    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
256}
257
258/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsprogressindicatorbarstyle?language=objc)
259pub static NSProgressIndicatorBarStyle: NSProgressIndicatorStyle =
260    NSProgressIndicatorStyle(NSProgressIndicatorStyle::Bar.0);
261
262/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsprogressindicatorspinningstyle?language=objc)
263pub static NSProgressIndicatorSpinningStyle: NSProgressIndicatorStyle =
264    NSProgressIndicatorStyle(NSProgressIndicatorStyle::Spinning.0);
265
266/// NSProgressIndicatorDeprecated.
267#[cfg(all(feature = "NSResponder", feature = "NSView"))]
268impl NSProgressIndicator {
269    extern_methods!(
270        #[deprecated = "The animationDelay property does nothing."]
271        #[unsafe(method(animationDelay))]
272        #[unsafe(method_family = none)]
273        pub unsafe fn animationDelay(&self) -> NSTimeInterval;
274
275        #[deprecated = "The animationDelay property does nothing."]
276        #[unsafe(method(setAnimationDelay:))]
277        #[unsafe(method_family = none)]
278        pub unsafe fn setAnimationDelay(&self, delay: NSTimeInterval);
279
280        #[deprecated = "Use -startAnimation and -stopAnimation instead."]
281        #[unsafe(method(animate:))]
282        #[unsafe(method_family = none)]
283        pub unsafe fn animate(&self, sender: Option<&AnyObject>);
284
285        #[deprecated = "The bezeled property is not respected on 10.15 and later"]
286        #[unsafe(method(isBezeled))]
287        #[unsafe(method_family = none)]
288        pub unsafe fn isBezeled(&self) -> bool;
289
290        /// Setter for [`isBezeled`][Self::isBezeled].
291        #[deprecated = "The bezeled property is not respected on 10.15 and later"]
292        #[unsafe(method(setBezeled:))]
293        #[unsafe(method_family = none)]
294        pub unsafe fn setBezeled(&self, bezeled: bool);
295
296        #[cfg(feature = "NSCell")]
297        #[deprecated = "The controlTint property is not respected on 10.15 and later"]
298        #[unsafe(method(controlTint))]
299        #[unsafe(method_family = none)]
300        pub unsafe fn controlTint(&self) -> NSControlTint;
301
302        #[cfg(feature = "NSCell")]
303        /// Setter for [`controlTint`][Self::controlTint].
304        #[deprecated = "The controlTint property is not respected on 10.15 and later"]
305        #[unsafe(method(setControlTint:))]
306        #[unsafe(method_family = none)]
307        pub unsafe fn setControlTint(&self, control_tint: NSControlTint);
308    );
309}