objc2_ui_kit/generated/
UIBandSelectionInteraction.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8
9use crate::*;
10
11#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct UIBandSelectionInteractionState(pub NSInteger);
16impl UIBandSelectionInteractionState {
17 #[doc(alias = "UIBandSelectionInteractionStatePossible")]
18 pub const Possible: Self = Self(0);
19 #[doc(alias = "UIBandSelectionInteractionStateBegan")]
20 pub const Began: Self = Self(1);
21 #[doc(alias = "UIBandSelectionInteractionStateSelecting")]
22 pub const Selecting: Self = Self(2);
23 #[doc(alias = "UIBandSelectionInteractionStateEnded")]
24 pub const Ended: Self = Self(3);
25}
26
27unsafe impl Encode for UIBandSelectionInteractionState {
28 const ENCODING: Encoding = NSInteger::ENCODING;
29}
30
31unsafe impl RefEncode for UIBandSelectionInteractionState {
32 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35extern_class!(
36 #[unsafe(super(NSObject))]
38 #[thread_kind = MainThreadOnly]
39 #[derive(Debug, PartialEq, Eq, Hash)]
40 pub struct UIBandSelectionInteraction;
41);
42
43unsafe impl NSObjectProtocol for UIBandSelectionInteraction {}
44
45#[cfg(feature = "UIInteraction")]
46unsafe impl UIInteraction for UIBandSelectionInteraction {}
47
48impl UIBandSelectionInteraction {
49 extern_methods!(
50 #[unsafe(method(isEnabled))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn isEnabled(&self) -> bool;
54
55 #[unsafe(method(setEnabled:))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn setEnabled(&self, enabled: bool);
59
60 #[unsafe(method(state))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn state(&self) -> UIBandSelectionInteractionState;
64
65 #[cfg(feature = "objc2-core-foundation")]
66 #[unsafe(method(selectionRect))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn selectionRect(&self) -> CGRect;
70
71 #[cfg(feature = "UICommand")]
72 #[unsafe(method(initialModifierFlags))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn initialModifierFlags(&self) -> UIKeyModifierFlags;
76
77 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
78 #[unsafe(method(shouldBeginHandler))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn shouldBeginHandler(
83 &self,
84 ) -> *mut block2::Block<dyn Fn(NonNull<UIBandSelectionInteraction>, CGPoint) -> Bool>;
85
86 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
87 #[unsafe(method(setShouldBeginHandler:))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn setShouldBeginHandler(
91 &self,
92 should_begin_handler: Option<
93 &block2::Block<dyn Fn(NonNull<UIBandSelectionInteraction>, CGPoint) -> Bool>,
94 >,
95 );
96
97 #[cfg(feature = "block2")]
98 #[unsafe(method(initWithSelectionHandler:))]
103 #[unsafe(method_family = init)]
104 pub unsafe fn initWithSelectionHandler(
105 this: Allocated<Self>,
106 selection_handler: &block2::Block<dyn Fn(NonNull<UIBandSelectionInteraction>)>,
107 ) -> Retained<Self>;
108
109 #[unsafe(method(init))]
110 #[unsafe(method_family = init)]
111 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
112
113 #[unsafe(method(new))]
114 #[unsafe(method_family = new)]
115 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
116 );
117}