use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSViewController, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
pub struct SKStoreProductViewController;
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCoding for SKStoreProductViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSEditor for SKStoreProductViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSObjectProtocol for SKStoreProductViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSSeguePerforming for SKStoreProductViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for SKStoreProductViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SKStoreProductViewController {
extern_methods!(
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn SKStoreProductViewControllerDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn SKStoreProductViewControllerDelegate>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(loadProductWithParameters:completionBlock:))]
#[unsafe(method_family = none)]
pub unsafe fn loadProductWithParameters_completionBlock(
&self,
parameters: &NSDictionary<NSString, AnyObject>,
block: Option<&block2::DynBlock<dyn Fn(Bool, *mut NSError)>>,
);
#[cfg(all(feature = "SKAdImpression", feature = "block2"))]
#[unsafe(method(loadProductWithParameters:impression:completionBlock:))]
#[unsafe(method_family = none)]
pub unsafe fn loadProductWithParameters_impression_completionBlock(
&self,
parameters: &NSDictionary<NSString, AnyObject>,
impression: &SKAdImpression,
block: Option<&block2::DynBlock<dyn Fn(Bool, *mut NSError)>>,
);
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SKStoreProductViewController {
extern_methods!(
#[unsafe(method(initWithNibName:bundle:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithNibName_bundle(
this: Allocated<Self>,
nib_name_or_nil: Option<&NSNibName>,
nib_bundle_or_nil: Option<&NSBundle>,
) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SKStoreProductViewController {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl SKStoreProductViewController {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_protocol!(
pub unsafe trait SKStoreProductViewControllerDelegate: NSObjectProtocol {
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(productViewControllerDidFinish:))]
#[unsafe(method_family = none)]
unsafe fn productViewControllerDidFinish(
&self,
view_controller: &SKStoreProductViewController,
);
}
);
extern "C" {
pub static SKStoreProductParameterITunesItemIdentifier: &'static NSString;
}
extern "C" {
pub static SKStoreProductParameterProductIdentifier: &'static NSString;
}
extern "C" {
pub static SKStoreProductParameterCustomProductPageIdentifier: &'static NSString;
}
extern "C" {
pub static SKStoreProductParameterAffiliateToken: &'static NSString;
}
extern "C" {
pub static SKStoreProductParameterCampaignToken: &'static NSString;
}
extern "C" {
pub static SKStoreProductParameterProviderToken: &'static NSString;
}
extern "C" {
pub static SKStoreProductParameterAdvertisingPartnerToken: &'static NSString;
}