use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[deprecated = "Use Product.PromotionInfo.Visibility"]
#[repr(isize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum SKProductStorePromotionVisibility {
#[doc(alias = "SKProductStorePromotionVisibilityDefault")]
#[deprecated = "Use Product.PromotionInfo.Visibility"]
Default = 0,
#[doc(alias = "SKProductStorePromotionVisibilityShow")]
#[deprecated = "Use Product.PromotionInfo.Visibility"]
Show = 1,
#[doc(alias = "SKProductStorePromotionVisibilityHide")]
#[deprecated = "Use Product.PromotionInfo.Visibility"]
Hide = 2,
}
unsafe impl Encode for SKProductStorePromotionVisibility {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for SKProductStorePromotionVisibility {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Use Product.PromotionInfo"]
pub struct SKProductStorePromotionController;
);
extern_conformance!(
unsafe impl NSObjectProtocol for SKProductStorePromotionController {}
);
impl SKProductStorePromotionController {
extern_methods!(
#[deprecated = "Use Product.PromotionInfo"]
#[unsafe(method(defaultController))]
#[unsafe(method_family = none)]
pub unsafe fn defaultController() -> Retained<Self>;
#[cfg(all(feature = "SKProduct", feature = "block2"))]
#[deprecated = "Get visibility from Product.PromotionInfo.currentOrder"]
#[unsafe(method(fetchStorePromotionVisibilityForProduct:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn fetchStorePromotionVisibilityForProduct_completionHandler(
&self,
product: &SKProduct,
completion_handler: Option<
&block2::DynBlock<dyn Fn(SKProductStorePromotionVisibility, *mut NSError)>,
>,
);
#[cfg(all(feature = "SKProduct", feature = "block2"))]
#[deprecated = "Use Product.PromotionInfo.updateProductVisibility(_:for:)"]
#[unsafe(method(updateStorePromotionVisibility:forProduct:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn updateStorePromotionVisibility_forProduct_completionHandler(
&self,
promotion_visibility: SKProductStorePromotionVisibility,
product: &SKProduct,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[cfg(all(feature = "SKProduct", feature = "block2"))]
#[deprecated = "Use Product.PromotionInfo.currentOrder"]
#[unsafe(method(fetchStorePromotionOrderWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn fetchStorePromotionOrderWithCompletionHandler(
&self,
completion_handler: Option<
&block2::DynBlock<dyn Fn(NonNull<NSArray<SKProduct>>, *mut NSError)>,
>,
);
#[cfg(all(feature = "SKProduct", feature = "block2"))]
#[deprecated = "Use Product.PromotionInfo.updateProductOrder(byID:)"]
#[unsafe(method(updateStorePromotionOrder:completionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn updateStorePromotionOrder_completionHandler(
&self,
promotion_order: &NSArray<SKProduct>,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
);
}
impl SKProductStorePromotionController {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}