objc2_store_kit/generated/
SKDownload.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[deprecated = "Hosted content is no longer supported"]
13#[repr(isize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub enum SKDownloadState {
16 #[deprecated = "Hosted content is no longer supported"]
17 #[doc(alias = "SKDownloadStateWaiting")]
18 Waiting = 0,
19 #[deprecated = "Hosted content is no longer supported"]
20 #[doc(alias = "SKDownloadStateActive")]
21 Active = 1,
22 #[deprecated = "Hosted content is no longer supported"]
23 #[doc(alias = "SKDownloadStatePaused")]
24 Paused = 2,
25 #[deprecated = "Hosted content is no longer supported"]
26 #[doc(alias = "SKDownloadStateFinished")]
27 Finished = 3,
28 #[deprecated = "Hosted content is no longer supported"]
29 #[doc(alias = "SKDownloadStateFailed")]
30 Failed = 4,
31 #[deprecated = "Hosted content is no longer supported"]
32 #[doc(alias = "SKDownloadStateCancelled")]
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 pub static SKDownloadTimeRemainingUnknown: NSTimeInterval;
47}
48
49extern_class!(
50 #[unsafe(super(NSObject))]
52 #[derive(Debug, PartialEq, Eq, Hash)]
53 #[deprecated = "Hosted content is no longer supported"]
54 pub struct SKDownload;
55);
56
57unsafe impl NSObjectProtocol for SKDownload {}
58
59impl SKDownload {
60 extern_methods!(
61 #[deprecated = "Hosted content is no longer supported"]
62 #[unsafe(method(state))]
63 #[unsafe(method_family = none)]
64 pub unsafe fn state(&self) -> SKDownloadState;
65
66 #[deprecated]
67 #[unsafe(method(downloadState))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn downloadState(&self) -> SKDownloadState;
70
71 #[deprecated]
72 #[unsafe(method(contentLength))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn contentLength(&self) -> Retained<NSNumber>;
75
76 #[deprecated = "Hosted content is no longer supported"]
77 #[unsafe(method(expectedContentLength))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn expectedContentLength(&self) -> c_longlong;
80
81 #[deprecated = "Hosted content is no longer supported"]
82 #[unsafe(method(contentIdentifier))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn contentIdentifier(&self) -> Retained<NSString>;
85
86 #[deprecated = "Hosted content is no longer supported"]
87 #[unsafe(method(contentURL))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn contentURL(&self) -> Option<Retained<NSURL>>;
90
91 #[deprecated = "Hosted content is no longer supported"]
92 #[unsafe(method(contentVersion))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn contentVersion(&self) -> Retained<NSString>;
95
96 #[deprecated = "Hosted content is no longer supported"]
97 #[unsafe(method(error))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn error(&self) -> Option<Retained<NSError>>;
100
101 #[deprecated = "Hosted content is no longer supported"]
102 #[unsafe(method(progress))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn progress(&self) -> c_float;
105
106 #[deprecated = "Hosted content is no longer supported"]
107 #[unsafe(method(timeRemaining))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn timeRemaining(&self) -> NSTimeInterval;
110
111 #[cfg(feature = "SKPaymentTransaction")]
112 #[deprecated = "Hosted content is no longer supported"]
113 #[unsafe(method(transaction))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn transaction(&self) -> Retained<SKPaymentTransaction>;
116
117 #[deprecated = "Hosted content is no longer supported"]
118 #[unsafe(method(contentURLForProductID:))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn contentURLForProductID(product_id: &NSString) -> Option<Retained<NSURL>>;
121
122 #[deprecated = "Hosted content is no longer supported"]
123 #[unsafe(method(deleteContentForProductID:))]
124 #[unsafe(method_family = none)]
125 pub unsafe fn deleteContentForProductID(product_id: &NSString);
126 );
127}
128
129impl SKDownload {
131 extern_methods!(
132 #[unsafe(method(init))]
133 #[unsafe(method_family = init)]
134 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
135
136 #[unsafe(method(new))]
137 #[unsafe(method_family = new)]
138 pub unsafe fn new() -> Retained<Self>;
139 );
140}