use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIBandSelectionInteractionState(pub NSInteger);
impl UIBandSelectionInteractionState {
#[doc(alias = "UIBandSelectionInteractionStatePossible")]
pub const Possible: Self = Self(0);
#[doc(alias = "UIBandSelectionInteractionStateBegan")]
pub const Began: Self = Self(1);
#[doc(alias = "UIBandSelectionInteractionStateSelecting")]
pub const Selecting: Self = Self(2);
#[doc(alias = "UIBandSelectionInteractionStateEnded")]
pub const Ended: Self = Self(3);
}
unsafe impl Encode for UIBandSelectionInteractionState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIBandSelectionInteractionState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIBandSelectionInteraction;
);
extern_conformance!(
unsafe impl NSObjectProtocol for UIBandSelectionInteraction {}
);
#[cfg(feature = "UIInteraction")]
extern_conformance!(
unsafe impl UIInteraction for UIBandSelectionInteraction {}
);
impl UIBandSelectionInteraction {
extern_methods!(
#[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);
#[unsafe(method(state))]
#[unsafe(method_family = none)]
pub fn state(&self) -> UIBandSelectionInteractionState;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(selectionRect))]
#[unsafe(method_family = none)]
pub fn selectionRect(&self) -> CGRect;
#[cfg(feature = "UICommand")]
#[unsafe(method(initialModifierFlags))]
#[unsafe(method_family = none)]
pub fn initialModifierFlags(&self) -> UIKeyModifierFlags;
#[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
#[unsafe(method(shouldBeginHandler))]
#[unsafe(method_family = none)]
pub unsafe fn shouldBeginHandler(
&self,
) -> *mut block2::DynBlock<dyn Fn(NonNull<UIBandSelectionInteraction>, CGPoint) -> Bool>;
#[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
#[unsafe(method(setShouldBeginHandler:))]
#[unsafe(method_family = none)]
pub fn setShouldBeginHandler(
&self,
should_begin_handler: Option<
&block2::DynBlock<dyn Fn(NonNull<UIBandSelectionInteraction>, CGPoint) -> Bool>,
>,
);
#[cfg(feature = "block2")]
#[unsafe(method(initWithSelectionHandler:))]
#[unsafe(method_family = init)]
pub fn initWithSelectionHandler(
this: Allocated<Self>,
selection_handler: &block2::DynBlock<dyn Fn(NonNull<UIBandSelectionInteraction>)>,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}