objc2_store_kit/generated/
SKCloudServiceSetupViewController.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::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13/// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionskey?language=objc)
14// NS_TYPED_ENUM
15pub type SKCloudServiceSetupOptionsKey = NSString;
16
17/// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupaction?language=objc)
18// NS_TYPED_ENUM
19pub type SKCloudServiceSetupAction = NSString;
20
21/// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifier?language=objc)
22// NS_TYPED_ENUM
23pub type SKCloudServiceSetupMessageIdentifier = NSString;
24
25extern_class!(
26    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupviewcontroller?language=objc)
27    #[unsafe(super(NSViewController, NSResponder, NSObject))]
28    #[derive(Debug, PartialEq, Eq, Hash)]
29    #[cfg(feature = "objc2-app-kit")]
30    #[cfg(target_os = "macos")]
31    #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
32    pub struct SKCloudServiceSetupViewController;
33);
34
35#[cfg(feature = "objc2-app-kit")]
36#[cfg(target_os = "macos")]
37extern_conformance!(
38    unsafe impl NSCoding for SKCloudServiceSetupViewController {}
39);
40
41#[cfg(feature = "objc2-app-kit")]
42#[cfg(target_os = "macos")]
43extern_conformance!(
44    unsafe impl NSEditor for SKCloudServiceSetupViewController {}
45);
46
47#[cfg(feature = "objc2-app-kit")]
48#[cfg(target_os = "macos")]
49extern_conformance!(
50    unsafe impl NSObjectProtocol for SKCloudServiceSetupViewController {}
51);
52
53#[cfg(feature = "objc2-app-kit")]
54#[cfg(target_os = "macos")]
55extern_conformance!(
56    unsafe impl NSSeguePerforming for SKCloudServiceSetupViewController {}
57);
58
59#[cfg(feature = "objc2-app-kit")]
60#[cfg(target_os = "macos")]
61extern_conformance!(
62    unsafe impl NSUserInterfaceItemIdentification for SKCloudServiceSetupViewController {}
63);
64
65#[cfg(feature = "objc2-app-kit")]
66#[cfg(target_os = "macos")]
67impl SKCloudServiceSetupViewController {
68    extern_methods!(
69        /// Optional delegate.
70        #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
71        #[unsafe(method(delegate))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn delegate(
74            &self,
75        ) -> Option<Retained<ProtocolObject<dyn SKCloudServiceSetupViewControllerDelegate>>>;
76
77        /// Setter for [`delegate`][Self::delegate].
78        ///
79        /// This is a [weak property][objc2::topics::weak_property].
80        #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
81        #[unsafe(method(setDelegate:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn setDelegate(
84            &self,
85            delegate: Option<&ProtocolObject<dyn SKCloudServiceSetupViewControllerDelegate>>,
86        );
87
88        #[cfg(feature = "block2")]
89        /// Load cloud service setup view with the given options.
90        /// Block is invoked on the main thread when the load finishes.
91        ///
92        /// # Safety
93        ///
94        /// `options` generic should be of the correct type.
95        #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
96        #[unsafe(method(loadWithOptions:completionHandler:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn loadWithOptions_completionHandler(
99            &self,
100            options: &NSDictionary<SKCloudServiceSetupOptionsKey, AnyObject>,
101            completion_handler: Option<&block2::DynBlock<dyn Fn(Bool, *mut NSError)>>,
102        );
103    );
104}
105
106/// Methods declared on superclass `NSViewController`.
107#[cfg(feature = "objc2-app-kit")]
108#[cfg(target_os = "macos")]
109impl SKCloudServiceSetupViewController {
110    extern_methods!(
111        #[unsafe(method(initWithNibName:bundle:))]
112        #[unsafe(method_family = init)]
113        pub unsafe fn initWithNibName_bundle(
114            this: Allocated<Self>,
115            nib_name_or_nil: Option<&NSNibName>,
116            nib_bundle_or_nil: Option<&NSBundle>,
117        ) -> Retained<Self>;
118
119        /// # Safety
120        ///
121        /// `coder` possibly has further requirements.
122        #[unsafe(method(initWithCoder:))]
123        #[unsafe(method_family = init)]
124        pub unsafe fn initWithCoder(
125            this: Allocated<Self>,
126            coder: &NSCoder,
127        ) -> Option<Retained<Self>>;
128    );
129}
130
131/// Methods declared on superclass `NSResponder`.
132#[cfg(feature = "objc2-app-kit")]
133#[cfg(target_os = "macos")]
134impl SKCloudServiceSetupViewController {
135    extern_methods!(
136        #[unsafe(method(init))]
137        #[unsafe(method_family = init)]
138        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
139    );
140}
141
142/// Methods declared on superclass `NSObject`.
143#[cfg(feature = "objc2-app-kit")]
144#[cfg(target_os = "macos")]
145impl SKCloudServiceSetupViewController {
146    extern_methods!(
147        #[unsafe(method(new))]
148        #[unsafe(method_family = new)]
149        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
150    );
151}
152
153extern_protocol!(
154    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupviewcontrollerdelegate?language=objc)
155    #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
156    pub unsafe trait SKCloudServiceSetupViewControllerDelegate: NSObjectProtocol {
157        #[cfg(feature = "objc2-app-kit")]
158        #[cfg(target_os = "macos")]
159        /// Sent when the view controller was dismissed.
160        #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
161        #[optional]
162        #[unsafe(method(cloudServiceSetupViewControllerDidDismiss:))]
163        #[unsafe(method_family = none)]
164        unsafe fn cloudServiceSetupViewControllerDidDismiss(
165            &self,
166            cloud_service_setup_view_controller: &SKCloudServiceSetupViewController,
167        );
168    }
169);
170
171extern "C" {
172    /// Action for setup entry point (of type SKCloudServiceSetupAction).
173    ///
174    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionsactionkey?language=objc)
175    #[deprecated = "Use the action property of MusicSubscriptionOffer.Options from MusicKit"]
176    pub static SKCloudServiceSetupOptionsActionKey: &'static SKCloudServiceSetupOptionsKey;
177}
178
179extern "C" {
180    /// Identifier of the iTunes Store item the user is trying to access which requires cloud service setup (NSNumber).
181    ///
182    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionsitunesitemidentifierkey?language=objc)
183    #[deprecated = "Use the itemID property of MusicSubscriptionOffer.Options from MusicKit"]
184    pub static SKCloudServiceSetupOptionsITunesItemIdentifierKey:
185        &'static SKCloudServiceSetupOptionsKey;
186}
187
188extern "C" {
189    /// iTunes Store affiliate token (NSString).
190    ///
191    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionsaffiliatetokenkey?language=objc)
192    #[deprecated = "Use the affiliateToken property of MusicSubscriptionOffer.Options from MusicKit"]
193    pub static SKCloudServiceSetupOptionsAffiliateTokenKey: &'static SKCloudServiceSetupOptionsKey;
194}
195
196extern "C" {
197    /// iTunes Store affiliate campaign token (NSString).
198    ///
199    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionscampaigntokenkey?language=objc)
200    #[deprecated = "Use the campaignToken property of MusicSubscriptionOffer.Options from MusicKit"]
201    pub static SKCloudServiceSetupOptionsCampaignTokenKey: &'static SKCloudServiceSetupOptionsKey;
202}
203
204extern "C" {
205    /// Identifier used to select the main message presented to the user for this setup view (SKCloudServiceSetupMessageIdentifier).
206    /// When missing, the setup view will be configured in a way that is equivalent to using SKCloudServiceSetupMessageIdentifierJoin.
207    ///
208    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionsmessageidentifierkey?language=objc)
209    #[deprecated = "Use the messageIdentifier property of MusicSubscriptionOffer.Options from MusicKit"]
210    pub static SKCloudServiceSetupOptionsMessageIdentifierKey:
211        &'static SKCloudServiceSetupOptionsKey;
212}
213
214extern "C" {
215    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupactionsubscribe?language=objc)
216    #[deprecated = "Use MusicSubscriptionOffer.Action.subscribe from MusicKit"]
217    pub static SKCloudServiceSetupActionSubscribe: &'static SKCloudServiceSetupAction;
218}
219
220extern "C" {
221    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifierjoin?language=objc)
222    #[deprecated = "Use MusicSubscriptionOffer.MessageIdentifier.join from MusicKit"]
223    pub static SKCloudServiceSetupMessageIdentifierJoin:
224        &'static SKCloudServiceSetupMessageIdentifier;
225}
226
227extern "C" {
228    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifierconnect?language=objc)
229    #[deprecated = "No longer supported"]
230    pub static SKCloudServiceSetupMessageIdentifierConnect:
231        &'static SKCloudServiceSetupMessageIdentifier;
232}
233
234extern "C" {
235    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifieraddmusic?language=objc)
236    #[deprecated = "Use MusicSubscriptionOffer.MessageIdentifier.addMusic from MusicKit"]
237    pub static SKCloudServiceSetupMessageIdentifierAddMusic:
238        &'static SKCloudServiceSetupMessageIdentifier;
239}
240
241extern "C" {
242    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifierplaymusic?language=objc)
243    #[deprecated = "Use MusicSubscriptionOffer.MessageIdentifier.playMusic from MusicKit"]
244    pub static SKCloudServiceSetupMessageIdentifierPlayMusic:
245        &'static SKCloudServiceSetupMessageIdentifier;
246}