objc2_model_io/generated/
MDLAssetResolver.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlassetresolver?language=objc)
12    pub unsafe trait MDLAssetResolver: NSObjectProtocol {
13        #[unsafe(method(canResolveAssetNamed:))]
14        #[unsafe(method_family = none)]
15        unsafe fn canResolveAssetNamed(&self, name: &NSString) -> bool;
16
17        #[unsafe(method(resolveAssetNamed:))]
18        #[unsafe(method_family = none)]
19        unsafe fn resolveAssetNamed(&self, name: &NSString) -> Retained<NSURL>;
20    }
21);
22
23extern_class!(
24    /// The relative asset resolver searches for referenced files
25    /// by checking the location of the asset for sibling files
26    /// satisfying the requested name.
27    ///
28    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlrelativeassetresolver?language=objc)
29    #[unsafe(super(NSObject))]
30    #[derive(Debug, PartialEq, Eq, Hash)]
31    pub struct MDLRelativeAssetResolver;
32);
33
34extern_conformance!(
35    unsafe impl MDLAssetResolver for MDLRelativeAssetResolver {}
36);
37
38extern_conformance!(
39    unsafe impl NSObjectProtocol for MDLRelativeAssetResolver {}
40);
41
42impl MDLRelativeAssetResolver {
43    extern_methods!(
44        #[cfg(feature = "MDLAsset")]
45        #[unsafe(method(initWithAsset:))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn initWithAsset(this: Allocated<Self>, asset: &MDLAsset) -> Retained<Self>;
48
49        #[cfg(feature = "MDLAsset")]
50        #[unsafe(method(asset))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn asset(&self) -> Option<Retained<MDLAsset>>;
53
54        #[cfg(feature = "MDLAsset")]
55        /// Setter for [`asset`][Self::asset].
56        ///
57        /// This is a [weak property][objc2::topics::weak_property].
58        #[unsafe(method(setAsset:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn setAsset(&self, asset: Option<&MDLAsset>);
61    );
62}
63
64/// Methods declared on superclass `NSObject`.
65impl MDLRelativeAssetResolver {
66    extern_methods!(
67        #[unsafe(method(init))]
68        #[unsafe(method_family = init)]
69        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
70
71        #[unsafe(method(new))]
72        #[unsafe(method_family = new)]
73        pub unsafe fn new() -> Retained<Self>;
74    );
75}
76
77extern_class!(
78    /// The path asset resolver searches for referenced files
79    /// by prepending path.
80    ///
81    ///
82    /// Path should resolve to a well formed URI. A file system
83    /// path might take the form
84    /// "
85    /// file:///path/to/all/assets/
86    ///
87    /// A trailing slash is automatically appended to path if
88    /// not provided.
89    ///
90    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlpathassetresolver?language=objc)
91    #[unsafe(super(NSObject))]
92    #[derive(Debug, PartialEq, Eq, Hash)]
93    pub struct MDLPathAssetResolver;
94);
95
96extern_conformance!(
97    unsafe impl MDLAssetResolver for MDLPathAssetResolver {}
98);
99
100extern_conformance!(
101    unsafe impl NSObjectProtocol for MDLPathAssetResolver {}
102);
103
104impl MDLPathAssetResolver {
105    extern_methods!(
106        #[unsafe(method(initWithPath:))]
107        #[unsafe(method_family = init)]
108        pub unsafe fn initWithPath(this: Allocated<Self>, path: &NSString) -> Retained<Self>;
109
110        #[unsafe(method(path))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn path(&self) -> Retained<NSString>;
113
114        /// Setter for [`path`][Self::path].
115        ///
116        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
117        #[unsafe(method(setPath:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn setPath(&self, path: &NSString);
120    );
121}
122
123/// Methods declared on superclass `NSObject`.
124impl MDLPathAssetResolver {
125    extern_methods!(
126        #[unsafe(method(init))]
127        #[unsafe(method_family = init)]
128        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
129
130        #[unsafe(method(new))]
131        #[unsafe(method_family = new)]
132        pub unsafe fn new() -> Retained<Self>;
133    );
134}
135
136extern_class!(
137    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlbundleassetresolver?language=objc)
138    #[unsafe(super(NSObject))]
139    #[derive(Debug, PartialEq, Eq, Hash)]
140    pub struct MDLBundleAssetResolver;
141);
142
143extern_conformance!(
144    unsafe impl MDLAssetResolver for MDLBundleAssetResolver {}
145);
146
147extern_conformance!(
148    unsafe impl NSObjectProtocol for MDLBundleAssetResolver {}
149);
150
151impl MDLBundleAssetResolver {
152    extern_methods!(
153        #[unsafe(method(initWithBundle:))]
154        #[unsafe(method_family = init)]
155        pub unsafe fn initWithBundle(this: Allocated<Self>, path: &NSString) -> Retained<Self>;
156
157        #[unsafe(method(path))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn path(&self) -> Retained<NSString>;
160
161        /// Setter for [`path`][Self::path].
162        ///
163        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
164        #[unsafe(method(setPath:))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn setPath(&self, path: &NSString);
167    );
168}
169
170/// Methods declared on superclass `NSObject`.
171impl MDLBundleAssetResolver {
172    extern_methods!(
173        #[unsafe(method(init))]
174        #[unsafe(method_family = init)]
175        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
176
177        #[unsafe(method(new))]
178        #[unsafe(method_family = new)]
179        pub unsafe fn new() -> Retained<Self>;
180    );
181}