objc2_ui_kit/generated/
UITextDropProposal.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct UITextDropAction(pub NSUInteger);
15impl UITextDropAction {
16 #[doc(alias = "UITextDropActionInsert")]
17 pub const Insert: Self = Self(0);
18 #[doc(alias = "UITextDropActionReplaceSelection")]
19 pub const ReplaceSelection: Self = Self(1);
20 #[doc(alias = "UITextDropActionReplaceAll")]
21 pub const ReplaceAll: Self = Self(2);
22}
23
24unsafe impl Encode for UITextDropAction {
25 const ENCODING: Encoding = NSUInteger::ENCODING;
26}
27
28unsafe impl RefEncode for UITextDropAction {
29 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32#[repr(transparent)]
35#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
36pub struct UITextDropProgressMode(pub NSUInteger);
37impl UITextDropProgressMode {
38 #[doc(alias = "UITextDropProgressModeSystem")]
39 pub const System: Self = Self(0);
40 #[doc(alias = "UITextDropProgressModeCustom")]
41 pub const Custom: Self = Self(1);
42}
43
44unsafe impl Encode for UITextDropProgressMode {
45 const ENCODING: Encoding = NSUInteger::ENCODING;
46}
47
48unsafe impl RefEncode for UITextDropProgressMode {
49 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
50}
51
52#[repr(transparent)]
55#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
56pub struct UITextDropPerformer(pub NSUInteger);
57impl UITextDropPerformer {
58 #[doc(alias = "UITextDropPerformerView")]
59 pub const View: Self = Self(0);
60 #[doc(alias = "UITextDropPerformerDelegate")]
61 pub const Delegate: Self = Self(1);
62}
63
64unsafe impl Encode for UITextDropPerformer {
65 const ENCODING: Encoding = NSUInteger::ENCODING;
66}
67
68unsafe impl RefEncode for UITextDropPerformer {
69 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
70}
71
72extern_class!(
73 #[unsafe(super(UIDropProposal, NSObject))]
75 #[thread_kind = MainThreadOnly]
76 #[derive(Debug, PartialEq, Eq, Hash)]
77 #[cfg(feature = "UIDropInteraction")]
78 pub struct UITextDropProposal;
79);
80
81#[cfg(feature = "UIDropInteraction")]
82unsafe impl NSCopying for UITextDropProposal {}
83
84#[cfg(feature = "UIDropInteraction")]
85unsafe impl CopyingHelper for UITextDropProposal {
86 type Result = Self;
87}
88
89#[cfg(feature = "UIDropInteraction")]
90unsafe impl NSObjectProtocol for UITextDropProposal {}
91
92#[cfg(feature = "UIDropInteraction")]
93impl UITextDropProposal {
94 extern_methods!(
95 #[unsafe(method(dropAction))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn dropAction(&self) -> UITextDropAction;
98
99 #[unsafe(method(setDropAction:))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn setDropAction(&self, drop_action: UITextDropAction);
103
104 #[unsafe(method(dropProgressMode))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn dropProgressMode(&self) -> UITextDropProgressMode;
107
108 #[unsafe(method(setDropProgressMode:))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn setDropProgressMode(&self, drop_progress_mode: UITextDropProgressMode);
112
113 #[unsafe(method(useFastSameViewOperations))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn useFastSameViewOperations(&self) -> bool;
116
117 #[unsafe(method(setUseFastSameViewOperations:))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn setUseFastSameViewOperations(&self, use_fast_same_view_operations: bool);
121
122 #[unsafe(method(dropPerformer))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn dropPerformer(&self) -> UITextDropPerformer;
125
126 #[unsafe(method(setDropPerformer:))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn setDropPerformer(&self, drop_performer: UITextDropPerformer);
130 );
131}
132
133#[cfg(feature = "UIDropInteraction")]
135impl UITextDropProposal {
136 extern_methods!(
137 #[unsafe(method(initWithDropOperation:))]
138 #[unsafe(method_family = init)]
139 pub unsafe fn initWithDropOperation(
140 this: Allocated<Self>,
141 operation: UIDropOperation,
142 ) -> Retained<Self>;
143
144 #[unsafe(method(init))]
145 #[unsafe(method_family = init)]
146 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
147
148 #[unsafe(method(new))]
149 #[unsafe(method_family = new)]
150 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
151 );
152}