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
47unsafe impl NSCoding for UIPasteControlConfiguration {}
48
49unsafe impl NSObjectProtocol for UIPasteControlConfiguration {}
50
51unsafe impl NSSecureCoding for UIPasteControlConfiguration {}
52
53impl UIPasteControlConfiguration {
54    extern_methods!(
55        #[unsafe(method(displayMode))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn displayMode(&self) -> UIPasteControlDisplayMode;
58
59        /// Setter for [`displayMode`][Self::displayMode].
60        #[unsafe(method(setDisplayMode:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn setDisplayMode(&self, display_mode: UIPasteControlDisplayMode);
63
64        #[cfg(feature = "UIButtonConfiguration")]
65        #[unsafe(method(cornerStyle))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn cornerStyle(&self) -> UIButtonConfigurationCornerStyle;
68
69        #[cfg(feature = "UIButtonConfiguration")]
70        /// Setter for [`cornerStyle`][Self::cornerStyle].
71        #[unsafe(method(setCornerStyle:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn setCornerStyle(&self, corner_style: UIButtonConfigurationCornerStyle);
74
75        #[cfg(feature = "objc2-core-foundation")]
76        #[unsafe(method(cornerRadius))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn cornerRadius(&self) -> CGFloat;
79
80        #[cfg(feature = "objc2-core-foundation")]
81        /// Setter for [`cornerRadius`][Self::cornerRadius].
82        #[unsafe(method(setCornerRadius:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setCornerRadius(&self, corner_radius: CGFloat);
85
86        #[cfg(feature = "UIGeometry")]
87        #[unsafe(method(imagePlacement))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn imagePlacement(&self) -> NSDirectionalRectEdge;
90
91        #[cfg(feature = "UIGeometry")]
92        /// Setter for [`imagePlacement`][Self::imagePlacement].
93        #[unsafe(method(setImagePlacement:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn setImagePlacement(&self, image_placement: NSDirectionalRectEdge);
96
97        #[cfg(feature = "UIColor")]
98        #[unsafe(method(baseForegroundColor))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn baseForegroundColor(&self) -> Option<Retained<UIColor>>;
101
102        #[cfg(feature = "UIColor")]
103        /// Setter for [`baseForegroundColor`][Self::baseForegroundColor].
104        #[unsafe(method(setBaseForegroundColor:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn setBaseForegroundColor(&self, base_foreground_color: Option<&UIColor>);
107
108        #[cfg(feature = "UIColor")]
109        #[unsafe(method(baseBackgroundColor))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn baseBackgroundColor(&self) -> Option<Retained<UIColor>>;
112
113        #[cfg(feature = "UIColor")]
114        /// Setter for [`baseBackgroundColor`][Self::baseBackgroundColor].
115        #[unsafe(method(setBaseBackgroundColor:))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn setBaseBackgroundColor(&self, base_background_color: Option<&UIColor>);
118    );
119}
120
121/// Methods declared on superclass `NSObject`.
122impl UIPasteControlConfiguration {
123    extern_methods!(
124        #[unsafe(method(init))]
125        #[unsafe(method_family = init)]
126        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
127
128        #[unsafe(method(new))]
129        #[unsafe(method_family = new)]
130        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
131    );
132}
133
134extern_class!(
135    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uipastecontrol?language=objc)
136    #[unsafe(super(UIControl, UIView, UIResponder, NSObject))]
137    #[thread_kind = MainThreadOnly]
138    #[derive(Debug, PartialEq, Eq, Hash)]
139    #[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
140    pub struct UIPasteControl;
141);
142
143#[cfg(all(
144    feature = "UIControl",
145    feature = "UIResponder",
146    feature = "UIView",
147    feature = "objc2-quartz-core"
148))]
149#[cfg(not(target_os = "watchos"))]
150unsafe impl CALayerDelegate for UIPasteControl {}
151
152#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
153unsafe impl NSCoding for UIPasteControl {}
154
155#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
156unsafe impl NSObjectProtocol for UIPasteControl {}
157
158#[cfg(all(
159    feature = "UIAppearance",
160    feature = "UIControl",
161    feature = "UIResponder",
162    feature = "UIView"
163))]
164unsafe impl UIAppearance for UIPasteControl {}
165
166#[cfg(all(
167    feature = "UIAppearance",
168    feature = "UIControl",
169    feature = "UIResponder",
170    feature = "UIView"
171))]
172unsafe impl UIAppearanceContainer for UIPasteControl {}
173
174#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
175unsafe impl UICoordinateSpace for UIPasteControl {}
176
177#[cfg(all(
178    feature = "UIControl",
179    feature = "UIDynamicBehavior",
180    feature = "UIResponder",
181    feature = "UIView"
182))]
183unsafe impl UIDynamicItem for UIPasteControl {}
184
185#[cfg(all(
186    feature = "UIControl",
187    feature = "UIFocus",
188    feature = "UIResponder",
189    feature = "UIView"
190))]
191unsafe impl UIFocusEnvironment for UIPasteControl {}
192
193#[cfg(all(
194    feature = "UIControl",
195    feature = "UIFocus",
196    feature = "UIResponder",
197    feature = "UIView"
198))]
199unsafe impl UIFocusItem for UIPasteControl {}
200
201#[cfg(all(
202    feature = "UIControl",
203    feature = "UIFocus",
204    feature = "UIResponder",
205    feature = "UIView"
206))]
207unsafe impl UIFocusItemContainer for UIPasteControl {}
208
209#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
210unsafe impl UIResponderStandardEditActions for UIPasteControl {}
211
212#[cfg(all(
213    feature = "UIControl",
214    feature = "UIResponder",
215    feature = "UITraitCollection",
216    feature = "UIView"
217))]
218unsafe impl UITraitEnvironment for UIPasteControl {}
219
220#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
221impl UIPasteControl {
222    extern_methods!(
223        #[unsafe(method(configuration))]
224        #[unsafe(method_family = none)]
225        pub unsafe fn configuration(&self) -> Retained<UIPasteControlConfiguration>;
226
227        #[cfg(feature = "UIPasteConfigurationSupporting")]
228        #[unsafe(method(target))]
229        #[unsafe(method_family = none)]
230        pub unsafe fn target(
231            &self,
232        ) -> Option<Retained<ProtocolObject<dyn UIPasteConfigurationSupporting>>>;
233
234        #[cfg(feature = "UIPasteConfigurationSupporting")]
235        /// This is a [weak property][objc2::topics::weak_property].
236        /// Setter for [`target`][Self::target].
237        #[unsafe(method(setTarget:))]
238        #[unsafe(method_family = none)]
239        pub unsafe fn setTarget(
240            &self,
241            target: Option<&ProtocolObject<dyn UIPasteConfigurationSupporting>>,
242        );
243
244        #[unsafe(method(initWithConfiguration:))]
245        #[unsafe(method_family = init)]
246        pub unsafe fn initWithConfiguration(
247            this: Allocated<Self>,
248            configuration: &UIPasteControlConfiguration,
249        ) -> Retained<Self>;
250
251        #[unsafe(method(initWithCoder:))]
252        #[unsafe(method_family = init)]
253        pub unsafe fn initWithCoder(
254            this: Allocated<Self>,
255            coder: &NSCoder,
256        ) -> Option<Retained<Self>>;
257
258        #[cfg(feature = "objc2-core-foundation")]
259        #[unsafe(method(initWithFrame:))]
260        #[unsafe(method_family = init)]
261        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
262    );
263}
264
265/// Methods declared on superclass `UIControl`.
266#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
267impl UIPasteControl {
268    extern_methods!(
269        #[cfg(all(
270            feature = "UIAction",
271            feature = "UIMenuElement",
272            feature = "objc2-core-foundation"
273        ))]
274        /// 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.
275        #[unsafe(method(initWithFrame:primaryAction:))]
276        #[unsafe(method_family = init)]
277        pub unsafe fn initWithFrame_primaryAction(
278            this: Allocated<Self>,
279            frame: CGRect,
280            primary_action: Option<&UIAction>,
281        ) -> Retained<Self>;
282    );
283}
284
285/// Methods declared on superclass `NSObject`.
286#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
287impl UIPasteControl {
288    extern_methods!(
289        #[unsafe(method(init))]
290        #[unsafe(method_family = init)]
291        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
292
293        #[unsafe(method(new))]
294        #[unsafe(method_family = new)]
295        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
296    );
297}