objc2_store_kit/generated/
SKOverlay.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
10extern_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skoverlaydelegate?language=objc)
12    pub unsafe trait SKOverlayDelegate: NSObjectProtocol {
13        #[optional]
14        #[unsafe(method(storeOverlay:didFailToLoadWithError:))]
15        #[unsafe(method_family = none)]
16        unsafe fn storeOverlay_didFailToLoadWithError(&self, overlay: &SKOverlay, error: &NSError);
17
18        #[cfg(feature = "SKOverlayTransitionContext")]
19        #[optional]
20        #[unsafe(method(storeOverlay:willStartPresentation:))]
21        #[unsafe(method_family = none)]
22        unsafe fn storeOverlay_willStartPresentation(
23            &self,
24            overlay: &SKOverlay,
25            transition_context: &SKOverlayTransitionContext,
26        );
27
28        #[cfg(feature = "SKOverlayTransitionContext")]
29        #[optional]
30        #[unsafe(method(storeOverlay:didFinishPresentation:))]
31        #[unsafe(method_family = none)]
32        unsafe fn storeOverlay_didFinishPresentation(
33            &self,
34            overlay: &SKOverlay,
35            transition_context: &SKOverlayTransitionContext,
36        );
37
38        #[cfg(feature = "SKOverlayTransitionContext")]
39        #[optional]
40        #[unsafe(method(storeOverlay:willStartDismissal:))]
41        #[unsafe(method_family = none)]
42        unsafe fn storeOverlay_willStartDismissal(
43            &self,
44            overlay: &SKOverlay,
45            transition_context: &SKOverlayTransitionContext,
46        );
47
48        #[cfg(feature = "SKOverlayTransitionContext")]
49        #[optional]
50        #[unsafe(method(storeOverlay:didFinishDismissal:))]
51        #[unsafe(method_family = none)]
52        unsafe fn storeOverlay_didFinishDismissal(
53            &self,
54            overlay: &SKOverlay,
55            transition_context: &SKOverlayTransitionContext,
56        );
57    }
58);
59
60extern_class!(
61    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skoverlay?language=objc)
62    #[unsafe(super(NSObject))]
63    #[derive(Debug, PartialEq, Eq, Hash)]
64    pub struct SKOverlay;
65);
66
67extern_conformance!(
68    unsafe impl NSObjectProtocol for SKOverlay {}
69);
70
71impl SKOverlay {
72    extern_methods!(
73        #[unsafe(method(init))]
74        #[unsafe(method_family = init)]
75        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
76
77        #[unsafe(method(new))]
78        #[unsafe(method_family = new)]
79        pub unsafe fn new() -> Retained<Self>;
80
81        #[cfg(feature = "SKOverlayConfiguration")]
82        /// Creates an overlay with the provided configuration.
83        ///
84        /// Parameter `configuration`: the configuration for the overlay.
85        #[unsafe(method(initWithConfiguration:))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn initWithConfiguration(
88            this: Allocated<Self>,
89            configuration: &SKOverlayConfiguration,
90        ) -> Retained<Self>;
91
92        /// A delegate for overlay events.
93        #[unsafe(method(delegate))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn SKOverlayDelegate>>>;
96
97        /// Setter for [`delegate`][Self::delegate].
98        ///
99        /// This is a [weak property][objc2::topics::weak_property].
100        #[unsafe(method(setDelegate:))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn SKOverlayDelegate>>);
103
104        #[cfg(feature = "SKOverlayConfiguration")]
105        /// The overlay configuration.
106        #[unsafe(method(configuration))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn configuration(&self) -> Retained<SKOverlayConfiguration>;
109    );
110}