objc2_ui_kit/generated/
UIPasteControl.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uipastecontroldisplaymode?language=objc)
16// NS_ENUM
17#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct UIPasteControlDisplayMode(pub NSUInteger);
20impl UIPasteControlDisplayMode {
21    #[doc(alias = "UIPasteControlDisplayModeIconAndLabel")]
22    pub const IconAndLabel: Self = Self(0);
23    #[doc(alias = "UIPasteControlDisplayModeIconOnly")]
24    pub const IconOnly: Self = Self(1);
25    #[doc(alias = "UIPasteControlDisplayModeLabelOnly")]
26    pub const LabelOnly: Self = Self(2);
27    #[doc(alias = "UIPasteControlDisplayModeArrowAndLabel")]
28    pub const ArrowAndLabel: Self = Self(3);
29}
30
31unsafe impl Encode for UIPasteControlDisplayMode {
32    const ENCODING: Encoding = NSUInteger::ENCODING;
33}
34
35unsafe impl RefEncode for UIPasteControlDisplayMode {
36    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39extern_class!(
40    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uipastecontrolconfiguration?language=objc)
41    #[unsafe(super(NSObject))]
42    #[thread_kind = MainThreadOnly]
43    #[derive(Debug, PartialEq, Eq, Hash)]
44    pub struct UIPasteControlConfiguration;
45);
46
47extern_conformance!(
48    unsafe impl NSCoding for UIPasteControlConfiguration {}
49);
50
51extern_conformance!(
52    unsafe impl NSObjectProtocol for UIPasteControlConfiguration {}
53);
54
55extern_conformance!(
56    unsafe impl NSSecureCoding for UIPasteControlConfiguration {}
57);
58
59impl UIPasteControlConfiguration {
60    extern_methods!(
61        #[unsafe(method(displayMode))]
62        #[unsafe(method_family = none)]
63        pub fn displayMode(&self) -> UIPasteControlDisplayMode;
64
65        /// Setter for [`displayMode`][Self::displayMode].
66        #[unsafe(method(setDisplayMode:))]
67        #[unsafe(method_family = none)]
68        pub fn setDisplayMode(&self, display_mode: UIPasteControlDisplayMode);
69
70        #[cfg(feature = "UIButtonConfiguration")]
71        #[unsafe(method(cornerStyle))]
72        #[unsafe(method_family = none)]
73        pub fn cornerStyle(&self) -> UIButtonConfigurationCornerStyle;
74
75        #[cfg(feature = "UIButtonConfiguration")]
76        /// Setter for [`cornerStyle`][Self::cornerStyle].
77        #[unsafe(method(setCornerStyle:))]
78        #[unsafe(method_family = none)]
79        pub fn setCornerStyle(&self, corner_style: UIButtonConfigurationCornerStyle);
80
81        #[cfg(feature = "objc2-core-foundation")]
82        #[unsafe(method(cornerRadius))]
83        #[unsafe(method_family = none)]
84        pub fn cornerRadius(&self) -> CGFloat;
85
86        #[cfg(feature = "objc2-core-foundation")]
87        /// Setter for [`cornerRadius`][Self::cornerRadius].
88        #[unsafe(method(setCornerRadius:))]
89        #[unsafe(method_family = none)]
90        pub fn setCornerRadius(&self, corner_radius: CGFloat);
91
92        #[cfg(feature = "UIGeometry")]
93        #[unsafe(method(imagePlacement))]
94        #[unsafe(method_family = none)]
95        pub fn imagePlacement(&self) -> NSDirectionalRectEdge;
96
97        #[cfg(feature = "UIGeometry")]
98        /// Setter for [`imagePlacement`][Self::imagePlacement].
99        #[unsafe(method(setImagePlacement:))]
100        #[unsafe(method_family = none)]
101        pub fn setImagePlacement(&self, image_placement: NSDirectionalRectEdge);
102
103        #[cfg(feature = "UIColor")]
104        #[unsafe(method(baseForegroundColor))]
105        #[unsafe(method_family = none)]
106        pub fn baseForegroundColor(&self) -> Option<Retained<UIColor>>;
107
108        #[cfg(feature = "UIColor")]
109        /// Setter for [`baseForegroundColor`][Self::baseForegroundColor].
110        #[unsafe(method(setBaseForegroundColor:))]
111        #[unsafe(method_family = none)]
112        pub fn setBaseForegroundColor(&self, base_foreground_color: Option<&UIColor>);
113
114        #[cfg(feature = "UIColor")]
115        #[unsafe(method(baseBackgroundColor))]
116        #[unsafe(method_family = none)]
117        pub fn baseBackgroundColor(&self) -> Option<Retained<UIColor>>;
118
119        #[cfg(feature = "UIColor")]
120        /// Setter for [`baseBackgroundColor`][Self::baseBackgroundColor].
121        #[unsafe(method(setBaseBackgroundColor:))]
122        #[unsafe(method_family = none)]
123        pub fn setBaseBackgroundColor(&self, base_background_color: Option<&UIColor>);
124    );
125}
126
127/// Methods declared on superclass `NSObject`.
128impl UIPasteControlConfiguration {
129    extern_methods!(
130        #[unsafe(method(init))]
131        #[unsafe(method_family = init)]
132        pub fn init(this: Allocated<Self>) -> Retained<Self>;
133
134        #[unsafe(method(new))]
135        #[unsafe(method_family = new)]
136        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
137    );
138}
139
140extern_class!(
141    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uipastecontrol?language=objc)
142    #[unsafe(super(UIControl, UIView, UIResponder, NSObject))]
143    #[thread_kind = MainThreadOnly]
144    #[derive(Debug, PartialEq, Eq, Hash)]
145    #[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
146    pub struct UIPasteControl;
147);
148
149#[cfg(all(
150    feature = "UIControl",
151    feature = "UIResponder",
152    feature = "UIView",
153    feature = "objc2-quartz-core"
154))]
155#[cfg(not(target_os = "watchos"))]
156extern_conformance!(
157    unsafe impl CALayerDelegate for UIPasteControl {}
158);
159
160#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
161extern_conformance!(
162    unsafe impl NSCoding for UIPasteControl {}
163);
164
165#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
166extern_conformance!(
167    unsafe impl NSObjectProtocol for UIPasteControl {}
168);
169
170#[cfg(all(
171    feature = "UIAppearance",
172    feature = "UIControl",
173    feature = "UIResponder",
174    feature = "UIView"
175))]
176extern_conformance!(
177    unsafe impl UIAppearance for UIPasteControl {}
178);
179
180#[cfg(all(
181    feature = "UIAppearance",
182    feature = "UIControl",
183    feature = "UIResponder",
184    feature = "UIView"
185))]
186extern_conformance!(
187    unsafe impl UIAppearanceContainer for UIPasteControl {}
188);
189
190#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
191extern_conformance!(
192    unsafe impl UICoordinateSpace for UIPasteControl {}
193);
194
195#[cfg(all(
196    feature = "UIControl",
197    feature = "UIDynamicBehavior",
198    feature = "UIResponder",
199    feature = "UIView"
200))]
201extern_conformance!(
202    unsafe impl UIDynamicItem for UIPasteControl {}
203);
204
205#[cfg(all(
206    feature = "UIControl",
207    feature = "UIFocus",
208    feature = "UIResponder",
209    feature = "UIView"
210))]
211extern_conformance!(
212    unsafe impl UIFocusEnvironment for UIPasteControl {}
213);
214
215#[cfg(all(
216    feature = "UIControl",
217    feature = "UIFocus",
218    feature = "UIResponder",
219    feature = "UIView"
220))]
221extern_conformance!(
222    unsafe impl UIFocusItem for UIPasteControl {}
223);
224
225#[cfg(all(
226    feature = "UIControl",
227    feature = "UIFocus",
228    feature = "UIResponder",
229    feature = "UIView"
230))]
231extern_conformance!(
232    unsafe impl UIFocusItemContainer for UIPasteControl {}
233);
234
235#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
236extern_conformance!(
237    unsafe impl UIResponderStandardEditActions for UIPasteControl {}
238);
239
240#[cfg(all(
241    feature = "UIControl",
242    feature = "UIResponder",
243    feature = "UITraitCollection",
244    feature = "UIView"
245))]
246extern_conformance!(
247    unsafe impl UITraitEnvironment for UIPasteControl {}
248);
249
250#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
251impl UIPasteControl {
252    extern_methods!(
253        #[unsafe(method(configuration))]
254        #[unsafe(method_family = none)]
255        pub fn configuration(&self) -> Retained<UIPasteControlConfiguration>;
256
257        #[cfg(feature = "UIPasteConfigurationSupporting")]
258        #[unsafe(method(target))]
259        #[unsafe(method_family = none)]
260        pub fn target(
261            &self,
262        ) -> Option<Retained<ProtocolObject<dyn UIPasteConfigurationSupporting>>>;
263
264        #[cfg(feature = "UIPasteConfigurationSupporting")]
265        /// Setter for [`target`][Self::target].
266        ///
267        /// This is a [weak property][objc2::topics::weak_property].
268        #[unsafe(method(setTarget:))]
269        #[unsafe(method_family = none)]
270        pub fn setTarget(
271            &self,
272            target: Option<&ProtocolObject<dyn UIPasteConfigurationSupporting>>,
273        );
274
275        #[unsafe(method(initWithConfiguration:))]
276        #[unsafe(method_family = init)]
277        pub fn initWithConfiguration(
278            this: Allocated<Self>,
279            configuration: &UIPasteControlConfiguration,
280        ) -> Retained<Self>;
281
282        /// # Safety
283        ///
284        /// `coder` possibly has further requirements.
285        #[unsafe(method(initWithCoder:))]
286        #[unsafe(method_family = init)]
287        pub unsafe fn initWithCoder(
288            this: Allocated<Self>,
289            coder: &NSCoder,
290        ) -> Option<Retained<Self>>;
291
292        #[cfg(feature = "objc2-core-foundation")]
293        #[unsafe(method(initWithFrame:))]
294        #[unsafe(method_family = init)]
295        pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
296    );
297}
298
299/// Methods declared on superclass `UIControl`.
300#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
301impl UIPasteControl {
302    extern_methods!(
303        #[cfg(all(
304            feature = "UIAction",
305            feature = "UIMenuElement",
306            feature = "objc2-core-foundation"
307        ))]
308        /// Initializes the control and adds primaryAction for the UIControlEventPrimaryActionTriggered control event. Subclasses of UIControl may alter or add behaviors around the usage of primaryAction, see subclass documentation of this initializer for additional information.
309        #[unsafe(method(initWithFrame:primaryAction:))]
310        #[unsafe(method_family = init)]
311        pub fn initWithFrame_primaryAction(
312            this: Allocated<Self>,
313            frame: CGRect,
314            primary_action: Option<&UIAction>,
315        ) -> Retained<Self>;
316    );
317}
318
319/// Methods declared on superclass `UIView`.
320#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
321impl UIPasteControl {
322    extern_methods!(
323        #[unsafe(method(init))]
324        #[unsafe(method_family = init)]
325        pub fn init(this: Allocated<Self>) -> Retained<Self>;
326    );
327}
328
329/// Methods declared on superclass `NSObject`.
330#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
331impl UIPasteControl {
332    extern_methods!(
333        #[unsafe(method(new))]
334        #[unsafe(method_family = new)]
335        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
336    );
337}