objc2-store-kit 0.3.2

Bindings to the StoreKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionskey?language=objc)
// NS_TYPED_ENUM
pub type SKCloudServiceSetupOptionsKey = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupaction?language=objc)
// NS_TYPED_ENUM
pub type SKCloudServiceSetupAction = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifier?language=objc)
// NS_TYPED_ENUM
pub type SKCloudServiceSetupMessageIdentifier = NSString;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupviewcontroller?language=objc)
    #[unsafe(super(NSViewController, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "objc2-app-kit")]
    #[cfg(target_os = "macos")]
    #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
    pub struct SKCloudServiceSetupViewController;
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSCoding for SKCloudServiceSetupViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSEditor for SKCloudServiceSetupViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSObjectProtocol for SKCloudServiceSetupViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSSeguePerforming for SKCloudServiceSetupViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for SKCloudServiceSetupViewController {}
);

#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SKCloudServiceSetupViewController {
    extern_methods!(
        /// Optional delegate.
        #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn SKCloudServiceSetupViewControllerDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn SKCloudServiceSetupViewControllerDelegate>>,
        );

        #[cfg(feature = "block2")]
        /// Load cloud service setup view with the given options.
        /// Block is invoked on the main thread when the load finishes.
        ///
        /// # Safety
        ///
        /// `options` generic should be of the correct type.
        #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
        #[unsafe(method(loadWithOptions:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn loadWithOptions_completionHandler(
            &self,
            options: &NSDictionary<SKCloudServiceSetupOptionsKey, AnyObject>,
            completion_handler: Option<&block2::DynBlock<dyn Fn(Bool, *mut NSError)>>,
        );
    );
}

/// Methods declared on superclass `NSViewController`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SKCloudServiceSetupViewController {
    extern_methods!(
        #[unsafe(method(initWithNibName:bundle:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithNibName_bundle(
            this: Allocated<Self>,
            nib_name_or_nil: Option<&NSNibName>,
            nib_bundle_or_nil: Option<&NSBundle>,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    );
}

/// Methods declared on superclass `NSResponder`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SKCloudServiceSetupViewController {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SKCloudServiceSetupViewController {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupviewcontrollerdelegate?language=objc)
    #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
    pub unsafe trait SKCloudServiceSetupViewControllerDelegate: NSObjectProtocol {
        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        /// Sent when the view controller was dismissed.
        #[deprecated = "Use the musicSubscriptionOffer(isPresented:options:onLoadCompletion:) SwiftUI View Modifier from MusicKit"]
        #[optional]
        #[unsafe(method(cloudServiceSetupViewControllerDidDismiss:))]
        #[unsafe(method_family = none)]
        unsafe fn cloudServiceSetupViewControllerDidDismiss(
            &self,
            cloud_service_setup_view_controller: &SKCloudServiceSetupViewController,
        );
    }
);

extern "C" {
    /// Action for setup entry point (of type SKCloudServiceSetupAction).
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionsactionkey?language=objc)
    #[deprecated = "Use the action property of MusicSubscriptionOffer.Options from MusicKit"]
    pub static SKCloudServiceSetupOptionsActionKey: &'static SKCloudServiceSetupOptionsKey;
}

extern "C" {
    /// Identifier of the iTunes Store item the user is trying to access which requires cloud service setup (NSNumber).
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionsitunesitemidentifierkey?language=objc)
    #[deprecated = "Use the itemID property of MusicSubscriptionOffer.Options from MusicKit"]
    pub static SKCloudServiceSetupOptionsITunesItemIdentifierKey:
        &'static SKCloudServiceSetupOptionsKey;
}

extern "C" {
    /// iTunes Store affiliate token (NSString).
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionsaffiliatetokenkey?language=objc)
    #[deprecated = "Use the affiliateToken property of MusicSubscriptionOffer.Options from MusicKit"]
    pub static SKCloudServiceSetupOptionsAffiliateTokenKey: &'static SKCloudServiceSetupOptionsKey;
}

extern "C" {
    /// iTunes Store affiliate campaign token (NSString).
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionscampaigntokenkey?language=objc)
    #[deprecated = "Use the campaignToken property of MusicSubscriptionOffer.Options from MusicKit"]
    pub static SKCloudServiceSetupOptionsCampaignTokenKey: &'static SKCloudServiceSetupOptionsKey;
}

extern "C" {
    /// Identifier used to select the main message presented to the user for this setup view (SKCloudServiceSetupMessageIdentifier).
    /// When missing, the setup view will be configured in a way that is equivalent to using SKCloudServiceSetupMessageIdentifierJoin.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupoptionsmessageidentifierkey?language=objc)
    #[deprecated = "Use the messageIdentifier property of MusicSubscriptionOffer.Options from MusicKit"]
    pub static SKCloudServiceSetupOptionsMessageIdentifierKey:
        &'static SKCloudServiceSetupOptionsKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupactionsubscribe?language=objc)
    #[deprecated = "Use MusicSubscriptionOffer.Action.subscribe from MusicKit"]
    pub static SKCloudServiceSetupActionSubscribe: &'static SKCloudServiceSetupAction;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifierjoin?language=objc)
    #[deprecated = "Use MusicSubscriptionOffer.MessageIdentifier.join from MusicKit"]
    pub static SKCloudServiceSetupMessageIdentifierJoin:
        &'static SKCloudServiceSetupMessageIdentifier;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifierconnect?language=objc)
    #[deprecated = "No longer supported"]
    pub static SKCloudServiceSetupMessageIdentifierConnect:
        &'static SKCloudServiceSetupMessageIdentifier;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifieraddmusic?language=objc)
    #[deprecated = "Use MusicSubscriptionOffer.MessageIdentifier.addMusic from MusicKit"]
    pub static SKCloudServiceSetupMessageIdentifierAddMusic:
        &'static SKCloudServiceSetupMessageIdentifier;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skcloudservicesetupmessageidentifierplaymusic?language=objc)
    #[deprecated = "Use MusicSubscriptionOffer.MessageIdentifier.playMusic from MusicKit"]
    pub static SKCloudServiceSetupMessageIdentifierPlayMusic:
        &'static SKCloudServiceSetupMessageIdentifier;
}