use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSSliderAccessory;
);
extern_conformance!(
unsafe impl NSCoding for NSSliderAccessory {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSSliderAccessory {}
);
impl NSSliderAccessory {
extern_methods!(
#[cfg(feature = "NSImage")]
#[unsafe(method(accessoryWithImage:))]
#[unsafe(method_family = none)]
pub fn accessoryWithImage(
image: &NSImage,
mtm: MainThreadMarker,
) -> Retained<NSSliderAccessory>;
#[unsafe(method(behavior))]
#[unsafe(method_family = none)]
pub fn behavior(&self) -> Retained<NSSliderAccessoryBehavior>;
#[unsafe(method(setBehavior:))]
#[unsafe(method_family = none)]
pub fn setBehavior(&self, behavior: &NSSliderAccessoryBehavior);
#[unsafe(method(isEnabled))]
#[unsafe(method_family = none)]
pub fn isEnabled(&self) -> bool;
#[unsafe(method(setEnabled:))]
#[unsafe(method_family = none)]
pub fn setEnabled(&self, enabled: bool);
);
}
impl NSSliderAccessory {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
impl NSSliderAccessory {
extern_methods!();
}
#[cfg(feature = "NSAccessibilityProtocols")]
extern_conformance!(
unsafe impl NSAccessibility for NSSliderAccessory {}
);
#[cfg(feature = "NSAccessibilityProtocols")]
extern_conformance!(
unsafe impl NSAccessibilityElementProtocol for NSSliderAccessory {}
);
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSSliderAccessoryBehavior;
);
extern_conformance!(
unsafe impl NSCoding for NSSliderAccessoryBehavior {}
);
extern_conformance!(
unsafe impl NSCopying for NSSliderAccessoryBehavior {}
);
unsafe impl CopyingHelper for NSSliderAccessoryBehavior {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSSliderAccessoryBehavior {}
);
impl NSSliderAccessoryBehavior {
extern_methods!(
#[unsafe(method(automaticBehavior))]
#[unsafe(method_family = none)]
pub fn automaticBehavior(mtm: MainThreadMarker) -> Retained<NSSliderAccessoryBehavior>;
#[unsafe(method(valueStepBehavior))]
#[unsafe(method_family = none)]
pub fn valueStepBehavior(mtm: MainThreadMarker) -> Retained<NSSliderAccessoryBehavior>;
#[unsafe(method(valueResetBehavior))]
#[unsafe(method_family = none)]
pub fn valueResetBehavior(mtm: MainThreadMarker) -> Retained<NSSliderAccessoryBehavior>;
#[unsafe(method(behaviorWithTarget:action:))]
#[unsafe(method_family = none)]
pub unsafe fn behaviorWithTarget_action(
target: Option<&AnyObject>,
action: Sel,
mtm: MainThreadMarker,
) -> Retained<NSSliderAccessoryBehavior>;
#[cfg(feature = "block2")]
#[unsafe(method(behaviorWithHandler:))]
#[unsafe(method_family = none)]
pub fn behaviorWithHandler(
handler: &block2::DynBlock<dyn Fn(NonNull<NSSliderAccessory>)>,
mtm: MainThreadMarker,
) -> Retained<NSSliderAccessoryBehavior>;
#[unsafe(method(handleAction:))]
#[unsafe(method_family = none)]
pub fn handleAction(&self, sender: &NSSliderAccessory);
);
}
impl NSSliderAccessoryBehavior {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}