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
19extern_conformance!(
20    unsafe impl NSCopying for NSDataAsset {}
21);
22
23unsafe impl CopyingHelper for NSDataAsset {
24    type Result = Self;
25}
26
27extern_conformance!(
28    unsafe impl NSObjectProtocol for NSDataAsset {}
29);
30
31impl NSDataAsset {
32    extern_methods!(
33        #[unsafe(method(init))]
34        #[unsafe(method_family = init)]
35        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
36
37        /// Equivalent to -initWithName:name bundle:[NSBundle mainBundle];
38        #[unsafe(method(initWithName:))]
39        #[unsafe(method_family = init)]
40        pub unsafe fn initWithName(
41            this: Allocated<Self>,
42            name: &NSDataAssetName,
43        ) -> Option<Retained<Self>>;
44
45        /// Create a data asset with the given name from the given bundle. Returns nil if the asset was not found.
46        #[unsafe(method(initWithName:bundle:))]
47        #[unsafe(method_family = init)]
48        pub unsafe fn initWithName_bundle(
49            this: Allocated<Self>,
50            name: &NSDataAssetName,
51            bundle: &NSBundle,
52        ) -> Option<Retained<Self>>;
53
54        /// The name used to reference the data asset
55        #[unsafe(method(name))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn name(&self) -> Retained<NSDataAssetName>;
58
59        /// The data for this asset, as stored in the asset catalog
60        #[unsafe(method(data))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn data(&self) -> Retained<NSData>;
63
64        /// The Uniform Type Identifier for this data object.
65        #[unsafe(method(typeIdentifier))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn typeIdentifier(&self) -> Retained<NSString>;
68    );
69}
70
71/// Methods declared on superclass `NSObject`.
72impl NSDataAsset {
73    extern_methods!(
74        #[unsafe(method(new))]
75        #[unsafe(method_family = new)]
76        pub unsafe fn new() -> Retained<Self>;
77    );
78}