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 = "objc2-core-foundation")]
113        #[unsafe(method(cornerRadius))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn cornerRadius(&self) -> CGFloat;
116
117        #[cfg(feature = "objc2-core-foundation")]
118        /// Setter for [`cornerRadius`][Self::cornerRadius].
119        #[unsafe(method(setCornerRadius:))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn setCornerRadius(&self, corner_radius: CGFloat);
122    );
123}
124
125/// Methods declared on superclass `NSButton`.
126#[cfg(feature = "objc2-app-kit")]
127#[cfg(target_os = "macos")]
128impl PKPaymentButton {
129    extern_methods!(
130        /// Creates a standard push button with a title and image.
131        ///
132        /// Parameter `title`: The localized title string that is displayed on the button.
133        ///
134        /// 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.
135        ///
136        /// Parameter `target`: The target object that receives action messages from the control.
137        ///
138        /// Parameter `action`: The action message sent by the control.
139        ///
140        /// Returns: An initialized button object.
141        #[unsafe(method(buttonWithTitle:image:target:action:))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn buttonWithTitle_image_target_action(
144            title: &NSString,
145            image: &NSImage,
146            target: Option<&AnyObject>,
147            action: Option<Sel>,
148            mtm: MainThreadMarker,
149        ) -> Retained<Self>;
150
151        /// Creates a standard push button with the provided title.
152        ///
153        /// Parameter `title`: The localized title string that is displayed on the button.
154        ///
155        /// Parameter `target`: The target object that receives action messages from the control.
156        ///
157        /// Parameter `action`: The action message sent by the control.
158        ///
159        /// Returns: An initialized button object.
160        #[unsafe(method(buttonWithTitle:target:action:))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn buttonWithTitle_target_action(
163            title: &NSString,
164            target: Option<&AnyObject>,
165            action: Option<Sel>,
166            mtm: MainThreadMarker,
167        ) -> Retained<Self>;
168
169        /// Creates a standard push button with the provided image. Set the image's accessibilityDescription property to ensure accessibility for this control.
170        ///
171        /// Parameter `image`: The image to display in the body of the button.
172        ///
173        /// Parameter `target`: The target object that receives action messages from the control.
174        ///
175        /// Parameter `action`: The action message sent by the control.
176        ///
177        /// Returns: An initialized button object.
178        #[unsafe(method(buttonWithImage:target:action:))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn buttonWithImage_target_action(
181            image: &NSImage,
182            target: Option<&AnyObject>,
183            action: Option<Sel>,
184            mtm: MainThreadMarker,
185        ) -> Retained<Self>;
186
187        /// Creates a standard checkbox with the provided title.
188        ///
189        /// Parameter `title`: The localized title string that is displayed alongside the checkbox.
190        ///
191        /// Parameter `target`: The target object that receives action messages from the control.
192        ///
193        /// Parameter `action`: The action message sent by the control.
194        ///
195        /// Returns: An initialized button object.
196        #[unsafe(method(checkboxWithTitle:target:action:))]
197        #[unsafe(method_family = none)]
198        pub unsafe fn checkboxWithTitle_target_action(
199            title: &NSString,
200            target: Option<&AnyObject>,
201            action: Option<Sel>,
202            mtm: MainThreadMarker,
203        ) -> Retained<Self>;
204
205        /// Creates a standard radio button with the provided title.
206        ///
207        /// Parameter `title`: The localized title string that is displayed alongside the radio button.
208        ///
209        /// Parameter `target`: The target object that receives action messages from the control.
210        ///
211        /// Parameter `action`: The action message sent by the control.
212        ///
213        /// Returns: An initialized button object.
214        #[unsafe(method(radioButtonWithTitle:target:action:))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn radioButtonWithTitle_target_action(
217            title: &NSString,
218            target: Option<&AnyObject>,
219            action: Option<Sel>,
220            mtm: MainThreadMarker,
221        ) -> Retained<Self>;
222    );
223}
224
225/// Methods declared on superclass `NSControl`.
226#[cfg(feature = "objc2-app-kit")]
227#[cfg(target_os = "macos")]
228impl PKPaymentButton {
229    extern_methods!(
230        #[unsafe(method(initWithFrame:))]
231        #[unsafe(method_family = init)]
232        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
233
234        #[unsafe(method(initWithCoder:))]
235        #[unsafe(method_family = init)]
236        pub unsafe fn initWithCoder(
237            this: Allocated<Self>,
238            coder: &NSCoder,
239        ) -> Option<Retained<Self>>;
240    );
241}
242
243/// Methods declared on superclass `NSResponder`.
244#[cfg(feature = "objc2-app-kit")]
245#[cfg(target_os = "macos")]
246impl PKPaymentButton {
247    extern_methods!(
248        #[unsafe(method(init))]
249        #[unsafe(method_family = init)]
250        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
251    );
252}
253
254/// Methods declared on superclass `NSObject`.
255#[cfg(feature = "objc2-app-kit")]
256#[cfg(target_os = "macos")]
257impl PKPaymentButton {
258    extern_methods!(
259        #[unsafe(method(new))]
260        #[unsafe(method_family = new)]
261        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
262    );
263}