1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_CLOSED_ENUM
#[deprecated = "Hosted content is no longer supported"]
#[repr(isize)] // NSInteger
#[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!(
    /// Methods declared on superclass `NSObject`
    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>;
    }
);