use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIScrollType(pub NSUInteger);
impl UIScrollType {
#[doc(alias = "UIScrollTypeDiscrete")]
pub const Discrete: Self = Self(0);
#[doc(alias = "UIScrollTypeContinuous")]
pub const Continuous: Self = Self(1);
}
unsafe impl Encode for UIScrollType {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for UIScrollType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIScrollTypeMask(pub NSInteger);
bitflags::bitflags! {
impl UIScrollTypeMask: NSInteger {
#[doc(alias = "UIScrollTypeMaskDiscrete")]
const Discrete = 1<<UIScrollType::Discrete.0;
#[doc(alias = "UIScrollTypeMaskContinuous")]
const Continuous = 1<<UIScrollType::Continuous.0;
#[doc(alias = "UIScrollTypeMaskAll")]
const All = UIScrollTypeMask::Discrete.0|UIScrollTypeMask::Continuous.0;
}
}
unsafe impl Encode for UIScrollTypeMask {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIScrollTypeMask {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(UIGestureRecognizer, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UIGestureRecognizer")]
pub struct UIPanGestureRecognizer;
);
#[cfg(feature = "UIGestureRecognizer")]
extern_conformance!(
unsafe impl NSObjectProtocol for UIPanGestureRecognizer {}
);
#[cfg(feature = "UIGestureRecognizer")]
impl UIPanGestureRecognizer {
extern_methods!(
#[unsafe(method(minimumNumberOfTouches))]
#[unsafe(method_family = none)]
pub fn minimumNumberOfTouches(&self) -> NSUInteger;
#[unsafe(method(setMinimumNumberOfTouches:))]
#[unsafe(method_family = none)]
pub fn setMinimumNumberOfTouches(&self, minimum_number_of_touches: NSUInteger);
#[unsafe(method(maximumNumberOfTouches))]
#[unsafe(method_family = none)]
pub fn maximumNumberOfTouches(&self) -> NSUInteger;
#[unsafe(method(setMaximumNumberOfTouches:))]
#[unsafe(method_family = none)]
pub fn setMaximumNumberOfTouches(&self, maximum_number_of_touches: NSUInteger);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-core-foundation"
))]
#[unsafe(method(translationInView:))]
#[unsafe(method_family = none)]
pub fn translationInView(&self, view: Option<&UIView>) -> CGPoint;
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-core-foundation"
))]
#[unsafe(method(setTranslation:inView:))]
#[unsafe(method_family = none)]
pub fn setTranslation_inView(&self, translation: CGPoint, view: Option<&UIView>);
#[cfg(all(
feature = "UIResponder",
feature = "UIView",
feature = "objc2-core-foundation"
))]
#[unsafe(method(velocityInView:))]
#[unsafe(method_family = none)]
pub fn velocityInView(&self, view: Option<&UIView>) -> CGPoint;
#[unsafe(method(allowedScrollTypesMask))]
#[unsafe(method_family = none)]
pub fn allowedScrollTypesMask(&self) -> UIScrollTypeMask;
#[unsafe(method(setAllowedScrollTypesMask:))]
#[unsafe(method_family = none)]
pub fn setAllowedScrollTypesMask(&self, allowed_scroll_types_mask: UIScrollTypeMask);
);
}
#[cfg(feature = "UIGestureRecognizer")]
impl UIPanGestureRecognizer {
extern_methods!(
#[unsafe(method(initWithTarget:action:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithTarget_action(
this: Allocated<Self>,
target: Option<&AnyObject>,
action: Option<Sel>,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(feature = "UIGestureRecognizer")]
impl UIPanGestureRecognizer {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}