objc2_ui_kit/generated/
UIAccessibilityCustomAction.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccessibilitycustomactionhandler?language=objc)
11#[cfg(feature = "block2")]
12pub type UIAccessibilityCustomActionHandler =
13    *mut block2::Block<dyn Fn(NonNull<UIAccessibilityCustomAction>) -> Bool>;
14
15extern_class!(
16    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccessibilitycustomaction?language=objc)
17    #[unsafe(super(NSObject))]
18    #[thread_kind = MainThreadOnly]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    pub struct UIAccessibilityCustomAction;
21);
22
23unsafe impl NSObjectProtocol for UIAccessibilityCustomAction {}
24
25impl UIAccessibilityCustomAction {
26    extern_methods!(
27        #[unsafe(method(initWithName:target:selector:))]
28        #[unsafe(method_family = init)]
29        pub unsafe fn initWithName_target_selector(
30            this: Allocated<Self>,
31            name: &NSString,
32            target: Option<&AnyObject>,
33            selector: Sel,
34        ) -> Retained<Self>;
35
36        #[unsafe(method(initWithAttributedName:target:selector:))]
37        #[unsafe(method_family = init)]
38        pub unsafe fn initWithAttributedName_target_selector(
39            this: Allocated<Self>,
40            attributed_name: &NSAttributedString,
41            target: Option<&AnyObject>,
42            selector: Sel,
43        ) -> Retained<Self>;
44
45        #[cfg(feature = "UIImage")]
46        #[unsafe(method(initWithName:image:target:selector:))]
47        #[unsafe(method_family = init)]
48        pub unsafe fn initWithName_image_target_selector(
49            this: Allocated<Self>,
50            name: &NSString,
51            image: Option<&UIImage>,
52            target: Option<&AnyObject>,
53            selector: Sel,
54        ) -> Retained<Self>;
55
56        #[cfg(feature = "UIImage")]
57        #[unsafe(method(initWithAttributedName:image:target:selector:))]
58        #[unsafe(method_family = init)]
59        pub unsafe fn initWithAttributedName_image_target_selector(
60            this: Allocated<Self>,
61            attributed_name: &NSAttributedString,
62            image: Option<&UIImage>,
63            target: Option<&AnyObject>,
64            selector: Sel,
65        ) -> Retained<Self>;
66
67        #[cfg(feature = "block2")]
68        #[unsafe(method(initWithName:actionHandler:))]
69        #[unsafe(method_family = init)]
70        pub unsafe fn initWithName_actionHandler(
71            this: Allocated<Self>,
72            name: &NSString,
73            action_handler: UIAccessibilityCustomActionHandler,
74        ) -> Retained<Self>;
75
76        #[cfg(feature = "block2")]
77        #[unsafe(method(initWithAttributedName:actionHandler:))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn initWithAttributedName_actionHandler(
80            this: Allocated<Self>,
81            attributed_name: &NSAttributedString,
82            action_handler: UIAccessibilityCustomActionHandler,
83        ) -> Retained<Self>;
84
85        #[cfg(all(feature = "UIImage", feature = "block2"))]
86        #[unsafe(method(initWithName:image:actionHandler:))]
87        #[unsafe(method_family = init)]
88        pub unsafe fn initWithName_image_actionHandler(
89            this: Allocated<Self>,
90            name: &NSString,
91            image: Option<&UIImage>,
92            action_handler: UIAccessibilityCustomActionHandler,
93        ) -> Retained<Self>;
94
95        #[cfg(all(feature = "UIImage", feature = "block2"))]
96        #[unsafe(method(initWithAttributedName:image:actionHandler:))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn initWithAttributedName_image_actionHandler(
99            this: Allocated<Self>,
100            attributed_name: &NSAttributedString,
101            image: Option<&UIImage>,
102            action_handler: UIAccessibilityCustomActionHandler,
103        ) -> Retained<Self>;
104
105        #[unsafe(method(name))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn name(&self) -> Retained<NSString>;
108
109        /// Setter for [`name`][Self::name].
110        #[unsafe(method(setName:))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn setName(&self, name: &NSString);
113
114        #[cfg(feature = "UIImage")]
115        #[unsafe(method(image))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
118
119        #[cfg(feature = "UIImage")]
120        /// Setter for [`image`][Self::image].
121        #[unsafe(method(setImage:))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn setImage(&self, image: Option<&UIImage>);
124
125        #[unsafe(method(attributedName))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn attributedName(&self) -> Retained<NSAttributedString>;
128
129        /// Setter for [`attributedName`][Self::attributedName].
130        #[unsafe(method(setAttributedName:))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn setAttributedName(&self, attributed_name: &NSAttributedString);
133
134        #[unsafe(method(target))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn target(&self) -> Option<Retained<AnyObject>>;
137
138        /// This is a [weak property][objc2::topics::weak_property].
139        /// Setter for [`target`][Self::target].
140        #[unsafe(method(setTarget:))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn setTarget(&self, target: Option<&AnyObject>);
143
144        #[unsafe(method(selector))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn selector(&self) -> Sel;
147
148        /// Setter for [`selector`][Self::selector].
149        #[unsafe(method(setSelector:))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn setSelector(&self, selector: Sel);
152
153        #[cfg(feature = "block2")]
154        #[unsafe(method(actionHandler))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn actionHandler(&self) -> UIAccessibilityCustomActionHandler;
157
158        #[cfg(feature = "block2")]
159        /// Setter for [`actionHandler`][Self::actionHandler].
160        #[unsafe(method(setActionHandler:))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn setActionHandler(&self, action_handler: UIAccessibilityCustomActionHandler);
163
164        #[unsafe(method(category))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn category(&self) -> Option<Retained<NSString>>;
167
168        /// Setter for [`category`][Self::category].
169        #[unsafe(method(setCategory:))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn setCategory(&self, category: Option<&NSString>);
172    );
173}
174
175/// Methods declared on superclass `NSObject`.
176impl UIAccessibilityCustomAction {
177    extern_methods!(
178        #[unsafe(method(init))]
179        #[unsafe(method_family = init)]
180        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
181
182        #[unsafe(method(new))]
183        #[unsafe(method_family = new)]
184        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
185    );
186}
187
188extern "C" {
189    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccessibilitycustomactioncategoryedit?language=objc)
190    pub static UIAccessibilityCustomActionCategoryEdit: &'static NSString;
191}