use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[deprecated = "Hosted content is no longer supported"]
#[repr(isize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum SKDownloadState {
#[deprecated = "Hosted content is no longer supported"]
#[doc(alias = "SKDownloadStateWaiting")]
Waiting = 0,
#[deprecated = "Hosted content is no longer supported"]
#[doc(alias = "SKDownloadStateActive")]
Active = 1,
#[deprecated = "Hosted content is no longer supported"]
#[doc(alias = "SKDownloadStatePaused")]
Paused = 2,
#[deprecated = "Hosted content is no longer supported"]
#[doc(alias = "SKDownloadStateFinished")]
Finished = 3,
#[deprecated = "Hosted content is no longer supported"]
#[doc(alias = "SKDownloadStateFailed")]
Failed = 4,
#[deprecated = "Hosted content is no longer supported"]
#[doc(alias = "SKDownloadStateCancelled")]
Cancelled = 5,
}
unsafe impl Encode for SKDownloadState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for SKDownloadState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern "C" {
pub static SKDownloadTimeRemainingUnknown: NSTimeInterval;
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Hosted content is no longer supported"]
pub struct SKDownload;
unsafe impl ClassType for SKDownload {
type Super = NSObject;
type Mutability = InteriorMutable;
}
);
unsafe impl NSObjectProtocol for SKDownload {}
extern_methods!(
unsafe impl SKDownload {
#[deprecated = "Hosted content is no longer supported"]
#[method(state)]
pub unsafe fn state(&self) -> SKDownloadState;
#[deprecated]
#[method(downloadState)]
pub unsafe fn downloadState(&self) -> SKDownloadState;
#[deprecated]
#[method_id(@__retain_semantics Other contentLength)]
pub unsafe fn contentLength(&self) -> Retained<NSNumber>;
#[deprecated = "Hosted content is no longer supported"]
#[method(expectedContentLength)]
pub unsafe fn expectedContentLength(&self) -> c_longlong;
#[deprecated = "Hosted content is no longer supported"]
#[method_id(@__retain_semantics Other contentIdentifier)]
pub unsafe fn contentIdentifier(&self) -> Retained<NSString>;
#[deprecated = "Hosted content is no longer supported"]
#[method_id(@__retain_semantics Other contentURL)]
pub unsafe fn contentURL(&self) -> Option<Retained<NSURL>>;
#[deprecated = "Hosted content is no longer supported"]
#[method_id(@__retain_semantics Other contentVersion)]
pub unsafe fn contentVersion(&self) -> Retained<NSString>;
#[deprecated = "Hosted content is no longer supported"]
#[method_id(@__retain_semantics Other error)]
pub unsafe fn error(&self) -> Option<Retained<NSError>>;
#[deprecated = "Hosted content is no longer supported"]
#[method(progress)]
pub unsafe fn progress(&self) -> c_float;
#[deprecated = "Hosted content is no longer supported"]
#[method(timeRemaining)]
pub unsafe fn timeRemaining(&self) -> NSTimeInterval;
#[cfg(feature = "SKPaymentTransaction")]
#[deprecated = "Hosted content is no longer supported"]
#[method_id(@__retain_semantics Other transaction)]
pub unsafe fn transaction(&self) -> Retained<SKPaymentTransaction>;
#[deprecated = "Hosted content is no longer supported"]
#[method_id(@__retain_semantics Other contentURLForProductID:)]
pub unsafe fn contentURLForProductID(product_id: &NSString) -> Option<Retained<NSURL>>;
#[deprecated = "Hosted content is no longer supported"]
#[method(deleteContentForProductID:)]
pub unsafe fn deleteContentForProductID(product_id: &NSString);
}
);
extern_methods!(
unsafe impl SKDownload {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
}
);