objc2_store_kit/generated/
SKPaymentQueue.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/skpaymentqueue?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[deprecated = "No longer supported"]
15    pub struct SKPaymentQueue;
16);
17
18unsafe impl Send for SKPaymentQueue {}
19
20unsafe impl Sync for SKPaymentQueue {}
21
22unsafe impl NSObjectProtocol for SKPaymentQueue {}
23
24impl SKPaymentQueue {
25    extern_methods!(
26        #[deprecated = "No longer supported"]
27        #[unsafe(method(delegate))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn delegate(
30            &self,
31        ) -> Option<Retained<ProtocolObject<dyn SKPaymentQueueDelegate>>>;
32
33        /// This is a [weak property][objc2::topics::weak_property].
34        /// Setter for [`delegate`][Self::delegate].
35        #[deprecated = "No longer supported"]
36        #[unsafe(method(setDelegate:))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn setDelegate(
39            &self,
40            delegate: Option<&ProtocolObject<dyn SKPaymentQueueDelegate>>,
41        );
42
43        #[cfg(feature = "SKStorefront")]
44        #[deprecated = "Use Storefront.current"]
45        #[unsafe(method(storefront))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn storefront(&self) -> Option<Retained<SKStorefront>>;
48
49        #[deprecated = "No longer supported"]
50        #[unsafe(method(defaultQueue))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn defaultQueue() -> Retained<Self>;
53
54        #[deprecated = "Use AppStore.canMakePayments"]
55        #[unsafe(method(canMakePayments))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn canMakePayments() -> bool;
58
59        #[cfg(feature = "SKPayment")]
60        #[deprecated = "Use Product.purchase(confirmIn:options:)"]
61        #[unsafe(method(addPayment:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn addPayment(&self, payment: &SKPayment);
64
65        #[deprecated = "Use AppStore.sync()"]
66        #[unsafe(method(restoreCompletedTransactions))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn restoreCompletedTransactions(&self);
69
70        #[deprecated = "Use AppStore.sync()"]
71        #[unsafe(method(restoreCompletedTransactionsWithApplicationUsername:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn restoreCompletedTransactionsWithApplicationUsername(
74            &self,
75            username: Option<&NSString>,
76        );
77
78        #[cfg(feature = "SKPaymentTransaction")]
79        #[deprecated = "Use Transaction.finish()"]
80        #[unsafe(method(finishTransaction:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn finishTransaction(&self, transaction: &SKPaymentTransaction);
83
84        #[cfg(feature = "SKDownload")]
85        #[deprecated = "Hosted content is no longer supported"]
86        #[unsafe(method(startDownloads:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn startDownloads(&self, downloads: &NSArray<SKDownload>);
89
90        #[cfg(feature = "SKDownload")]
91        #[deprecated = "Hosted content is no longer supported"]
92        #[unsafe(method(pauseDownloads:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn pauseDownloads(&self, downloads: &NSArray<SKDownload>);
95
96        #[cfg(feature = "SKDownload")]
97        #[deprecated = "Hosted content is no longer supported"]
98        #[unsafe(method(resumeDownloads:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn resumeDownloads(&self, downloads: &NSArray<SKDownload>);
101
102        #[cfg(feature = "SKDownload")]
103        #[deprecated = "Hosted content is no longer supported"]
104        #[unsafe(method(cancelDownloads:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn cancelDownloads(&self, downloads: &NSArray<SKDownload>);
107
108        #[deprecated = "Use Transaction.updates or PurchaseResult from Product.purchase(confirmIn:options:)"]
109        #[unsafe(method(addTransactionObserver:))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn addTransactionObserver(
112            &self,
113            observer: &ProtocolObject<dyn SKPaymentTransactionObserver>,
114        );
115
116        #[deprecated = "No longer supported"]
117        #[unsafe(method(removeTransactionObserver:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn removeTransactionObserver(
120            &self,
121            observer: &ProtocolObject<dyn SKPaymentTransactionObserver>,
122        );
123
124        #[deprecated = "Use Transaction.updates or PurchaseResult from Product.purchase(confirmIn:options:)"]
125        #[unsafe(method(transactionObservers))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn transactionObservers(
128            &self,
129        ) -> Retained<NSArray<ProtocolObject<dyn SKPaymentTransactionObserver>>>;
130
131        #[cfg(feature = "SKPaymentTransaction")]
132        #[deprecated = "Use Transaction.unfinished"]
133        #[unsafe(method(transactions))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn transactions(&self) -> Retained<NSArray<SKPaymentTransaction>>;
136
137        #[deprecated = "Use Message.messages and Message.display(in:)"]
138        #[unsafe(method(showPriceConsentIfNeeded))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn showPriceConsentIfNeeded(&self);
141
142        #[deprecated = "Use AppStore.presentOfferCodeRedeemSheet(in:)"]
143        #[unsafe(method(presentCodeRedemptionSheet))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn presentCodeRedemptionSheet(&self);
146    );
147}
148
149/// Methods declared on superclass `NSObject`.
150impl SKPaymentQueue {
151    extern_methods!(
152        #[unsafe(method(init))]
153        #[unsafe(method_family = init)]
154        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
155
156        #[unsafe(method(new))]
157        #[unsafe(method_family = new)]
158        pub unsafe fn new() -> Retained<Self>;
159    );
160}
161
162extern_protocol!(
163    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skpaymentqueuedelegate?language=objc)
164    #[deprecated = "No longer supported"]
165    pub unsafe trait SKPaymentQueueDelegate: NSObjectProtocol {
166        #[cfg(all(feature = "SKPaymentTransaction", feature = "SKStorefront"))]
167        #[deprecated = "Pass Product.PurchaseOption.onStorefrontChange(shouldContinuePurchase:) to product.purchase(options:)"]
168        #[optional]
169        #[unsafe(method(paymentQueue:shouldContinueTransaction:inStorefront:))]
170        #[unsafe(method_family = none)]
171        unsafe fn paymentQueue_shouldContinueTransaction_inStorefront(
172            &self,
173            payment_queue: &SKPaymentQueue,
174            transaction: &SKPaymentTransaction,
175            new_storefront: &SKStorefront,
176        ) -> bool;
177
178        #[deprecated = "Use Message.messages and Message.display(in:)"]
179        #[optional]
180        #[unsafe(method(paymentQueueShouldShowPriceConsent:))]
181        #[unsafe(method_family = none)]
182        unsafe fn paymentQueueShouldShowPriceConsent(&self, payment_queue: &SKPaymentQueue)
183            -> bool;
184    }
185);
186
187extern_protocol!(
188    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skpaymenttransactionobserver?language=objc)
189    #[deprecated = "Use StoreKit 2 Transaction APIs"]
190    pub unsafe trait SKPaymentTransactionObserver: NSObjectProtocol {
191        #[cfg(feature = "SKPaymentTransaction")]
192        #[deprecated = "Use StoreKit 2 Transaction APIs"]
193        #[unsafe(method(paymentQueue:updatedTransactions:))]
194        #[unsafe(method_family = none)]
195        unsafe fn paymentQueue_updatedTransactions(
196            &self,
197            queue: &SKPaymentQueue,
198            transactions: &NSArray<SKPaymentTransaction>,
199        );
200
201        #[cfg(feature = "SKPaymentTransaction")]
202        #[deprecated = "Use StoreKit 2 Transaction APIs"]
203        #[optional]
204        #[unsafe(method(paymentQueue:removedTransactions:))]
205        #[unsafe(method_family = none)]
206        unsafe fn paymentQueue_removedTransactions(
207            &self,
208            queue: &SKPaymentQueue,
209            transactions: &NSArray<SKPaymentTransaction>,
210        );
211
212        #[deprecated = "Use AppStore.sync()"]
213        #[optional]
214        #[unsafe(method(paymentQueue:restoreCompletedTransactionsFailedWithError:))]
215        #[unsafe(method_family = none)]
216        unsafe fn paymentQueue_restoreCompletedTransactionsFailedWithError(
217            &self,
218            queue: &SKPaymentQueue,
219            error: &NSError,
220        );
221
222        #[deprecated = "Use AppStore.sync()"]
223        #[optional]
224        #[unsafe(method(paymentQueueRestoreCompletedTransactionsFinished:))]
225        #[unsafe(method_family = none)]
226        unsafe fn paymentQueueRestoreCompletedTransactionsFinished(&self, queue: &SKPaymentQueue);
227
228        #[cfg(feature = "SKDownload")]
229        #[deprecated = "Hosted content is no longer supported"]
230        #[optional]
231        #[unsafe(method(paymentQueue:updatedDownloads:))]
232        #[unsafe(method_family = none)]
233        unsafe fn paymentQueue_updatedDownloads(
234            &self,
235            queue: &SKPaymentQueue,
236            downloads: &NSArray<SKDownload>,
237        );
238
239        #[cfg(all(feature = "SKPayment", feature = "SKProduct"))]
240        #[deprecated = "Use PurchaseIntent.intents"]
241        #[optional]
242        #[unsafe(method(paymentQueue:shouldAddStorePayment:forProduct:))]
243        #[unsafe(method_family = none)]
244        unsafe fn paymentQueue_shouldAddStorePayment_forProduct(
245            &self,
246            queue: &SKPaymentQueue,
247            payment: &SKPayment,
248            product: &SKProduct,
249        ) -> bool;
250
251        #[deprecated = "Use Storefront.updates"]
252        #[optional]
253        #[unsafe(method(paymentQueueDidChangeStorefront:))]
254        #[unsafe(method_family = none)]
255        unsafe fn paymentQueueDidChangeStorefront(&self, queue: &SKPaymentQueue);
256
257        #[deprecated = "Use Transaction.updates"]
258        #[optional]
259        #[unsafe(method(paymentQueue:didRevokeEntitlementsForProductIdentifiers:))]
260        #[unsafe(method_family = none)]
261        unsafe fn paymentQueue_didRevokeEntitlementsForProductIdentifiers(
262            &self,
263            queue: &SKPaymentQueue,
264            product_identifiers: &NSArray<NSString>,
265        );
266    }
267);