objc2_app_kit/generated/
NSPanGestureRecognizer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspangesturerecognizer?language=objc)
12    #[unsafe(super(NSGestureRecognizer, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "NSGestureRecognizer")]
15    pub struct NSPanGestureRecognizer;
16);
17
18#[cfg(feature = "NSGestureRecognizer")]
19extern_conformance!(
20    unsafe impl NSCoding for NSPanGestureRecognizer {}
21);
22
23#[cfg(feature = "NSGestureRecognizer")]
24extern_conformance!(
25    unsafe impl NSObjectProtocol for NSPanGestureRecognizer {}
26);
27
28#[cfg(feature = "NSGestureRecognizer")]
29impl NSPanGestureRecognizer {
30    extern_methods!(
31        #[unsafe(method(buttonMask))]
32        #[unsafe(method_family = none)]
33        pub fn buttonMask(&self) -> NSUInteger;
34
35        /// Setter for [`buttonMask`][Self::buttonMask].
36        #[unsafe(method(setButtonMask:))]
37        #[unsafe(method_family = none)]
38        pub fn setButtonMask(&self, button_mask: NSUInteger);
39
40        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
41        #[unsafe(method(translationInView:))]
42        #[unsafe(method_family = none)]
43        pub fn translationInView(&self, view: Option<&NSView>) -> NSPoint;
44
45        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
46        #[unsafe(method(setTranslation:inView:))]
47        #[unsafe(method_family = none)]
48        pub fn setTranslation_inView(&self, translation: NSPoint, view: Option<&NSView>);
49
50        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
51        #[unsafe(method(velocityInView:))]
52        #[unsafe(method_family = none)]
53        pub fn velocityInView(&self, view: Option<&NSView>) -> NSPoint;
54
55        #[unsafe(method(numberOfTouchesRequired))]
56        #[unsafe(method_family = none)]
57        pub fn numberOfTouchesRequired(&self) -> NSInteger;
58
59        /// Setter for [`numberOfTouchesRequired`][Self::numberOfTouchesRequired].
60        #[unsafe(method(setNumberOfTouchesRequired:))]
61        #[unsafe(method_family = none)]
62        pub fn setNumberOfTouchesRequired(&self, number_of_touches_required: NSInteger);
63    );
64}
65
66/// Methods declared on superclass `NSGestureRecognizer`.
67#[cfg(feature = "NSGestureRecognizer")]
68impl NSPanGestureRecognizer {
69    extern_methods!(
70        /// # Safety
71        ///
72        /// - `target` should be of the correct type.
73        /// - `action` must be a valid selector.
74        #[unsafe(method(initWithTarget:action:))]
75        #[unsafe(method_family = init)]
76        pub unsafe fn initWithTarget_action(
77            this: Allocated<Self>,
78            target: Option<&AnyObject>,
79            action: Option<Sel>,
80        ) -> Retained<Self>;
81
82        /// # Safety
83        ///
84        /// `coder` possibly has further requirements.
85        #[unsafe(method(initWithCoder:))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn initWithCoder(
88            this: Allocated<Self>,
89            coder: &NSCoder,
90        ) -> Option<Retained<Self>>;
91    );
92}
93
94/// Methods declared on superclass `NSObject`.
95#[cfg(feature = "NSGestureRecognizer")]
96impl NSPanGestureRecognizer {
97    extern_methods!(
98        #[unsafe(method(init))]
99        #[unsafe(method_family = init)]
100        pub fn init(this: Allocated<Self>) -> Retained<Self>;
101
102        #[unsafe(method(new))]
103        #[unsafe(method_family = new)]
104        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
105    );
106}