objc2_store_kit/generated/
SKPayment.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
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skpayment?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[deprecated = "Use Product.purchase(confirmIn:options:)"]
15    pub struct SKPayment;
16);
17
18extern_conformance!(
19    unsafe impl NSCopying for SKPayment {}
20);
21
22unsafe impl CopyingHelper for SKPayment {
23    type Result = Self;
24}
25
26extern_conformance!(
27    unsafe impl NSMutableCopying for SKPayment {}
28);
29
30unsafe impl MutableCopyingHelper for SKPayment {
31    type Result = SKMutablePayment;
32}
33
34extern_conformance!(
35    unsafe impl NSObjectProtocol for SKPayment {}
36);
37
38impl SKPayment {
39    extern_methods!(
40        #[cfg(feature = "SKProduct")]
41        #[deprecated = "Use Product.purchase(confirmIn:options:)"]
42        #[unsafe(method(paymentWithProduct:))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn paymentWithProduct(product: &SKProduct) -> Retained<Self>;
45
46        #[deprecated]
47        #[unsafe(method(paymentWithProductIdentifier:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn paymentWithProductIdentifier(identifier: &NSString) -> Retained<AnyObject>;
50
51        #[deprecated = "Use Product.purchase(confirmIn:options:)"]
52        #[unsafe(method(productIdentifier))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn productIdentifier(&self) -> Retained<NSString>;
55
56        #[deprecated = "Create Product.PurchaseOption.custom values to use in Product.purchase(confirmIn:options:)"]
57        #[unsafe(method(requestData))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn requestData(&self) -> Option<Retained<NSData>>;
60
61        #[deprecated = "Create a Product.PurchaseOption.quantity to use in Product.purchase(confirmIn:options:)"]
62        #[unsafe(method(quantity))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn quantity(&self) -> NSInteger;
65
66        #[deprecated = "Create a Product.PurchaseOption.appAccountToken to use in Product.purchase(confirmIn:options:)"]
67        #[unsafe(method(applicationUsername))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn applicationUsername(&self) -> Option<Retained<NSString>>;
70
71        #[deprecated = "Create a Product.PurchaseOption.simulatesAskToBuyInSandbox to use in Product.purchase(confirmIn:options:)"]
72        #[unsafe(method(simulatesAskToBuyInSandbox))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn simulatesAskToBuyInSandbox(&self) -> bool;
75
76        #[cfg(feature = "SKPaymentDiscount")]
77        #[deprecated = "Create a Product.PurchaseOption.promotionalOffer to use in Product.purchase(confirmIn:options:)"]
78        #[unsafe(method(paymentDiscount))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn paymentDiscount(&self) -> Option<Retained<SKPaymentDiscount>>;
81    );
82}
83
84/// Methods declared on superclass `NSObject`.
85impl SKPayment {
86    extern_methods!(
87        #[unsafe(method(init))]
88        #[unsafe(method_family = init)]
89        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
90
91        #[unsafe(method(new))]
92        #[unsafe(method_family = new)]
93        pub unsafe fn new() -> Retained<Self>;
94    );
95}
96
97extern_class!(
98    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skmutablepayment?language=objc)
99    #[unsafe(super(SKPayment, NSObject))]
100    #[derive(Debug, PartialEq, Eq, Hash)]
101    #[deprecated = "Use Product.purchase(confirmIn:options:)"]
102    pub struct SKMutablePayment;
103);
104
105extern_conformance!(
106    unsafe impl NSCopying for SKMutablePayment {}
107);
108
109unsafe impl CopyingHelper for SKMutablePayment {
110    type Result = SKPayment;
111}
112
113extern_conformance!(
114    unsafe impl NSMutableCopying for SKMutablePayment {}
115);
116
117unsafe impl MutableCopyingHelper for SKMutablePayment {
118    type Result = Self;
119}
120
121extern_conformance!(
122    unsafe impl NSObjectProtocol for SKMutablePayment {}
123);
124
125impl SKMutablePayment {
126    extern_methods!(
127        #[deprecated = "Create a Product.PurchaseOption.appAccountToken to use in Product.purchase(confirmIn:options:)"]
128        #[unsafe(method(applicationUsername))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn applicationUsername(&self) -> Option<Retained<NSString>>;
131
132        /// Setter for [`applicationUsername`][Self::applicationUsername].
133        ///
134        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
135        #[deprecated = "Create a Product.PurchaseOption.appAccountToken to use in Product.purchase(confirmIn:options:)"]
136        #[unsafe(method(setApplicationUsername:))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn setApplicationUsername(&self, application_username: Option<&NSString>);
139
140        #[cfg(feature = "SKPaymentDiscount")]
141        #[deprecated = "Create a Product.PurchaseOption.promotionalOffer to use in Product.purchase(confirmIn:options:)"]
142        #[unsafe(method(paymentDiscount))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn paymentDiscount(&self) -> Option<Retained<SKPaymentDiscount>>;
145
146        #[cfg(feature = "SKPaymentDiscount")]
147        /// Setter for [`paymentDiscount`][Self::paymentDiscount].
148        ///
149        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
150        #[deprecated = "Create a Product.PurchaseOption.promotionalOffer to use in Product.purchase(confirmIn:options:)"]
151        #[unsafe(method(setPaymentDiscount:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn setPaymentDiscount(&self, payment_discount: Option<&SKPaymentDiscount>);
154
155        #[deprecated = "Use Product.purchase(confirmIn:options:)"]
156        #[unsafe(method(productIdentifier))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn productIdentifier(&self) -> Retained<NSString>;
159
160        /// Setter for [`productIdentifier`][Self::productIdentifier].
161        ///
162        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
163        #[deprecated = "Use Product.purchase(confirmIn:options:)"]
164        #[unsafe(method(setProductIdentifier:))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn setProductIdentifier(&self, product_identifier: &NSString);
167
168        #[deprecated = "Create a Product.PurchaseOption.quantity to use in Product.purchase(confirmIn:options:)"]
169        #[unsafe(method(quantity))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn quantity(&self) -> NSInteger;
172
173        /// Setter for [`quantity`][Self::quantity].
174        #[deprecated = "Create a Product.PurchaseOption.quantity to use in Product.purchase(confirmIn:options:)"]
175        #[unsafe(method(setQuantity:))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn setQuantity(&self, quantity: NSInteger);
178
179        #[deprecated = "Create Product.PurchaseOption.custom values to use in Product.purchase(confirmIn:options:)"]
180        #[unsafe(method(requestData))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn requestData(&self) -> Option<Retained<NSData>>;
183
184        /// Setter for [`requestData`][Self::requestData].
185        ///
186        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
187        #[deprecated = "Create Product.PurchaseOption.custom values to use in Product.purchase(confirmIn:options:)"]
188        #[unsafe(method(setRequestData:))]
189        #[unsafe(method_family = none)]
190        pub unsafe fn setRequestData(&self, request_data: Option<&NSData>);
191
192        #[deprecated = "Create a Product.PurchaseOption.simulatesAskToBuyInSandbox to use in Product.purchase(confirmIn:options:)"]
193        #[unsafe(method(simulatesAskToBuyInSandbox))]
194        #[unsafe(method_family = none)]
195        pub unsafe fn simulatesAskToBuyInSandbox(&self) -> bool;
196
197        /// Setter for [`simulatesAskToBuyInSandbox`][Self::simulatesAskToBuyInSandbox].
198        #[deprecated = "Create a Product.PurchaseOption.simulatesAskToBuyInSandbox to use in Product.purchase(confirmIn:options:)"]
199        #[unsafe(method(setSimulatesAskToBuyInSandbox:))]
200        #[unsafe(method_family = none)]
201        pub unsafe fn setSimulatesAskToBuyInSandbox(&self, simulates_ask_to_buy_in_sandbox: bool);
202    );
203}
204
205/// Methods declared on superclass `SKPayment`.
206impl SKMutablePayment {
207    extern_methods!(
208        #[cfg(feature = "SKProduct")]
209        #[deprecated = "Use Product.purchase(confirmIn:options:)"]
210        #[unsafe(method(paymentWithProduct:))]
211        #[unsafe(method_family = none)]
212        pub unsafe fn paymentWithProduct(product: &SKProduct) -> Retained<Self>;
213    );
214}
215
216/// Methods declared on superclass `NSObject`.
217impl SKMutablePayment {
218    extern_methods!(
219        #[unsafe(method(init))]
220        #[unsafe(method_family = init)]
221        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
222
223        #[unsafe(method(new))]
224        #[unsafe(method_family = new)]
225        pub unsafe fn new() -> Retained<Self>;
226    );
227}