objc2_background_assets/generated/BAAssetPack.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 /// An archive of assets that the system downloads together.
11 ///
12 /// An instance of this class can be invalidated when the asset pack that it represents is updated on the server.
13 ///
14 /// See also [Apple's documentation](https://developer.apple.com/documentation/backgroundassets/baassetpack?language=objc)
15 #[unsafe(super(NSObject))]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 pub struct BAAssetPack;
18);
19
20unsafe impl Send for BAAssetPack {}
21
22unsafe impl Sync for BAAssetPack {}
23
24extern_conformance!(
25 unsafe impl NSObjectProtocol for BAAssetPack {}
26);
27
28impl BAAssetPack {
29 extern_methods!(
30 /// A unique identifier for the asset pack.
31 #[unsafe(method(identifier))]
32 #[unsafe(method_family = none)]
33 pub unsafe fn identifier(&self) -> Retained<NSString>;
34
35 /// The size of the download file containing the asset pack in bytes.
36 ///
37 /// This is different than the installation size, which could be larger.
38 #[unsafe(method(downloadSize))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn downloadSize(&self) -> NSInteger;
41
42 /// The asset pack’s version number
43 #[unsafe(method(version))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn version(&self) -> NSInteger;
46
47 /// JSON-encoded custom information that’s associated with the asset pack.
48 ///
49 /// This property is `nil` for Apple-hosted asset packs.
50 #[unsafe(method(userInfo))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn userInfo(&self) -> Option<Retained<NSData>>;
53
54 #[unsafe(method(init))]
55 #[unsafe(method_family = init)]
56 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
57
58 #[unsafe(method(new))]
59 #[unsafe(method_family = new)]
60 pub unsafe fn new() -> Retained<Self>;
61
62 #[cfg(feature = "BADownload")]
63 /// Creates a download object for the asset pack that you schedule using a download manager.
64 /// - Remark: Use this method in your main app; use ``BAAssetPack/downloadForContentRequest:`` instead in your downloader extension.
65 #[unsafe(method(download))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn download(&self) -> Retained<BADownload>;
68
69 #[cfg(all(feature = "BADownload", feature = "BATypes"))]
70 /// Creates a download object for the asset pack that you schedule using a download manager.
71 /// - Parameter contentRequest: The content request for the current extension invocation.
72 /// - Returns: A download object.
73 /// - Remark: Use this method in your downloader extension; use ``BAAssetPack/download`` instead in your main app.
74 #[unsafe(method(downloadForContentRequest:))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn downloadForContentRequest(
77 &self,
78 content_request: BAContentRequest,
79 ) -> Retained<BADownload>;
80 );
81}