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