objc2-ui-kit 0.3.2

Bindings to the UIKit 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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uistepper?language=objc)
    #[unsafe(super(UIControl, UIView, UIResponder, NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
    pub struct UIStepper;
);

#[cfg(all(
    feature = "UIControl",
    feature = "UIResponder",
    feature = "UIView",
    feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
    unsafe impl CALayerDelegate for UIStepper {}
);

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl NSCoding for UIStepper {}
);

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for UIStepper {}
);

#[cfg(all(
    feature = "UIAppearance",
    feature = "UIControl",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIAppearance for UIStepper {}
);

#[cfg(all(
    feature = "UIAppearance",
    feature = "UIControl",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIAppearanceContainer for UIStepper {}
);

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UICoordinateSpace for UIStepper {}
);

#[cfg(all(
    feature = "UIControl",
    feature = "UIDynamicBehavior",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIDynamicItem for UIStepper {}
);

#[cfg(all(
    feature = "UIControl",
    feature = "UIFocus",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIFocusEnvironment for UIStepper {}
);

#[cfg(all(
    feature = "UIControl",
    feature = "UIFocus",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIFocusItem for UIStepper {}
);

#[cfg(all(
    feature = "UIControl",
    feature = "UIFocus",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIFocusItemContainer for UIStepper {}
);

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIResponderStandardEditActions for UIStepper {}
);

#[cfg(all(
    feature = "UIControl",
    feature = "UIResponder",
    feature = "UITraitCollection",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UITraitEnvironment for UIStepper {}
);

#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIStepper {
    extern_methods!(
        #[unsafe(method(isContinuous))]
        #[unsafe(method_family = none)]
        pub fn isContinuous(&self) -> bool;

        /// Setter for [`isContinuous`][Self::isContinuous].
        #[unsafe(method(setContinuous:))]
        #[unsafe(method_family = none)]
        pub fn setContinuous(&self, continuous: 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);

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

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

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

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

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

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

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

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

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

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

        #[cfg(feature = "UIImage")]
        #[unsafe(method(setBackgroundImage:forState:))]
        #[unsafe(method_family = none)]
        pub fn setBackgroundImage_forState(&self, image: Option<&UIImage>, state: UIControlState);

        #[cfg(feature = "UIImage")]
        #[unsafe(method(backgroundImageForState:))]
        #[unsafe(method_family = none)]
        pub fn backgroundImageForState(&self, state: UIControlState) -> Option<Retained<UIImage>>;

        #[cfg(feature = "UIImage")]
        #[unsafe(method(setDividerImage:forLeftSegmentState:rightSegmentState:))]
        #[unsafe(method_family = none)]
        pub fn setDividerImage_forLeftSegmentState_rightSegmentState(
            &self,
            image: Option<&UIImage>,
            left_state: UIControlState,
            right_state: UIControlState,
        );

        #[cfg(feature = "UIImage")]
        #[unsafe(method(setIncrementImage:forState:))]
        #[unsafe(method_family = none)]
        pub fn setIncrementImage_forState(&self, image: Option<&UIImage>, state: UIControlState);

        #[cfg(feature = "UIImage")]
        #[unsafe(method(incrementImageForState:))]
        #[unsafe(method_family = none)]
        pub fn incrementImageForState(&self, state: UIControlState) -> Option<Retained<UIImage>>;

        #[cfg(feature = "UIImage")]
        #[unsafe(method(setDecrementImage:forState:))]
        #[unsafe(method_family = none)]
        pub fn setDecrementImage_forState(&self, image: Option<&UIImage>, state: UIControlState);

        #[cfg(feature = "UIImage")]
        #[unsafe(method(decrementImageForState:))]
        #[unsafe(method_family = none)]
        pub fn decrementImageForState(&self, state: UIControlState) -> Option<Retained<UIImage>>;
    );
}

/// Methods declared on superclass `UIControl`.
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIStepper {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;

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

        #[cfg(all(
            feature = "UIAction",
            feature = "UIMenuElement",
            feature = "objc2-core-foundation"
        ))]
        /// Initializes the control and adds primaryAction for the UIControlEventPrimaryActionTriggered control event. Subclasses of UIControl may alter or add behaviors around the usage of primaryAction, see subclass documentation of this initializer for additional information.
        #[unsafe(method(initWithFrame:primaryAction:))]
        #[unsafe(method_family = init)]
        pub fn initWithFrame_primaryAction(
            this: Allocated<Self>,
            frame: CGRect,
            primary_action: Option<&UIAction>,
        ) -> Retained<Self>;
    );
}

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

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