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
43extern_conformance!(
44 unsafe impl NSObjectProtocol for UIBandSelectionInteraction {}
45);
46
47#[cfg(feature = "UIInteraction")]
48extern_conformance!(
49 unsafe impl UIInteraction for UIBandSelectionInteraction {}
50);
51
52impl UIBandSelectionInteraction {
53 extern_methods!(
54 #[unsafe(method(isEnabled))]
56 #[unsafe(method_family = none)]
57 pub fn isEnabled(&self) -> bool;
58
59 #[unsafe(method(setEnabled:))]
61 #[unsafe(method_family = none)]
62 pub fn setEnabled(&self, enabled: bool);
63
64 #[unsafe(method(state))]
66 #[unsafe(method_family = none)]
67 pub fn state(&self) -> UIBandSelectionInteractionState;
68
69 #[cfg(feature = "objc2-core-foundation")]
70 #[unsafe(method(selectionRect))]
72 #[unsafe(method_family = none)]
73 pub fn selectionRect(&self) -> CGRect;
74
75 #[cfg(feature = "UICommand")]
76 #[unsafe(method(initialModifierFlags))]
78 #[unsafe(method_family = none)]
79 pub fn initialModifierFlags(&self) -> UIKeyModifierFlags;
80
81 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
82 #[unsafe(method(shouldBeginHandler))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn shouldBeginHandler(
91 &self,
92 ) -> *mut block2::DynBlock<dyn Fn(NonNull<UIBandSelectionInteraction>, CGPoint) -> Bool>;
93
94 #[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
95 #[unsafe(method(setShouldBeginHandler:))]
99 #[unsafe(method_family = none)]
100 pub fn setShouldBeginHandler(
101 &self,
102 should_begin_handler: Option<
103 &block2::DynBlock<dyn Fn(NonNull<UIBandSelectionInteraction>, CGPoint) -> Bool>,
104 >,
105 );
106
107 #[cfg(feature = "block2")]
108 #[unsafe(method(initWithSelectionHandler:))]
113 #[unsafe(method_family = init)]
114 pub fn initWithSelectionHandler(
115 this: Allocated<Self>,
116 selection_handler: &block2::DynBlock<dyn Fn(NonNull<UIBandSelectionInteraction>)>,
117 ) -> Retained<Self>;
118
119 #[unsafe(method(init))]
120 #[unsafe(method_family = init)]
121 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
122
123 #[unsafe(method(new))]
124 #[unsafe(method_family = new)]
125 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
126 );
127}