objc2_store_kit/generated/
SKStoreProductViewController.rs1use 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
13extern_class!(
14 #[unsafe(super(NSViewController, NSResponder, NSObject))]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 #[cfg(feature = "objc2-app-kit")]
18 #[cfg(target_os = "macos")]
19 pub struct SKStoreProductViewController;
20);
21
22#[cfg(feature = "objc2-app-kit")]
23#[cfg(target_os = "macos")]
24unsafe impl NSCoding for SKStoreProductViewController {}
25
26#[cfg(feature = "objc2-app-kit")]
27#[cfg(target_os = "macos")]
28unsafe impl NSEditor for SKStoreProductViewController {}
29
30#[cfg(feature = "objc2-app-kit")]
31#[cfg(target_os = "macos")]
32unsafe impl NSObjectProtocol for SKStoreProductViewController {}
33
34#[cfg(feature = "objc2-app-kit")]
35#[cfg(target_os = "macos")]
36unsafe impl NSSeguePerforming for SKStoreProductViewController {}
37
38#[cfg(feature = "objc2-app-kit")]
39#[cfg(target_os = "macos")]
40unsafe impl NSUserInterfaceItemIdentification for SKStoreProductViewController {}
41
42#[cfg(feature = "objc2-app-kit")]
43#[cfg(target_os = "macos")]
44impl SKStoreProductViewController {
45 extern_methods!(
46 #[unsafe(method(delegate))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn delegate(
49 &self,
50 ) -> Option<Retained<ProtocolObject<dyn SKStoreProductViewControllerDelegate>>>;
51
52 #[unsafe(method(setDelegate:))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn setDelegate(
57 &self,
58 delegate: Option<&ProtocolObject<dyn SKStoreProductViewControllerDelegate>>,
59 );
60
61 #[cfg(feature = "block2")]
62 #[unsafe(method(loadProductWithParameters:completionBlock:))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn loadProductWithParameters_completionBlock(
65 &self,
66 parameters: &NSDictionary<NSString, AnyObject>,
67 block: Option<&block2::Block<dyn Fn(Bool, *mut NSError)>>,
68 );
69
70 #[cfg(all(feature = "SKAdImpression", feature = "block2"))]
71 #[unsafe(method(loadProductWithParameters:impression:completionBlock:))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn loadProductWithParameters_impression_completionBlock(
74 &self,
75 parameters: &NSDictionary<NSString, AnyObject>,
76 impression: &SKAdImpression,
77 block: Option<&block2::Block<dyn Fn(Bool, *mut NSError)>>,
78 );
79 );
80}
81
82#[cfg(feature = "objc2-app-kit")]
84#[cfg(target_os = "macos")]
85impl SKStoreProductViewController {
86 extern_methods!(
87 #[unsafe(method(initWithNibName:bundle:))]
88 #[unsafe(method_family = init)]
89 pub unsafe fn initWithNibName_bundle(
90 this: Allocated<Self>,
91 nib_name_or_nil: Option<&NSNibName>,
92 nib_bundle_or_nil: Option<&NSBundle>,
93 ) -> Retained<Self>;
94
95 #[unsafe(method(initWithCoder:))]
96 #[unsafe(method_family = init)]
97 pub unsafe fn initWithCoder(
98 this: Allocated<Self>,
99 coder: &NSCoder,
100 ) -> Option<Retained<Self>>;
101 );
102}
103
104#[cfg(feature = "objc2-app-kit")]
106#[cfg(target_os = "macos")]
107impl SKStoreProductViewController {
108 extern_methods!(
109 #[unsafe(method(init))]
110 #[unsafe(method_family = init)]
111 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
112 );
113}
114
115#[cfg(feature = "objc2-app-kit")]
117#[cfg(target_os = "macos")]
118impl SKStoreProductViewController {
119 extern_methods!(
120 #[unsafe(method(new))]
121 #[unsafe(method_family = new)]
122 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
123 );
124}
125
126extern_protocol!(
127 pub unsafe trait SKStoreProductViewControllerDelegate: NSObjectProtocol {
129 #[cfg(feature = "objc2-app-kit")]
130 #[cfg(target_os = "macos")]
131 #[optional]
132 #[unsafe(method(productViewControllerDidFinish:))]
133 #[unsafe(method_family = none)]
134 unsafe fn productViewControllerDidFinish(
135 &self,
136 view_controller: &SKStoreProductViewController,
137 );
138 }
139);
140
141extern "C" {
142 pub static SKStoreProductParameterITunesItemIdentifier: &'static NSString;
144}
145
146extern "C" {
147 pub static SKStoreProductParameterProductIdentifier: &'static NSString;
149}
150
151extern "C" {
152 pub static SKStoreProductParameterCustomProductPageIdentifier: &'static NSString;
154}
155
156extern "C" {
157 pub static SKStoreProductParameterAffiliateToken: &'static NSString;
159}
160
161extern "C" {
162 pub static SKStoreProductParameterCampaignToken: &'static NSString;
164}
165
166extern "C" {
167 pub static SKStoreProductParameterProviderToken: &'static NSString;
169}
170
171extern "C" {
172 pub static SKStoreProductParameterAdvertisingPartnerToken: &'static NSString;
174}