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")]
82extern_conformance!(
83 unsafe impl NSCopying for UITextDropProposal {}
84);
85
86#[cfg(feature = "UIDropInteraction")]
87unsafe impl CopyingHelper for UITextDropProposal {
88 type Result = Self;
89}
90
91#[cfg(feature = "UIDropInteraction")]
92extern_conformance!(
93 unsafe impl NSObjectProtocol for UITextDropProposal {}
94);
95
96#[cfg(feature = "UIDropInteraction")]
97impl UITextDropProposal {
98 extern_methods!(
99 #[unsafe(method(dropAction))]
100 #[unsafe(method_family = none)]
101 pub fn dropAction(&self) -> UITextDropAction;
102
103 #[unsafe(method(setDropAction:))]
105 #[unsafe(method_family = none)]
106 pub fn setDropAction(&self, drop_action: UITextDropAction);
107
108 #[unsafe(method(dropProgressMode))]
109 #[unsafe(method_family = none)]
110 pub fn dropProgressMode(&self) -> UITextDropProgressMode;
111
112 #[unsafe(method(setDropProgressMode:))]
114 #[unsafe(method_family = none)]
115 pub fn setDropProgressMode(&self, drop_progress_mode: UITextDropProgressMode);
116
117 #[unsafe(method(useFastSameViewOperations))]
118 #[unsafe(method_family = none)]
119 pub fn useFastSameViewOperations(&self) -> bool;
120
121 #[unsafe(method(setUseFastSameViewOperations:))]
123 #[unsafe(method_family = none)]
124 pub fn setUseFastSameViewOperations(&self, use_fast_same_view_operations: bool);
125
126 #[unsafe(method(dropPerformer))]
127 #[unsafe(method_family = none)]
128 pub fn dropPerformer(&self) -> UITextDropPerformer;
129
130 #[unsafe(method(setDropPerformer:))]
132 #[unsafe(method_family = none)]
133 pub fn setDropPerformer(&self, drop_performer: UITextDropPerformer);
134 );
135}
136
137#[cfg(feature = "UIDropInteraction")]
139impl UITextDropProposal {
140 extern_methods!(
141 #[unsafe(method(initWithDropOperation:))]
142 #[unsafe(method_family = init)]
143 pub fn initWithDropOperation(
144 this: Allocated<Self>,
145 operation: UIDropOperation,
146 ) -> Retained<Self>;
147
148 #[unsafe(method(init))]
149 #[unsafe(method_family = init)]
150 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
151
152 #[unsafe(method(new))]
153 #[unsafe(method_family = new)]
154 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
155 );
156}