objc2_store_kit/generated/
SKOverlayConfiguration.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
10/// [Apple's documentation](https://developer.apple.com/documentation/storekit/skoverlayposition?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct SKOverlayPosition(pub NSInteger);
15impl SKOverlayPosition {
16    #[doc(alias = "SKOverlayPositionBottom")]
17    pub const Bottom: Self = Self(0);
18    #[doc(alias = "SKOverlayPositionBottomRaised")]
19    pub const BottomRaised: Self = Self(1);
20}
21
22unsafe impl Encode for SKOverlayPosition {
23    const ENCODING: Encoding = NSInteger::ENCODING;
24}
25
26unsafe impl RefEncode for SKOverlayPosition {
27    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
28}
29
30extern_class!(
31    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skoverlayconfiguration?language=objc)
32    #[unsafe(super(NSObject))]
33    #[derive(Debug, PartialEq, Eq, Hash)]
34    pub struct SKOverlayConfiguration;
35);
36
37unsafe impl NSObjectProtocol for SKOverlayConfiguration {}
38
39impl SKOverlayConfiguration {
40    extern_methods!(
41        #[unsafe(method(init))]
42        #[unsafe(method_family = init)]
43        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
44
45        #[unsafe(method(new))]
46        #[unsafe(method_family = new)]
47        pub unsafe fn new() -> Retained<Self>;
48    );
49}
50
51extern_class!(
52    /// An overlay configuration that can be used to show any app from the App Store.
53    ///
54    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skoverlayappconfiguration?language=objc)
55    #[unsafe(super(SKOverlayConfiguration, NSObject))]
56    #[derive(Debug, PartialEq, Eq, Hash)]
57    pub struct SKOverlayAppConfiguration;
58);
59
60unsafe impl NSObjectProtocol for SKOverlayAppConfiguration {}
61
62impl SKOverlayAppConfiguration {
63    extern_methods!(
64        #[unsafe(method(init))]
65        #[unsafe(method_family = init)]
66        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
67
68        #[unsafe(method(new))]
69        #[unsafe(method_family = new)]
70        pub unsafe fn new() -> Retained<Self>;
71
72        /// Creates a new app overlay configuration that will show an app from the App Store.
73        ///
74        /// Parameter `appIdentifier`: the app identifier of the app to show.
75        ///
76        /// Parameter `position`: the desired position of the overlay.
77        #[unsafe(method(initWithAppIdentifier:position:))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn initWithAppIdentifier_position(
80            this: Allocated<Self>,
81            app_identifier: &NSString,
82            position: SKOverlayPosition,
83        ) -> Retained<Self>;
84
85        /// The identifier of the app that will be shown.
86        #[unsafe(method(appIdentifier))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn appIdentifier(&self) -> Retained<NSString>;
89
90        /// Setter for [`appIdentifier`][Self::appIdentifier].
91        #[unsafe(method(setAppIdentifier:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn setAppIdentifier(&self, app_identifier: &NSString);
94
95        /// A token representing an App Analytics campaign.
96        #[unsafe(method(campaignToken))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn campaignToken(&self) -> Option<Retained<NSString>>;
99
100        /// Setter for [`campaignToken`][Self::campaignToken].
101        #[unsafe(method(setCampaignToken:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn setCampaignToken(&self, campaign_token: Option<&NSString>);
104
105        /// The provider token for the developer that created the app being presented.
106        #[unsafe(method(providerToken))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn providerToken(&self) -> Option<Retained<NSString>>;
109
110        /// Setter for [`providerToken`][Self::providerToken].
111        #[unsafe(method(setProviderToken:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn setProviderToken(&self, provider_token: Option<&NSString>);
114
115        /// An optional identifier for an app's custom product page.
116        #[unsafe(method(customProductPageIdentifier))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn customProductPageIdentifier(&self) -> Option<Retained<NSString>>;
119
120        /// Setter for [`customProductPageIdentifier`][Self::customProductPageIdentifier].
121        #[unsafe(method(setCustomProductPageIdentifier:))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn setCustomProductPageIdentifier(
124            &self,
125            custom_product_page_identifier: Option<&NSString>,
126        );
127
128        /// An optional extra parameter for specifying the version of your app that will be shown to the user.
129        #[unsafe(method(latestReleaseID))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn latestReleaseID(&self) -> Option<Retained<NSString>>;
132
133        /// Setter for [`latestReleaseID`][Self::latestReleaseID].
134        #[unsafe(method(setLatestReleaseID:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn setLatestReleaseID(&self, latest_release_id: Option<&NSString>);
137
138        /// The position an overlay will show at on screen.
139        #[unsafe(method(position))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn position(&self) -> SKOverlayPosition;
142
143        /// Setter for [`position`][Self::position].
144        #[unsafe(method(setPosition:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn setPosition(&self, position: SKOverlayPosition);
147
148        /// Allows the user to interactively dismiss an overlay.
149        #[unsafe(method(userDismissible))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn userDismissible(&self) -> bool;
152
153        /// Setter for [`userDismissible`][Self::userDismissible].
154        #[unsafe(method(setUserDismissible:))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn setUserDismissible(&self, user_dismissible: bool);
157
158        #[unsafe(method(setAdditionalValue:forKey:))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn setAdditionalValue_forKey(&self, value: Option<&AnyObject>, key: &NSString);
161
162        #[must_use]
163        #[unsafe(method(additionalValueForKey:))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn additionalValueForKey(&self, key: &NSString) -> Option<Retained<AnyObject>>;
166
167        #[cfg(feature = "SKAdImpression")]
168        #[unsafe(method(setAdImpression:))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn setAdImpression(&self, impression: &SKAdImpression);
171    );
172}
173
174extern_class!(
175    /// An overlay configuration that can be used to show an app clip's full app.
176    ///
177    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skoverlayappclipconfiguration?language=objc)
178    #[unsafe(super(SKOverlayConfiguration, NSObject))]
179    #[derive(Debug, PartialEq, Eq, Hash)]
180    pub struct SKOverlayAppClipConfiguration;
181);
182
183unsafe impl NSObjectProtocol for SKOverlayAppClipConfiguration {}
184
185impl SKOverlayAppClipConfiguration {
186    extern_methods!(
187        #[unsafe(method(init))]
188        #[unsafe(method_family = init)]
189        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
190
191        #[unsafe(method(new))]
192        #[unsafe(method_family = new)]
193        pub unsafe fn new() -> Retained<Self>;
194
195        /// Creates a new app overlay configuration that will show an app clip's full app.
196        ///
197        /// Parameter `position`: the desired position of the overlay.
198        #[unsafe(method(initWithPosition:))]
199        #[unsafe(method_family = init)]
200        pub unsafe fn initWithPosition(
201            this: Allocated<Self>,
202            position: SKOverlayPosition,
203        ) -> Retained<Self>;
204
205        /// A token representing an App Analytics campaign.
206        #[unsafe(method(campaignToken))]
207        #[unsafe(method_family = none)]
208        pub unsafe fn campaignToken(&self) -> Option<Retained<NSString>>;
209
210        /// Setter for [`campaignToken`][Self::campaignToken].
211        #[unsafe(method(setCampaignToken:))]
212        #[unsafe(method_family = none)]
213        pub unsafe fn setCampaignToken(&self, campaign_token: Option<&NSString>);
214
215        /// The provider token for the developer that created the app being presented.
216        #[unsafe(method(providerToken))]
217        #[unsafe(method_family = none)]
218        pub unsafe fn providerToken(&self) -> Option<Retained<NSString>>;
219
220        /// Setter for [`providerToken`][Self::providerToken].
221        #[unsafe(method(setProviderToken:))]
222        #[unsafe(method_family = none)]
223        pub unsafe fn setProviderToken(&self, provider_token: Option<&NSString>);
224
225        /// An optional identifier for a parent app's custom product page.
226        #[unsafe(method(customProductPageIdentifier))]
227        #[unsafe(method_family = none)]
228        pub unsafe fn customProductPageIdentifier(&self) -> Option<Retained<NSString>>;
229
230        /// Setter for [`customProductPageIdentifier`][Self::customProductPageIdentifier].
231        #[unsafe(method(setCustomProductPageIdentifier:))]
232        #[unsafe(method_family = none)]
233        pub unsafe fn setCustomProductPageIdentifier(
234            &self,
235            custom_product_page_identifier: Option<&NSString>,
236        );
237
238        /// An optional extra parameter for specifying the version of your app that will be shown to the user.
239        #[unsafe(method(latestReleaseID))]
240        #[unsafe(method_family = none)]
241        pub unsafe fn latestReleaseID(&self) -> Option<Retained<NSString>>;
242
243        /// Setter for [`latestReleaseID`][Self::latestReleaseID].
244        #[unsafe(method(setLatestReleaseID:))]
245        #[unsafe(method_family = none)]
246        pub unsafe fn setLatestReleaseID(&self, latest_release_id: Option<&NSString>);
247
248        /// The position an overlay will show at on screen.
249        #[unsafe(method(position))]
250        #[unsafe(method_family = none)]
251        pub unsafe fn position(&self) -> SKOverlayPosition;
252
253        /// Setter for [`position`][Self::position].
254        #[unsafe(method(setPosition:))]
255        #[unsafe(method_family = none)]
256        pub unsafe fn setPosition(&self, position: SKOverlayPosition);
257
258        #[unsafe(method(setAdditionalValue:forKey:))]
259        #[unsafe(method_family = none)]
260        pub unsafe fn setAdditionalValue_forKey(&self, value: Option<&AnyObject>, key: &NSString);
261
262        #[must_use]
263        #[unsafe(method(additionalValueForKey:))]
264        #[unsafe(method_family = none)]
265        pub unsafe fn additionalValueForKey(&self, key: &NSString) -> Option<Retained<AnyObject>>;
266    );
267}