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 WKGestureRecognizerState(pub NSInteger);
impl WKGestureRecognizerState {
#[doc(alias = "WKGestureRecognizerStatePossible")]
pub const Possible: Self = Self(0);
#[doc(alias = "WKGestureRecognizerStateBegan")]
pub const Began: Self = Self(1);
#[doc(alias = "WKGestureRecognizerStateChanged")]
pub const Changed: Self = Self(2);
#[doc(alias = "WKGestureRecognizerStateEnded")]
pub const Ended: Self = Self(3);
#[doc(alias = "WKGestureRecognizerStateCancelled")]
pub const Cancelled: Self = Self(4);
#[doc(alias = "WKGestureRecognizerStateFailed")]
pub const Failed: Self = Self(5);
#[doc(alias = "WKGestureRecognizerStateRecognized")]
pub const Recognized: Self = Self(6);
}
unsafe impl Encode for WKGestureRecognizerState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for WKGestureRecognizerState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WKSwipeGestureRecognizerDirection(pub NSUInteger);
bitflags::bitflags! {
impl WKSwipeGestureRecognizerDirection: NSUInteger {
#[doc(alias = "WKSwipeGestureRecognizerDirectionRight")]
const Right = 1<<0;
#[doc(alias = "WKSwipeGestureRecognizerDirectionLeft")]
const Left = 1<<1;
#[doc(alias = "WKSwipeGestureRecognizerDirectionUp")]
const Up = 1<<2;
#[doc(alias = "WKSwipeGestureRecognizerDirectionDown")]
const Down = 1<<3;
}
}
unsafe impl Encode for WKSwipeGestureRecognizerDirection {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for WKSwipeGestureRecognizerDirection {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct WKGestureRecognizer;
);
extern_conformance!(
unsafe impl NSObjectProtocol for WKGestureRecognizer {}
);
impl WKGestureRecognizer {
extern_methods!(
#[unsafe(method(state))]
#[unsafe(method_family = none)]
pub unsafe fn state(&self) -> WKGestureRecognizerState;
#[unsafe(method(isEnabled))]
#[unsafe(method_family = none)]
pub unsafe fn isEnabled(&self) -> bool;
#[unsafe(method(setEnabled:))]
#[unsafe(method_family = none)]
pub unsafe fn setEnabled(&self, enabled: bool);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(locationInObject))]
#[unsafe(method_family = none)]
pub unsafe fn locationInObject(&self) -> CGPoint;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(objectBounds))]
#[unsafe(method_family = none)]
pub unsafe fn objectBounds(&self) -> CGRect;
);
}
impl WKGestureRecognizer {
extern_methods!(
#[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() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(WKGestureRecognizer, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct WKTapGestureRecognizer;
);
extern_conformance!(
unsafe impl NSObjectProtocol for WKTapGestureRecognizer {}
);
impl WKTapGestureRecognizer {
extern_methods!(
#[unsafe(method(numberOfTapsRequired))]
#[unsafe(method_family = none)]
pub unsafe fn numberOfTapsRequired(&self) -> NSUInteger;
#[unsafe(method(setNumberOfTapsRequired:))]
#[unsafe(method_family = none)]
pub unsafe fn setNumberOfTapsRequired(&self, number_of_taps_required: NSUInteger);
);
}
impl WKTapGestureRecognizer {
extern_methods!(
#[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() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(WKGestureRecognizer, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct WKLongPressGestureRecognizer;
);
extern_conformance!(
unsafe impl NSObjectProtocol for WKLongPressGestureRecognizer {}
);
impl WKLongPressGestureRecognizer {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(minimumPressDuration))]
#[unsafe(method_family = none)]
pub unsafe fn minimumPressDuration(&self) -> CFTimeInterval;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setMinimumPressDuration:))]
#[unsafe(method_family = none)]
pub unsafe fn setMinimumPressDuration(&self, minimum_press_duration: CFTimeInterval);
#[unsafe(method(numberOfTapsRequired))]
#[unsafe(method_family = none)]
pub unsafe fn numberOfTapsRequired(&self) -> NSUInteger;
#[unsafe(method(setNumberOfTapsRequired:))]
#[unsafe(method_family = none)]
pub unsafe fn setNumberOfTapsRequired(&self, number_of_taps_required: NSUInteger);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(allowableMovement))]
#[unsafe(method_family = none)]
pub unsafe fn allowableMovement(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setAllowableMovement:))]
#[unsafe(method_family = none)]
pub unsafe fn setAllowableMovement(&self, allowable_movement: CGFloat);
);
}
impl WKLongPressGestureRecognizer {
extern_methods!(
#[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() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(WKGestureRecognizer, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct WKSwipeGestureRecognizer;
);
extern_conformance!(
unsafe impl NSObjectProtocol for WKSwipeGestureRecognizer {}
);
impl WKSwipeGestureRecognizer {
extern_methods!(
#[unsafe(method(direction))]
#[unsafe(method_family = none)]
pub unsafe fn direction(&self) -> WKSwipeGestureRecognizerDirection;
#[unsafe(method(setDirection:))]
#[unsafe(method_family = none)]
pub unsafe fn setDirection(&self, direction: WKSwipeGestureRecognizerDirection);
);
}
impl WKSwipeGestureRecognizer {
extern_methods!(
#[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() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(WKGestureRecognizer, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct WKPanGestureRecognizer;
);
extern_conformance!(
unsafe impl NSObjectProtocol for WKPanGestureRecognizer {}
);
impl WKPanGestureRecognizer {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(translationInObject))]
#[unsafe(method_family = none)]
pub unsafe fn translationInObject(&self) -> CGPoint;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(velocityInObject))]
#[unsafe(method_family = none)]
pub unsafe fn velocityInObject(&self) -> CGPoint;
);
}
impl WKPanGestureRecognizer {
extern_methods!(
#[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() -> Retained<Self>;
);
}