objc2-app-kit 0.3.2

Bindings to the AppKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssteppercell?language=objc)
    #[unsafe(super(NSActionCell, NSCell, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
    pub struct NSStepperCell;
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSActionCell",
    feature = "NSCell"
))]
extern_conformance!(
    unsafe impl NSAccessibility for NSStepperCell {}
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSActionCell",
    feature = "NSCell"
))]
extern_conformance!(
    unsafe impl NSAccessibilityElementProtocol for NSStepperCell {}
);

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
extern_conformance!(
    unsafe impl NSCoding for NSStepperCell {}
);

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
extern_conformance!(
    unsafe impl NSCopying for NSStepperCell {}
);

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
unsafe impl CopyingHelper for NSStepperCell {
    type Result = Self;
}

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for NSStepperCell {}
);

#[cfg(all(
    feature = "NSActionCell",
    feature = "NSCell",
    feature = "NSUserInterfaceItemIdentification"
))]
extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for NSStepperCell {}
);

#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
impl NSStepperCell {
    extern_methods!(
        #[unsafe(method(minValue))]
        #[unsafe(method_family = none)]
        pub fn minValue(&self) -> c_double;

        /// Setter for [`minValue`][Self::minValue].
        #[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;

        /// Setter for [`maxValue`][Self::maxValue].
        #[unsafe(method(setMaxValue:))]
        #[unsafe(method_family = none)]
        pub fn setMaxValue(&self, max_value: c_double);

        #[unsafe(method(increment))]
        #[unsafe(method_family = none)]
        pub fn increment(&self) -> c_double;

        /// Setter for [`increment`][Self::increment].
        #[unsafe(method(setIncrement:))]
        #[unsafe(method_family = none)]
        pub fn setIncrement(&self, increment: c_double);

        #[unsafe(method(valueWraps))]
        #[unsafe(method_family = none)]
        pub fn valueWraps(&self) -> bool;

        /// Setter for [`valueWraps`][Self::valueWraps].
        #[unsafe(method(setValueWraps:))]
        #[unsafe(method_family = none)]
        pub fn setValueWraps(&self, value_wraps: bool);

        #[unsafe(method(autorepeat))]
        #[unsafe(method_family = none)]
        pub fn autorepeat(&self) -> bool;

        /// Setter for [`autorepeat`][Self::autorepeat].
        #[unsafe(method(setAutorepeat:))]
        #[unsafe(method_family = none)]
        pub fn setAutorepeat(&self, autorepeat: bool);
    );
}

/// Methods declared on superclass `NSCell`.
#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
impl NSStepperCell {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(initTextCell:))]
        #[unsafe(method_family = init)]
        pub fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;

        #[cfg(feature = "NSImage")]
        #[unsafe(method(initImageCell:))]
        #[unsafe(method_family = init)]
        pub fn initImageCell(this: Allocated<Self>, image: Option<&NSImage>) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "NSActionCell", feature = "NSCell"))]
impl NSStepperCell {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}