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")]
37unsafe impl NSCoding for SKCloudServiceSetupViewController {}
38
39#[cfg(feature = "objc2-app-kit")]
40#[cfg(target_os = "macos")]
41unsafe impl NSEditor for SKCloudServiceSetupViewController {}
42
43#[cfg(feature = "objc2-app-kit")]
44#[cfg(target_os = "macos")]
45unsafe impl NSObjectProtocol for SKCloudServiceSetupViewController {}
46
47#[cfg(feature = "objc2-app-kit")]
48#[cfg(target_os = "macos")]
49unsafe impl NSSeguePerforming for SKCloudServiceSetupViewController {}
50
51#[cfg(feature = "objc2-app-kit")]
52#[cfg(target_os = "macos")]
53unsafe impl NSUserInterfaceItemIdentification for SKCloudServiceSetupViewController {}
54
55#[cfg(feature = "objc2-app-kit")]
56#[cfg(target_os = "macos")]
57impl SKCloudServiceSetupViewController {
58    extern_methods!(
59        /// Optional delegate.
60        #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
61        #[unsafe(method(delegate))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn delegate(
64            &self,
65        ) -> Option<Retained<ProtocolObject<dyn SKCloudServiceSetupViewControllerDelegate>>>;
66
67        /// This is a [weak property][objc2::topics::weak_property].
68        /// Setter for [`delegate`][Self::delegate].
69        #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
70        #[unsafe(method(setDelegate:))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn setDelegate(
73            &self,
74            delegate: Option<&ProtocolObject<dyn SKCloudServiceSetupViewControllerDelegate>>,
75        );
76
77        #[cfg(feature = "block2")]
78        /// Load cloud service setup view with the given options.
79        /// Block is invoked on the main thread when the load finishes.
80        #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
81        #[unsafe(method(loadWithOptions:completionHandler:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn loadWithOptions_completionHandler(
84            &self,
85            options: &NSDictionary<SKCloudServiceSetupOptionsKey, AnyObject>,
86            completion_handler: Option<&block2::Block<dyn Fn(Bool, *mut NSError)>>,
87        );
88    );
89}
90
91/// Methods declared on superclass `NSViewController`.
92#[cfg(feature = "objc2-app-kit")]
93#[cfg(target_os = "macos")]
94impl SKCloudServiceSetupViewController {
95    extern_methods!(
96        #[unsafe(method(initWithNibName:bundle:))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn initWithNibName_bundle(
99            this: Allocated<Self>,
100            nib_name_or_nil: Option<&NSNibName>,
101            nib_bundle_or_nil: Option<&NSBundle>,
102        ) -> Retained<Self>;
103
104        #[unsafe(method(initWithCoder:))]
105        #[unsafe(method_family = init)]
106        pub unsafe fn initWithCoder(
107            this: Allocated<Self>,
108            coder: &NSCoder,
109        ) -> Option<Retained<Self>>;
110    );
111}
112
113/// Methods declared on superclass `NSResponder`.
114#[cfg(feature = "objc2-app-kit")]
115#[cfg(target_os = "macos")]
116impl SKCloudServiceSetupViewController {
117    extern_methods!(
118        #[unsafe(method(init))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
121    );
122}
123
124/// Methods declared on superclass `NSObject`.
125#[cfg(feature = "objc2-app-kit")]
126#[cfg(target_os = "macos")]
127impl SKCloudServiceSetupViewController {
128    extern_methods!(
129        #[unsafe(method(new))]
130        #[unsafe(method_family = new)]
131        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
132    );
133}
134
135extern_protocol!(
136    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupviewcontrollerdelegate?language=objc)
137    #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
138    pub unsafe trait SKCloudServiceSetupViewControllerDelegate: NSObjectProtocol {
139        #[cfg(feature = "objc2-app-kit")]
140        #[cfg(target_os = "macos")]
141        /// Sent when the view controller was dismissed.
142        #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
143        #[optional]
144        #[unsafe(method(cloudServiceSetupViewControllerDidDismiss:))]
145        #[unsafe(method_family = none)]
146        unsafe fn cloudServiceSetupViewControllerDidDismiss(
147            &self,
148            cloud_service_setup_view_controller: &SKCloudServiceSetupViewController,
149        );
150    }
151);
152
153extern "C" {
154    /// Action for setup entry point (of type SKCloudServiceSetupAction).
155    ///
156    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionsactionkey?language=objc)
157    pub static SKCloudServiceSetupOptionsActionKey: &'static SKCloudServiceSetupOptionsKey;
158}
159
160extern "C" {
161    /// Identifier of the iTunes Store item the user is trying to access which requires cloud service setup (NSNumber).
162    ///
163    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionsitunesitemidentifierkey?language=objc)
164    pub static SKCloudServiceSetupOptionsITunesItemIdentifierKey:
165        &'static SKCloudServiceSetupOptionsKey;
166}
167
168extern "C" {
169    /// iTunes Store affiliate token (NSString).
170    ///
171    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionsaffiliatetokenkey?language=objc)
172    pub static SKCloudServiceSetupOptionsAffiliateTokenKey: &'static SKCloudServiceSetupOptionsKey;
173}
174
175extern "C" {
176    /// iTunes Store affiliate campaign token (NSString).
177    ///
178    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionscampaigntokenkey?language=objc)
179    pub static SKCloudServiceSetupOptionsCampaignTokenKey: &'static SKCloudServiceSetupOptionsKey;
180}
181
182extern "C" {
183    /// Identifier used to select the main message presented to the user for this setup view (SKCloudServiceSetupMessageIdentifier).
184    /// When missing, the setup view will be configured in a way that is equivalent to using SKCloudServiceSetupMessageIdentifierJoin.
185    ///
186    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionsmessageidentifierkey?language=objc)
187    pub static SKCloudServiceSetupOptionsMessageIdentifierKey:
188        &'static SKCloudServiceSetupOptionsKey;
189}
190
191extern "C" {
192    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupactionsubscribe?language=objc)
193    pub static SKCloudServiceSetupActionSubscribe: &'static SKCloudServiceSetupAction;
194}
195
196extern "C" {
197    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifierjoin?language=objc)
198    pub static SKCloudServiceSetupMessageIdentifierJoin:
199        &'static SKCloudServiceSetupMessageIdentifier;
200}
201
202extern "C" {
203    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifierconnect?language=objc)
204    pub static SKCloudServiceSetupMessageIdentifierConnect:
205        &'static SKCloudServiceSetupMessageIdentifier;
206}
207
208extern "C" {
209    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifieraddmusic?language=objc)
210    pub static SKCloudServiceSetupMessageIdentifierAddMusic:
211        &'static SKCloudServiceSetupMessageIdentifier;
212}
213
214extern "C" {
215    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifierplaymusic?language=objc)
216    pub static SKCloudServiceSetupMessageIdentifierPlayMusic:
217        &'static SKCloudServiceSetupMessageIdentifier;
218}