Skip to main content

objc2_store_kit/generated/
SKProductsRequest.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_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skproductsrequestdelegate?language=objc)
12    #[cfg(feature = "SKRequest")]
13    #[deprecated = "Get products using Product.products(for:)"]
14    pub unsafe trait SKProductsRequestDelegate: SKRequestDelegate {
15        #[deprecated = "Get products using Product.products(for:)"]
16        #[unsafe(method(productsRequest:didReceiveResponse:))]
17        #[unsafe(method_family = none)]
18        unsafe fn productsRequest_didReceiveResponse(
19            &self,
20            request: &SKProductsRequest,
21            response: &SKProductsResponse,
22        );
23    }
24);
25
26extern_class!(
27    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skproductsrequest?language=objc)
28    #[unsafe(super(SKRequest, NSObject))]
29    #[derive(Debug, PartialEq, Eq, Hash)]
30    #[cfg(feature = "SKRequest")]
31    #[deprecated = "Use Product.products(for:)"]
32    pub struct SKProductsRequest;
33);
34
35#[cfg(feature = "SKRequest")]
36extern_conformance!(
37    unsafe impl NSObjectProtocol for SKProductsRequest {}
38);
39
40#[cfg(feature = "SKRequest")]
41impl SKProductsRequest {
42    extern_methods!(
43        #[deprecated = "Use Product.products(for:)"]
44        #[unsafe(method(initWithProductIdentifiers:))]
45        #[unsafe(method_family = init)]
46        pub unsafe fn initWithProductIdentifiers(
47            this: Allocated<Self>,
48            product_identifiers: &NSSet<NSString>,
49        ) -> Retained<Self>;
50
51        #[deprecated = "Use Product.products(for:)"]
52        #[unsafe(method(delegate))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn delegate(
55            &self,
56        ) -> Option<Retained<ProtocolObject<dyn SKProductsRequestDelegate>>>;
57
58        /// Setter for [`delegate`][Self::delegate].
59        ///
60        /// This is a [weak property][objc2::topics::weak_property].
61        #[deprecated = "Use Product.products(for:)"]
62        #[unsafe(method(setDelegate:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn setDelegate(
65            &self,
66            delegate: Option<&ProtocolObject<dyn SKProductsRequestDelegate>>,
67        );
68    );
69}
70
71/// Methods declared on superclass `NSObject`.
72#[cfg(feature = "SKRequest")]
73impl SKProductsRequest {
74    extern_methods!(
75        #[unsafe(method(init))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
78
79        #[unsafe(method(new))]
80        #[unsafe(method_family = new)]
81        pub unsafe fn new() -> Retained<Self>;
82    );
83}
84
85extern_class!(
86    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skproductsresponse?language=objc)
87    #[unsafe(super(NSObject))]
88    #[derive(Debug, PartialEq, Eq, Hash)]
89    #[deprecated = "Get products using Product.products(for:)"]
90    pub struct SKProductsResponse;
91);
92
93unsafe impl Send for SKProductsResponse {}
94
95unsafe impl Sync for SKProductsResponse {}
96
97extern_conformance!(
98    unsafe impl NSObjectProtocol for SKProductsResponse {}
99);
100
101impl SKProductsResponse {
102    extern_methods!(
103        #[cfg(feature = "SKProduct")]
104        /// This property is not atomic.
105        ///
106        /// # Safety
107        ///
108        /// This might not be thread-safe.
109        #[deprecated = "Get products using Product.products(for:)"]
110        #[unsafe(method(products))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn products(&self) -> Retained<NSArray<SKProduct>>;
113
114        /// This property is not atomic.
115        ///
116        /// # Safety
117        ///
118        /// This might not be thread-safe.
119        #[deprecated = "Get products using Product.products(for:)"]
120        #[unsafe(method(invalidProductIdentifiers))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn invalidProductIdentifiers(&self) -> Retained<NSArray<NSString>>;
123    );
124}
125
126/// Methods declared on superclass `NSObject`.
127impl SKProductsResponse {
128    extern_methods!(
129        #[unsafe(method(init))]
130        #[unsafe(method_family = init)]
131        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
132
133        #[unsafe(method(new))]
134        #[unsafe(method_family = new)]
135        pub unsafe fn new() -> Retained<Self>;
136    );
137}