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::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skoverlaydelegate?language=objc)
    pub unsafe trait SKOverlayDelegate: NSObjectProtocol {
        #[optional]
        #[unsafe(method(storeOverlay:didFailToLoadWithError:))]
        #[unsafe(method_family = none)]
        unsafe fn storeOverlay_didFailToLoadWithError(&self, overlay: &SKOverlay, error: &NSError);

        #[cfg(feature = "SKOverlayTransitionContext")]
        #[optional]
        #[unsafe(method(storeOverlay:willStartPresentation:))]
        #[unsafe(method_family = none)]
        unsafe fn storeOverlay_willStartPresentation(
            &self,
            overlay: &SKOverlay,
            transition_context: &SKOverlayTransitionContext,
        );

        #[cfg(feature = "SKOverlayTransitionContext")]
        #[optional]
        #[unsafe(method(storeOverlay:didFinishPresentation:))]
        #[unsafe(method_family = none)]
        unsafe fn storeOverlay_didFinishPresentation(
            &self,
            overlay: &SKOverlay,
            transition_context: &SKOverlayTransitionContext,
        );

        #[cfg(feature = "SKOverlayTransitionContext")]
        #[optional]
        #[unsafe(method(storeOverlay:willStartDismissal:))]
        #[unsafe(method_family = none)]
        unsafe fn storeOverlay_willStartDismissal(
            &self,
            overlay: &SKOverlay,
            transition_context: &SKOverlayTransitionContext,
        );

        #[cfg(feature = "SKOverlayTransitionContext")]
        #[optional]
        #[unsafe(method(storeOverlay:didFinishDismissal:))]
        #[unsafe(method_family = none)]
        unsafe fn storeOverlay_didFinishDismissal(
            &self,
            overlay: &SKOverlay,
            transition_context: &SKOverlayTransitionContext,
        );
    }
);

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skoverlay?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct SKOverlay;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for SKOverlay {}
);

impl SKOverlay {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[cfg(feature = "SKOverlayConfiguration")]
        /// Creates an overlay with the provided configuration.
        ///
        /// Parameter `configuration`: the configuration for the overlay.
        #[unsafe(method(initWithConfiguration:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithConfiguration(
            this: Allocated<Self>,
            configuration: &SKOverlayConfiguration,
        ) -> Retained<Self>;

        /// A delegate for overlay events.
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn SKOverlayDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn SKOverlayDelegate>>);

        #[cfg(feature = "SKOverlayConfiguration")]
        /// The overlay configuration.
        #[unsafe(method(configuration))]
        #[unsafe(method_family = none)]
        pub unsafe fn configuration(&self) -> Retained<SKOverlayConfiguration>;
    );
}