use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSProgressIndicatorStyle(pub NSUInteger);
impl NSProgressIndicatorStyle {
#[doc(alias = "NSProgressIndicatorStyleBar")]
pub const Bar: Self = Self(0);
#[doc(alias = "NSProgressIndicatorStyleSpinning")]
pub const Spinning: Self = Self(1);
}
unsafe impl Encode for NSProgressIndicatorStyle {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSProgressIndicatorStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSView, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
pub struct NSProgressIndicator;
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAccessibility for NSProgressIndicator {}
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAccessibilityElementProtocol for NSProgressIndicator {}
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAccessibilityGroup for NSProgressIndicator {}
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAccessibilityProgressIndicator for NSProgressIndicator {}
);
#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSAnimatablePropertyContainer for NSProgressIndicator {}
);
#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSAppearanceCustomization for NSProgressIndicator {}
);
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSCoding for NSProgressIndicator {}
);
#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSDraggingDestination for NSProgressIndicator {}
);
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSObjectProtocol for NSProgressIndicator {}
);
#[cfg(all(
feature = "NSResponder",
feature = "NSUserInterfaceItemIdentification",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for NSProgressIndicator {}
);
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSProgressIndicator {
extern_methods!(
#[unsafe(method(isIndeterminate))]
#[unsafe(method_family = none)]
pub fn isIndeterminate(&self) -> bool;
#[unsafe(method(setIndeterminate:))]
#[unsafe(method_family = none)]
pub fn setIndeterminate(&self, indeterminate: bool);
#[cfg(feature = "NSCell")]
#[unsafe(method(controlSize))]
#[unsafe(method_family = none)]
pub fn controlSize(&self) -> NSControlSize;
#[cfg(feature = "NSCell")]
#[unsafe(method(setControlSize:))]
#[unsafe(method_family = none)]
pub fn setControlSize(&self, control_size: NSControlSize);
#[unsafe(method(doubleValue))]
#[unsafe(method_family = none)]
pub fn doubleValue(&self) -> c_double;
#[unsafe(method(setDoubleValue:))]
#[unsafe(method_family = none)]
pub fn setDoubleValue(&self, double_value: c_double);
#[unsafe(method(incrementBy:))]
#[unsafe(method_family = none)]
pub fn incrementBy(&self, delta: c_double);
#[unsafe(method(minValue))]
#[unsafe(method_family = none)]
pub fn minValue(&self) -> c_double;
#[unsafe(method(setMinValue:))]
#[unsafe(method_family = none)]
pub fn setMinValue(&self, min_value: c_double);
#[unsafe(method(maxValue))]
#[unsafe(method_family = none)]
pub fn maxValue(&self) -> c_double;
#[unsafe(method(setMaxValue:))]
#[unsafe(method_family = none)]
pub fn setMaxValue(&self, max_value: c_double);
#[unsafe(method(observedProgress))]
#[unsafe(method_family = none)]
pub fn observedProgress(&self) -> Option<Retained<NSProgress>>;
#[unsafe(method(setObservedProgress:))]
#[unsafe(method_family = none)]
pub fn setObservedProgress(&self, observed_progress: Option<&NSProgress>);
#[unsafe(method(usesThreadedAnimation))]
#[unsafe(method_family = none)]
pub fn usesThreadedAnimation(&self) -> bool;
#[unsafe(method(setUsesThreadedAnimation:))]
#[unsafe(method_family = none)]
pub unsafe fn setUsesThreadedAnimation(&self, uses_threaded_animation: bool);
#[unsafe(method(startAnimation:))]
#[unsafe(method_family = none)]
pub unsafe fn startAnimation(&self, sender: Option<&AnyObject>);
#[unsafe(method(stopAnimation:))]
#[unsafe(method_family = none)]
pub unsafe fn stopAnimation(&self, sender: Option<&AnyObject>);
#[unsafe(method(style))]
#[unsafe(method_family = none)]
pub fn style(&self) -> NSProgressIndicatorStyle;
#[unsafe(method(setStyle:))]
#[unsafe(method_family = none)]
pub fn setStyle(&self, style: NSProgressIndicatorStyle);
#[unsafe(method(sizeToFit))]
#[unsafe(method_family = none)]
pub fn sizeToFit(&self);
#[unsafe(method(isDisplayedWhenStopped))]
#[unsafe(method_family = none)]
pub fn isDisplayedWhenStopped(&self) -> bool;
#[unsafe(method(setDisplayedWhenStopped:))]
#[unsafe(method_family = none)]
pub fn setDisplayedWhenStopped(&self, displayed_when_stopped: bool);
);
}
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSProgressIndicator {
extern_methods!(
#[unsafe(method(initWithFrame:))]
#[unsafe(method_family = init)]
pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSProgressIndicator {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSProgressIndicator {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
#[deprecated = "These constants do not accurately represent the geometry of NSProgressIndicator. Use `controlSize` and `sizeToFit` instead."]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSProgressIndicatorThickness(pub NSUInteger);
impl NSProgressIndicatorThickness {
#[doc(alias = "NSProgressIndicatorPreferredThickness")]
#[deprecated = "These constants do not accurately represent the geometry of NSProgressIndicator. Use `controlSize` and `sizeToFit` instead."]
pub const PreferredThickness: Self = Self(14);
#[doc(alias = "NSProgressIndicatorPreferredSmallThickness")]
#[deprecated = "These constants do not accurately represent the geometry of NSProgressIndicator. Use `controlSize` and `sizeToFit` instead."]
pub const PreferredSmallThickness: Self = Self(10);
#[doc(alias = "NSProgressIndicatorPreferredLargeThickness")]
#[deprecated = "These constants do not accurately represent the geometry of NSProgressIndicator. Use `controlSize` and `sizeToFit` instead."]
pub const PreferredLargeThickness: Self = Self(18);
#[doc(alias = "NSProgressIndicatorPreferredAquaThickness")]
#[deprecated = "These constants do not accurately represent the geometry of NSProgressIndicator. Use `controlSize` and `sizeToFit` instead."]
pub const PreferredAquaThickness: Self = Self(12);
}
unsafe impl Encode for NSProgressIndicatorThickness {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSProgressIndicatorThickness {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[deprecated]
pub static NSProgressIndicatorBarStyle: NSProgressIndicatorStyle =
NSProgressIndicatorStyle(NSProgressIndicatorStyle::Bar.0);
#[deprecated]
pub static NSProgressIndicatorSpinningStyle: NSProgressIndicatorStyle =
NSProgressIndicatorStyle(NSProgressIndicatorStyle::Spinning.0);
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSProgressIndicator {
extern_methods!(
#[deprecated = "The animationDelay property does nothing."]
#[unsafe(method(animationDelay))]
#[unsafe(method_family = none)]
pub fn animationDelay(&self) -> NSTimeInterval;
#[deprecated = "The animationDelay property does nothing."]
#[unsafe(method(setAnimationDelay:))]
#[unsafe(method_family = none)]
pub fn setAnimationDelay(&self, delay: NSTimeInterval);
#[deprecated = "Use -startAnimation and -stopAnimation instead."]
#[unsafe(method(animate:))]
#[unsafe(method_family = none)]
pub unsafe fn animate(&self, sender: Option<&AnyObject>);
#[deprecated = "The bezeled property is not respected on 10.15 and later"]
#[unsafe(method(isBezeled))]
#[unsafe(method_family = none)]
pub fn isBezeled(&self) -> bool;
#[deprecated = "The bezeled property is not respected on 10.15 and later"]
#[unsafe(method(setBezeled:))]
#[unsafe(method_family = none)]
pub fn setBezeled(&self, bezeled: bool);
#[cfg(feature = "NSCell")]
#[deprecated = "The controlTint property is not respected on 10.15 and later"]
#[unsafe(method(controlTint))]
#[unsafe(method_family = none)]
pub fn controlTint(&self) -> NSControlTint;
#[cfg(feature = "NSCell")]
#[deprecated = "The controlTint property is not respected on 10.15 and later"]
#[unsafe(method(setControlTint:))]
#[unsafe(method_family = none)]
pub fn setControlTint(&self, control_tint: NSControlTint);
);
}