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")]
24extern_conformance!(
25 unsafe impl NSCoding for SKStoreProductViewController {}
26);
27
28#[cfg(feature = "objc2-app-kit")]
29#[cfg(target_os = "macos")]
30extern_conformance!(
31 unsafe impl NSEditor for SKStoreProductViewController {}
32);
33
34#[cfg(feature = "objc2-app-kit")]
35#[cfg(target_os = "macos")]
36extern_conformance!(
37 unsafe impl NSObjectProtocol for SKStoreProductViewController {}
38);
39
40#[cfg(feature = "objc2-app-kit")]
41#[cfg(target_os = "macos")]
42extern_conformance!(
43 unsafe impl NSSeguePerforming for SKStoreProductViewController {}
44);
45
46#[cfg(feature = "objc2-app-kit")]
47#[cfg(target_os = "macos")]
48extern_conformance!(
49 unsafe impl NSUserInterfaceItemIdentification for SKStoreProductViewController {}
50);
51
52#[cfg(feature = "objc2-app-kit")]
53#[cfg(target_os = "macos")]
54impl SKStoreProductViewController {
55 extern_methods!(
56 #[unsafe(method(delegate))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn delegate(
59 &self,
60 ) -> Option<Retained<ProtocolObject<dyn SKStoreProductViewControllerDelegate>>>;
61
62 #[unsafe(method(setDelegate:))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn setDelegate(
68 &self,
69 delegate: Option<&ProtocolObject<dyn SKStoreProductViewControllerDelegate>>,
70 );
71
72 #[cfg(feature = "block2")]
73 #[unsafe(method(loadProductWithParameters:completionBlock:))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn loadProductWithParameters_completionBlock(
79 &self,
80 parameters: &NSDictionary<NSString, AnyObject>,
81 block: Option<&block2::DynBlock<dyn Fn(Bool, *mut NSError)>>,
82 );
83
84 #[cfg(all(feature = "SKAdImpression", feature = "block2"))]
85 #[unsafe(method(loadProductWithParameters:impression:completionBlock:))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn loadProductWithParameters_impression_completionBlock(
91 &self,
92 parameters: &NSDictionary<NSString, AnyObject>,
93 impression: &SKAdImpression,
94 block: Option<&block2::DynBlock<dyn Fn(Bool, *mut NSError)>>,
95 );
96 );
97}
98
99#[cfg(feature = "objc2-app-kit")]
101#[cfg(target_os = "macos")]
102impl SKStoreProductViewController {
103 extern_methods!(
104 #[unsafe(method(initWithNibName:bundle:))]
105 #[unsafe(method_family = init)]
106 pub unsafe fn initWithNibName_bundle(
107 this: Allocated<Self>,
108 nib_name_or_nil: Option<&NSNibName>,
109 nib_bundle_or_nil: Option<&NSBundle>,
110 ) -> Retained<Self>;
111
112 #[unsafe(method(initWithCoder:))]
116 #[unsafe(method_family = init)]
117 pub unsafe fn initWithCoder(
118 this: Allocated<Self>,
119 coder: &NSCoder,
120 ) -> Option<Retained<Self>>;
121 );
122}
123
124#[cfg(feature = "objc2-app-kit")]
126#[cfg(target_os = "macos")]
127impl SKStoreProductViewController {
128 extern_methods!(
129 #[unsafe(method(init))]
130 #[unsafe(method_family = init)]
131 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
132 );
133}
134
135#[cfg(feature = "objc2-app-kit")]
137#[cfg(target_os = "macos")]
138impl SKStoreProductViewController {
139 extern_methods!(
140 #[unsafe(method(new))]
141 #[unsafe(method_family = new)]
142 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
143 );
144}
145
146extern_protocol!(
147 pub unsafe trait SKStoreProductViewControllerDelegate: NSObjectProtocol {
149 #[cfg(feature = "objc2-app-kit")]
150 #[cfg(target_os = "macos")]
151 #[optional]
152 #[unsafe(method(productViewControllerDidFinish:))]
153 #[unsafe(method_family = none)]
154 unsafe fn productViewControllerDidFinish(
155 &self,
156 view_controller: &SKStoreProductViewController,
157 );
158 }
159);
160
161extern "C" {
162 pub static SKStoreProductParameterITunesItemIdentifier: &'static NSString;
164}
165
166extern "C" {
167 pub static SKStoreProductParameterProductIdentifier: &'static NSString;
169}
170
171extern "C" {
172 pub static SKStoreProductParameterCustomProductPageIdentifier: &'static NSString;
174}
175
176extern "C" {
177 pub static SKStoreProductParameterAffiliateToken: &'static NSString;
179}
180
181extern "C" {
182 pub static SKStoreProductParameterCampaignToken: &'static NSString;
184}
185
186extern "C" {
187 pub static SKStoreProductParameterProviderToken: &'static NSString;
189}
190
191extern "C" {
192 pub static SKStoreProductParameterAdvertisingPartnerToken: &'static NSString;
194}