objc2_ui_kit/generated/
UIAccessibilityCustomAction.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[cfg(feature = "block2")]
12pub type UIAccessibilityCustomActionHandler =
13 *mut block2::DynBlock<dyn Fn(NonNull<UIAccessibilityCustomAction>) -> Bool>;
14
15extern_class!(
16 #[unsafe(super(NSObject))]
18 #[thread_kind = MainThreadOnly]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 pub struct UIAccessibilityCustomAction;
21);
22
23extern_conformance!(
24 unsafe impl NSObjectProtocol for UIAccessibilityCustomAction {}
25);
26
27impl UIAccessibilityCustomAction {
28 extern_methods!(
29 #[unsafe(method(initWithName:target:selector:))]
34 #[unsafe(method_family = init)]
35 pub unsafe fn initWithName_target_selector(
36 this: Allocated<Self>,
37 name: &NSString,
38 target: Option<&AnyObject>,
39 selector: Sel,
40 ) -> Retained<Self>;
41
42 #[unsafe(method(initWithAttributedName:target:selector:))]
47 #[unsafe(method_family = init)]
48 pub unsafe fn initWithAttributedName_target_selector(
49 this: Allocated<Self>,
50 attributed_name: &NSAttributedString,
51 target: Option<&AnyObject>,
52 selector: Sel,
53 ) -> Retained<Self>;
54
55 #[cfg(feature = "UIImage")]
56 #[unsafe(method(initWithName:image:target:selector:))]
61 #[unsafe(method_family = init)]
62 pub unsafe fn initWithName_image_target_selector(
63 this: Allocated<Self>,
64 name: &NSString,
65 image: Option<&UIImage>,
66 target: Option<&AnyObject>,
67 selector: Sel,
68 ) -> Retained<Self>;
69
70 #[cfg(feature = "UIImage")]
71 #[unsafe(method(initWithAttributedName:image:target:selector:))]
76 #[unsafe(method_family = init)]
77 pub unsafe fn initWithAttributedName_image_target_selector(
78 this: Allocated<Self>,
79 attributed_name: &NSAttributedString,
80 image: Option<&UIImage>,
81 target: Option<&AnyObject>,
82 selector: Sel,
83 ) -> Retained<Self>;
84
85 #[cfg(feature = "block2")]
86 #[unsafe(method(initWithName:actionHandler:))]
90 #[unsafe(method_family = init)]
91 pub unsafe fn initWithName_actionHandler(
92 this: Allocated<Self>,
93 name: &NSString,
94 action_handler: UIAccessibilityCustomActionHandler,
95 ) -> Retained<Self>;
96
97 #[cfg(feature = "block2")]
98 #[unsafe(method(initWithAttributedName:actionHandler:))]
102 #[unsafe(method_family = init)]
103 pub unsafe fn initWithAttributedName_actionHandler(
104 this: Allocated<Self>,
105 attributed_name: &NSAttributedString,
106 action_handler: UIAccessibilityCustomActionHandler,
107 ) -> Retained<Self>;
108
109 #[cfg(all(feature = "UIImage", feature = "block2"))]
110 #[unsafe(method(initWithName:image:actionHandler:))]
114 #[unsafe(method_family = init)]
115 pub unsafe fn initWithName_image_actionHandler(
116 this: Allocated<Self>,
117 name: &NSString,
118 image: Option<&UIImage>,
119 action_handler: UIAccessibilityCustomActionHandler,
120 ) -> Retained<Self>;
121
122 #[cfg(all(feature = "UIImage", feature = "block2"))]
123 #[unsafe(method(initWithAttributedName:image:actionHandler:))]
127 #[unsafe(method_family = init)]
128 pub unsafe fn initWithAttributedName_image_actionHandler(
129 this: Allocated<Self>,
130 attributed_name: &NSAttributedString,
131 image: Option<&UIImage>,
132 action_handler: UIAccessibilityCustomActionHandler,
133 ) -> Retained<Self>;
134
135 #[unsafe(method(name))]
136 #[unsafe(method_family = none)]
137 pub fn name(&self) -> Retained<NSString>;
138
139 #[unsafe(method(setName:))]
143 #[unsafe(method_family = none)]
144 pub fn setName(&self, name: &NSString);
145
146 #[cfg(feature = "UIImage")]
147 #[unsafe(method(image))]
148 #[unsafe(method_family = none)]
149 pub fn image(&self) -> Option<Retained<UIImage>>;
150
151 #[cfg(feature = "UIImage")]
152 #[unsafe(method(setImage:))]
154 #[unsafe(method_family = none)]
155 pub fn setImage(&self, image: Option<&UIImage>);
156
157 #[unsafe(method(attributedName))]
158 #[unsafe(method_family = none)]
159 pub fn attributedName(&self) -> Retained<NSAttributedString>;
160
161 #[unsafe(method(setAttributedName:))]
165 #[unsafe(method_family = none)]
166 pub fn setAttributedName(&self, attributed_name: &NSAttributedString);
167
168 #[unsafe(method(target))]
169 #[unsafe(method_family = none)]
170 pub fn target(&self) -> Option<Retained<AnyObject>>;
171
172 #[unsafe(method(setTarget:))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn setTarget(&self, target: Option<&AnyObject>);
182
183 #[unsafe(method(selector))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn selector(&self) -> Sel;
189
190 #[unsafe(method(setSelector:))]
197 #[unsafe(method_family = none)]
198 pub unsafe fn setSelector(&self, selector: Sel);
199
200 #[cfg(feature = "block2")]
201 #[unsafe(method(actionHandler))]
205 #[unsafe(method_family = none)]
206 pub unsafe fn actionHandler(&self) -> UIAccessibilityCustomActionHandler;
207
208 #[cfg(feature = "block2")]
209 #[unsafe(method(setActionHandler:))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn setActionHandler(&self, action_handler: UIAccessibilityCustomActionHandler);
219
220 #[unsafe(method(category))]
221 #[unsafe(method_family = none)]
222 pub fn category(&self) -> Option<Retained<NSString>>;
223
224 #[unsafe(method(setCategory:))]
228 #[unsafe(method_family = none)]
229 pub fn setCategory(&self, category: Option<&NSString>);
230 );
231}
232
233impl UIAccessibilityCustomAction {
235 extern_methods!(
236 #[unsafe(method(init))]
237 #[unsafe(method_family = init)]
238 pub fn init(this: Allocated<Self>) -> Retained<Self>;
239
240 #[unsafe(method(new))]
241 #[unsafe(method_family = new)]
242 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
243 );
244}
245
246extern "C" {
247 pub static UIAccessibilityCustomActionCategoryEdit: &'static NSString;
249}