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:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn setDelegate(
67 &self,
68 delegate: Option<&ProtocolObject<dyn SKStoreProductViewControllerDelegate>>,
69 );
70
71 #[cfg(feature = "block2")]
72 #[unsafe(method(loadProductWithParameters:completionBlock:))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn loadProductWithParameters_completionBlock(
75 &self,
76 parameters: &NSDictionary<NSString, AnyObject>,
77 block: Option<&block2::DynBlock<dyn Fn(Bool, *mut NSError)>>,
78 );
79
80 #[cfg(all(feature = "SKAdImpression", feature = "block2"))]
81 #[unsafe(method(loadProductWithParameters:impression:completionBlock:))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn loadProductWithParameters_impression_completionBlock(
84 &self,
85 parameters: &NSDictionary<NSString, AnyObject>,
86 impression: &SKAdImpression,
87 block: Option<&block2::DynBlock<dyn Fn(Bool, *mut NSError)>>,
88 );
89 );
90}
91
92#[cfg(feature = "objc2-app-kit")]
94#[cfg(target_os = "macos")]
95impl SKStoreProductViewController {
96 extern_methods!(
97 #[unsafe(method(initWithNibName:bundle:))]
98 #[unsafe(method_family = init)]
99 pub unsafe fn initWithNibName_bundle(
100 this: Allocated<Self>,
101 nib_name_or_nil: Option<&NSNibName>,
102 nib_bundle_or_nil: Option<&NSBundle>,
103 ) -> Retained<Self>;
104
105 #[unsafe(method(initWithCoder:))]
106 #[unsafe(method_family = init)]
107 pub unsafe fn initWithCoder(
108 this: Allocated<Self>,
109 coder: &NSCoder,
110 ) -> Option<Retained<Self>>;
111 );
112}
113
114#[cfg(feature = "objc2-app-kit")]
116#[cfg(target_os = "macos")]
117impl SKStoreProductViewController {
118 extern_methods!(
119 #[unsafe(method(init))]
120 #[unsafe(method_family = init)]
121 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
122 );
123}
124
125#[cfg(feature = "objc2-app-kit")]
127#[cfg(target_os = "macos")]
128impl SKStoreProductViewController {
129 extern_methods!(
130 #[unsafe(method(new))]
131 #[unsafe(method_family = new)]
132 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
133 );
134}
135
136extern_protocol!(
137 pub unsafe trait SKStoreProductViewControllerDelegate: NSObjectProtocol {
139 #[cfg(feature = "objc2-app-kit")]
140 #[cfg(target_os = "macos")]
141 #[optional]
142 #[unsafe(method(productViewControllerDidFinish:))]
143 #[unsafe(method_family = none)]
144 unsafe fn productViewControllerDidFinish(
145 &self,
146 view_controller: &SKStoreProductViewController,
147 );
148 }
149);
150
151extern "C" {
152 pub static SKStoreProductParameterITunesItemIdentifier: &'static NSString;
154}
155
156extern "C" {
157 pub static SKStoreProductParameterProductIdentifier: &'static NSString;
159}
160
161extern "C" {
162 pub static SKStoreProductParameterCustomProductPageIdentifier: &'static NSString;
164}
165
166extern "C" {
167 pub static SKStoreProductParameterAffiliateToken: &'static NSString;
169}
170
171extern "C" {
172 pub static SKStoreProductParameterCampaignToken: &'static NSString;
174}
175
176extern "C" {
177 pub static SKStoreProductParameterProviderToken: &'static NSString;
179}
180
181extern "C" {
182 pub static SKStoreProductParameterAdvertisingPartnerToken: &'static NSString;
184}