objc2_app_kit/generated/
NSDataAsset.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
9/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdataassetname?language=objc)
10pub type NSDataAssetName = NSString;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdataasset?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct NSDataAsset;
17);
18
19unsafe impl NSCopying for NSDataAsset {}
20
21unsafe impl CopyingHelper for NSDataAsset {
22    type Result = Self;
23}
24
25unsafe impl NSObjectProtocol for NSDataAsset {}
26
27impl NSDataAsset {
28    extern_methods!(
29        #[unsafe(method(init))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
32
33        /// Equivalent to -initWithName:name bundle:[NSBundle mainBundle];
34        #[unsafe(method(initWithName:))]
35        #[unsafe(method_family = init)]
36        pub unsafe fn initWithName(
37            this: Allocated<Self>,
38            name: &NSDataAssetName,
39        ) -> Option<Retained<Self>>;
40
41        /// Create a data asset with the given name from the given bundle. Returns nil if the asset was not found.
42        #[unsafe(method(initWithName:bundle:))]
43        #[unsafe(method_family = init)]
44        pub unsafe fn initWithName_bundle(
45            this: Allocated<Self>,
46            name: &NSDataAssetName,
47            bundle: &NSBundle,
48        ) -> Option<Retained<Self>>;
49
50        /// The name used to reference the data asset
51        #[unsafe(method(name))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn name(&self) -> Retained<NSDataAssetName>;
54
55        /// The data for this asset, as stored in the asset catalog
56        #[unsafe(method(data))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn data(&self) -> Retained<NSData>;
59
60        /// The Uniform Type Identifier for this data object.
61        #[unsafe(method(typeIdentifier))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn typeIdentifier(&self) -> Retained<NSString>;
64    );
65}
66
67/// Methods declared on superclass `NSObject`.
68impl NSDataAsset {
69    extern_methods!(
70        #[unsafe(method(new))]
71        #[unsafe(method_family = new)]
72        pub unsafe fn new() -> Retained<Self>;
73    );
74}