objc2_store_kit/generated/
SKDownload.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/storekit/skdownloadstate?language=objc)
11// NS_CLOSED_ENUM
12#[deprecated = "Hosted content is no longer supported"]
13#[repr(isize)] // NSInteger
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub enum SKDownloadState {
16    #[doc(alias = "SKDownloadStateWaiting")]
17    #[deprecated = "Hosted content is no longer supported"]
18    Waiting = 0,
19    #[doc(alias = "SKDownloadStateActive")]
20    #[deprecated = "Hosted content is no longer supported"]
21    Active = 1,
22    #[doc(alias = "SKDownloadStatePaused")]
23    #[deprecated = "Hosted content is no longer supported"]
24    Paused = 2,
25    #[doc(alias = "SKDownloadStateFinished")]
26    #[deprecated = "Hosted content is no longer supported"]
27    Finished = 3,
28    #[doc(alias = "SKDownloadStateFailed")]
29    #[deprecated = "Hosted content is no longer supported"]
30    Failed = 4,
31    #[doc(alias = "SKDownloadStateCancelled")]
32    #[deprecated = "Hosted content is no longer supported"]
33    Cancelled = 5,
34}
35
36unsafe impl Encode for SKDownloadState {
37    const ENCODING: Encoding = NSInteger::ENCODING;
38}
39
40unsafe impl RefEncode for SKDownloadState {
41    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
42}
43
44extern "C" {
45    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skdownloadtimeremainingunknown?language=objc)
46    #[deprecated = "Hosted content is no longer supported"]
47    pub static SKDownloadTimeRemainingUnknown: NSTimeInterval;
48}
49
50extern_class!(
51    /// [Apple's documentation](https://developer.apple.com/documentation/storekit/skdownload?language=objc)
52    #[unsafe(super(NSObject))]
53    #[derive(Debug, PartialEq, Eq, Hash)]
54    #[deprecated = "Hosted content is no longer supported"]
55    pub struct SKDownload;
56);
57
58extern_conformance!(
59    unsafe impl NSObjectProtocol for SKDownload {}
60);
61
62impl SKDownload {
63    extern_methods!(
64        #[deprecated = "Hosted content is no longer supported"]
65        #[unsafe(method(state))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn state(&self) -> SKDownloadState;
68
69        #[deprecated]
70        #[unsafe(method(downloadState))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn downloadState(&self) -> SKDownloadState;
73
74        #[deprecated]
75        #[unsafe(method(contentLength))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn contentLength(&self) -> Retained<NSNumber>;
78
79        #[deprecated = "Hosted content is no longer supported"]
80        #[unsafe(method(expectedContentLength))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn expectedContentLength(&self) -> c_longlong;
83
84        #[deprecated = "Hosted content is no longer supported"]
85        #[unsafe(method(contentIdentifier))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn contentIdentifier(&self) -> Retained<NSString>;
88
89        #[deprecated = "Hosted content is no longer supported"]
90        #[unsafe(method(contentURL))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn contentURL(&self) -> Option<Retained<NSURL>>;
93
94        #[deprecated = "Hosted content is no longer supported"]
95        #[unsafe(method(contentVersion))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn contentVersion(&self) -> Retained<NSString>;
98
99        #[deprecated = "Hosted content is no longer supported"]
100        #[unsafe(method(error))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn error(&self) -> Option<Retained<NSError>>;
103
104        #[deprecated = "Hosted content is no longer supported"]
105        #[unsafe(method(progress))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn progress(&self) -> c_float;
108
109        #[deprecated = "Hosted content is no longer supported"]
110        #[unsafe(method(timeRemaining))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn timeRemaining(&self) -> NSTimeInterval;
113
114        #[cfg(feature = "SKPaymentTransaction")]
115        #[deprecated = "Hosted content is no longer supported"]
116        #[unsafe(method(transaction))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn transaction(&self) -> Retained<SKPaymentTransaction>;
119
120        #[deprecated = "Hosted content is no longer supported"]
121        #[unsafe(method(contentURLForProductID:))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn contentURLForProductID(product_id: &NSString) -> Option<Retained<NSURL>>;
124
125        #[deprecated = "Hosted content is no longer supported"]
126        #[unsafe(method(deleteContentForProductID:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn deleteContentForProductID(product_id: &NSString);
129    );
130}
131
132/// Methods declared on superclass `NSObject`.
133impl SKDownload {
134    extern_methods!(
135        #[unsafe(method(init))]
136        #[unsafe(method_family = init)]
137        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
138
139        #[unsafe(method(new))]
140        #[unsafe(method_family = new)]
141        pub unsafe fn new() -> Retained<Self>;
142    );
143}