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