use core::ffi::*;
use core::ptr::NonNull;
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 {
#[doc(alias = "SKDownloadStateWaiting")]
#[deprecated = "Hosted content is no longer supported"]
Waiting = 0,
#[doc(alias = "SKDownloadStateActive")]
#[deprecated = "Hosted content is no longer supported"]
Active = 1,
#[doc(alias = "SKDownloadStatePaused")]
#[deprecated = "Hosted content is no longer supported"]
Paused = 2,
#[doc(alias = "SKDownloadStateFinished")]
#[deprecated = "Hosted content is no longer supported"]
Finished = 3,
#[doc(alias = "SKDownloadStateFailed")]
#[deprecated = "Hosted content is no longer supported"]
Failed = 4,
#[doc(alias = "SKDownloadStateCancelled")]
#[deprecated = "Hosted content is no longer supported"]
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" {
#[deprecated = "Hosted content is no longer supported"]
pub static SKDownloadTimeRemainingUnknown: NSTimeInterval;
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Hosted content is no longer supported"]
pub struct SKDownload;
);
extern_conformance!(
unsafe impl NSObjectProtocol for SKDownload {}
);
impl SKDownload {
extern_methods!(
#[deprecated = "Hosted content is no longer supported"]
#[unsafe(method(state))]
#[unsafe(method_family = none)]
pub unsafe fn state(&self) -> SKDownloadState;
#[deprecated]
#[unsafe(method(downloadState))]
#[unsafe(method_family = none)]
pub unsafe fn downloadState(&self) -> SKDownloadState;
#[deprecated]
#[unsafe(method(contentLength))]
#[unsafe(method_family = none)]
pub unsafe fn contentLength(&self) -> Retained<NSNumber>;
#[deprecated = "Hosted content is no longer supported"]
#[unsafe(method(expectedContentLength))]
#[unsafe(method_family = none)]
pub unsafe fn expectedContentLength(&self) -> c_longlong;
#[deprecated = "Hosted content is no longer supported"]
#[unsafe(method(contentIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn contentIdentifier(&self) -> Retained<NSString>;
#[deprecated = "Hosted content is no longer supported"]
#[unsafe(method(contentURL))]
#[unsafe(method_family = none)]
pub unsafe fn contentURL(&self) -> Option<Retained<NSURL>>;
#[deprecated = "Hosted content is no longer supported"]
#[unsafe(method(contentVersion))]
#[unsafe(method_family = none)]
pub unsafe fn contentVersion(&self) -> Retained<NSString>;
#[deprecated = "Hosted content is no longer supported"]
#[unsafe(method(error))]
#[unsafe(method_family = none)]
pub unsafe fn error(&self) -> Option<Retained<NSError>>;
#[deprecated = "Hosted content is no longer supported"]
#[unsafe(method(progress))]
#[unsafe(method_family = none)]
pub unsafe fn progress(&self) -> c_float;
#[deprecated = "Hosted content is no longer supported"]
#[unsafe(method(timeRemaining))]
#[unsafe(method_family = none)]
pub unsafe fn timeRemaining(&self) -> NSTimeInterval;
#[cfg(feature = "SKPaymentTransaction")]
#[deprecated = "Hosted content is no longer supported"]
#[unsafe(method(transaction))]
#[unsafe(method_family = none)]
pub unsafe fn transaction(&self) -> Retained<SKPaymentTransaction>;
#[deprecated = "Hosted content is no longer supported"]
#[unsafe(method(contentURLForProductID:))]
#[unsafe(method_family = none)]
pub unsafe fn contentURLForProductID(product_id: &NSString) -> Option<Retained<NSURL>>;
#[deprecated = "Hosted content is no longer supported"]
#[unsafe(method(deleteContentForProductID:))]
#[unsafe(method_family = none)]
pub unsafe fn deleteContentForProductID(product_id: &NSString);
);
}
impl SKDownload {
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>;
);
}