objc2_pass_kit/generated/
PKPaymentButton.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-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9#[cfg(feature = "objc2-core-foundation")]
10use objc2_core_foundation::*;
11use objc2_foundation::*;
12
13use crate::*;
14
15extern_class!(
16    /// [Apple's documentation](https://developer.apple.com/documentation/passkit/pkpaymentbutton?language=objc)
17    #[unsafe(super(NSButton, NSControl, NSView, NSResponder, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(feature = "objc2-app-kit")]
20    #[cfg(target_os = "macos")]
21    pub struct PKPaymentButton;
22);
23
24#[cfg(feature = "objc2-app-kit")]
25#[cfg(target_os = "macos")]
26extern_conformance!(
27    unsafe impl NSAccessibility for PKPaymentButton {}
28);
29
30#[cfg(feature = "objc2-app-kit")]
31#[cfg(target_os = "macos")]
32extern_conformance!(
33    unsafe impl NSAccessibilityButton for PKPaymentButton {}
34);
35
36#[cfg(feature = "objc2-app-kit")]
37#[cfg(target_os = "macos")]
38extern_conformance!(
39    unsafe impl NSAccessibilityElementProtocol for PKPaymentButton {}
40);
41
42#[cfg(feature = "objc2-app-kit")]
43#[cfg(target_os = "macos")]
44extern_conformance!(
45    unsafe impl NSAnimatablePropertyContainer for PKPaymentButton {}
46);
47
48#[cfg(feature = "objc2-app-kit")]
49#[cfg(target_os = "macos")]
50extern_conformance!(
51    unsafe impl NSAppearanceCustomization for PKPaymentButton {}
52);
53
54#[cfg(feature = "objc2-app-kit")]
55#[cfg(target_os = "macos")]
56extern_conformance!(
57    unsafe impl NSCoding for PKPaymentButton {}
58);
59
60#[cfg(feature = "objc2-app-kit")]
61#[cfg(target_os = "macos")]
62extern_conformance!(
63    unsafe impl NSDraggingDestination for PKPaymentButton {}
64);
65
66#[cfg(feature = "objc2-app-kit")]
67#[cfg(target_os = "macos")]
68extern_conformance!(
69    unsafe impl NSObjectProtocol for PKPaymentButton {}
70);
71
72#[cfg(feature = "objc2-app-kit")]
73#[cfg(target_os = "macos")]
74extern_conformance!(
75    unsafe impl NSUserInterfaceCompression for PKPaymentButton {}
76);
77
78#[cfg(feature = "objc2-app-kit")]
79#[cfg(target_os = "macos")]
80extern_conformance!(
81    unsafe impl NSUserInterfaceItemIdentification for PKPaymentButton {}
82);
83
84#[cfg(feature = "objc2-app-kit")]
85#[cfg(target_os = "macos")]
86extern_conformance!(
87    unsafe impl NSUserInterfaceValidations for PKPaymentButton {}
88);
89
90#[cfg(feature = "objc2-app-kit")]
91#[cfg(target_os = "macos")]
92impl PKPaymentButton {
93    extern_methods!(
94        #[cfg(feature = "PKConstants")]
95        #[unsafe(method(buttonWithType:style:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn buttonWithType_style(
98            button_type: PKPaymentButtonType,
99            button_style: PKPaymentButtonStyle,
100            mtm: MainThreadMarker,
101        ) -> Retained<Self>;
102
103        #[cfg(feature = "PKConstants")]
104        #[unsafe(method(initWithPaymentButtonType:paymentButtonStyle:))]
105        #[unsafe(method_family = init)]
106        pub unsafe fn initWithPaymentButtonType_paymentButtonStyle(
107            this: Allocated<Self>,
108            r#type: PKPaymentButtonType,
109            style: PKPaymentButtonStyle,
110        ) -> Retained<Self>;
111
112        #[cfg(feature = "PKConstants")]
113        #[unsafe(method(buttonWithType:style:disableCardArt:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn buttonWithType_style_disableCardArt(
116            button_type: PKPaymentButtonType,
117            button_style: PKPaymentButtonStyle,
118            disable_card_art: bool,
119            mtm: MainThreadMarker,
120        ) -> Retained<Self>;
121
122        #[cfg(feature = "PKConstants")]
123        #[unsafe(method(initWithPaymentButtonType:paymentButtonStyle:disableCardArt:))]
124        #[unsafe(method_family = init)]
125        pub unsafe fn initWithPaymentButtonType_paymentButtonStyle_disableCardArt(
126            this: Allocated<Self>,
127            r#type: PKPaymentButtonType,
128            style: PKPaymentButtonStyle,
129            disable_card_art: bool,
130        ) -> Retained<Self>;
131
132        #[cfg(feature = "objc2-core-foundation")]
133        #[unsafe(method(cornerRadius))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn cornerRadius(&self) -> CGFloat;
136
137        #[cfg(feature = "objc2-core-foundation")]
138        /// Setter for [`cornerRadius`][Self::cornerRadius].
139        #[unsafe(method(setCornerRadius:))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn setCornerRadius(&self, corner_radius: CGFloat);
142    );
143}
144
145/// Methods declared on superclass `NSButton`.
146#[cfg(feature = "objc2-app-kit")]
147#[cfg(target_os = "macos")]
148impl PKPaymentButton {
149    extern_methods!(
150        /// Creates a standard push button with a title and image.
151        ///
152        /// Parameter `title`: The localized title string that is displayed on the button.
153        ///
154        /// Parameter `image`: The image that is displayed alongside the title. In left-to-right localizations, the image is displayed to the left of the title. In right-to-left localizations, it is displayed to the right.
155        ///
156        /// Parameter `target`: The target object that receives action messages from the control.
157        ///
158        /// Parameter `action`: The action message sent by the control.
159        ///
160        /// Returns: An initialized button object.
161        ///
162        /// # Safety
163        ///
164        /// - `target` should be of the correct type.
165        /// - `action` must be a valid selector.
166        #[unsafe(method(buttonWithTitle:image:target:action:))]
167        #[unsafe(method_family = none)]
168        pub unsafe fn buttonWithTitle_image_target_action(
169            title: &NSString,
170            image: &NSImage,
171            target: Option<&AnyObject>,
172            action: Option<Sel>,
173            mtm: MainThreadMarker,
174        ) -> Retained<Self>;
175
176        /// Creates a standard push button with the provided title.
177        ///
178        /// Parameter `title`: The localized title string that is displayed on the button.
179        ///
180        /// Parameter `target`: The target object that receives action messages from the control.
181        ///
182        /// Parameter `action`: The action message sent by the control.
183        ///
184        /// Returns: An initialized button object.
185        ///
186        /// # Safety
187        ///
188        /// - `target` should be of the correct type.
189        /// - `action` must be a valid selector.
190        #[unsafe(method(buttonWithTitle:target:action:))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn buttonWithTitle_target_action(
193            title: &NSString,
194            target: Option<&AnyObject>,
195            action: Option<Sel>,
196            mtm: MainThreadMarker,
197        ) -> Retained<Self>;
198
199        /// Creates a standard push button with the provided image. Set the image's accessibilityDescription property to ensure accessibility for this control.
200        ///
201        /// Parameter `image`: The image to display in the body of the button.
202        ///
203        /// Parameter `target`: The target object that receives action messages from the control.
204        ///
205        /// Parameter `action`: The action message sent by the control.
206        ///
207        /// Returns: An initialized button object.
208        ///
209        /// # Safety
210        ///
211        /// - `target` should be of the correct type.
212        /// - `action` must be a valid selector.
213        #[unsafe(method(buttonWithImage:target:action:))]
214        #[unsafe(method_family = none)]
215        pub unsafe fn buttonWithImage_target_action(
216            image: &NSImage,
217            target: Option<&AnyObject>,
218            action: Option<Sel>,
219            mtm: MainThreadMarker,
220        ) -> Retained<Self>;
221
222        /// Creates a standard checkbox with the provided title.
223        ///
224        /// Parameter `title`: The localized title string that is displayed alongside the checkbox.
225        ///
226        /// Parameter `target`: The target object that receives action messages from the control.
227        ///
228        /// Parameter `action`: The action message sent by the control.
229        ///
230        /// Returns: An initialized button object.
231        ///
232        /// # Safety
233        ///
234        /// - `target` should be of the correct type.
235        /// - `action` must be a valid selector.
236        #[unsafe(method(checkboxWithTitle:target:action:))]
237        #[unsafe(method_family = none)]
238        pub unsafe fn checkboxWithTitle_target_action(
239            title: &NSString,
240            target: Option<&AnyObject>,
241            action: Option<Sel>,
242            mtm: MainThreadMarker,
243        ) -> Retained<Self>;
244
245        /// Creates a standard radio button with the provided title.
246        ///
247        /// Parameter `title`: The localized title string that is displayed alongside the radio button.
248        ///
249        /// Parameter `target`: The target object that receives action messages from the control.
250        ///
251        /// Parameter `action`: The action message sent by the control.
252        ///
253        /// Returns: An initialized button object.
254        ///
255        /// # Safety
256        ///
257        /// - `target` should be of the correct type.
258        /// - `action` must be a valid selector.
259        #[unsafe(method(radioButtonWithTitle:target:action:))]
260        #[unsafe(method_family = none)]
261        pub unsafe fn radioButtonWithTitle_target_action(
262            title: &NSString,
263            target: Option<&AnyObject>,
264            action: Option<Sel>,
265            mtm: MainThreadMarker,
266        ) -> Retained<Self>;
267    );
268}
269
270/// Methods declared on superclass `NSControl`.
271#[cfg(feature = "objc2-app-kit")]
272#[cfg(target_os = "macos")]
273impl PKPaymentButton {
274    extern_methods!(
275        #[unsafe(method(initWithFrame:))]
276        #[unsafe(method_family = init)]
277        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
278
279        /// # Safety
280        ///
281        /// `coder` possibly has further requirements.
282        #[unsafe(method(initWithCoder:))]
283        #[unsafe(method_family = init)]
284        pub unsafe fn initWithCoder(
285            this: Allocated<Self>,
286            coder: &NSCoder,
287        ) -> Option<Retained<Self>>;
288    );
289}
290
291/// Methods declared on superclass `NSResponder`.
292#[cfg(feature = "objc2-app-kit")]
293#[cfg(target_os = "macos")]
294impl PKPaymentButton {
295    extern_methods!(
296        #[unsafe(method(init))]
297        #[unsafe(method_family = init)]
298        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
299    );
300}
301
302/// Methods declared on superclass `NSObject`.
303#[cfg(feature = "objc2-app-kit")]
304#[cfg(target_os = "macos")]
305impl PKPaymentButton {
306    extern_methods!(
307        #[unsafe(method(new))]
308        #[unsafe(method_family = new)]
309        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
310    );
311}