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
34unsafe impl MDLAssetResolver for MDLRelativeAssetResolver {}
35
36unsafe impl NSObjectProtocol for MDLRelativeAssetResolver {}
37
38impl MDLRelativeAssetResolver {
39    extern_methods!(
40        #[cfg(feature = "MDLAsset")]
41        #[unsafe(method(initWithAsset:))]
42        #[unsafe(method_family = init)]
43        pub unsafe fn initWithAsset(this: Allocated<Self>, asset: &MDLAsset) -> Retained<Self>;
44
45        #[cfg(feature = "MDLAsset")]
46        #[unsafe(method(asset))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn asset(&self) -> Option<Retained<MDLAsset>>;
49
50        #[cfg(feature = "MDLAsset")]
51        /// This is a [weak property][objc2::topics::weak_property].
52        /// Setter for [`asset`][Self::asset].
53        #[unsafe(method(setAsset:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn setAsset(&self, asset: Option<&MDLAsset>);
56    );
57}
58
59/// Methods declared on superclass `NSObject`.
60impl MDLRelativeAssetResolver {
61    extern_methods!(
62        #[unsafe(method(init))]
63        #[unsafe(method_family = init)]
64        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
65
66        #[unsafe(method(new))]
67        #[unsafe(method_family = new)]
68        pub unsafe fn new() -> Retained<Self>;
69    );
70}
71
72extern_class!(
73    /// The path asset resolver searches for referenced files
74    /// by prepending path.
75    ///
76    ///
77    /// Path should resolve to a well formed URI. A file system
78    /// path might take the form
79    /// "
80    /// file:///path/to/all/assets/
81    ///
82    /// A trailing slash is automatically appended to path if
83    /// not provided.
84    ///
85    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlpathassetresolver?language=objc)
86    #[unsafe(super(NSObject))]
87    #[derive(Debug, PartialEq, Eq, Hash)]
88    pub struct MDLPathAssetResolver;
89);
90
91unsafe impl MDLAssetResolver for MDLPathAssetResolver {}
92
93unsafe impl NSObjectProtocol for MDLPathAssetResolver {}
94
95impl MDLPathAssetResolver {
96    extern_methods!(
97        #[unsafe(method(initWithPath:))]
98        #[unsafe(method_family = init)]
99        pub unsafe fn initWithPath(this: Allocated<Self>, path: &NSString) -> Retained<Self>;
100
101        #[unsafe(method(path))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn path(&self) -> Retained<NSString>;
104
105        /// Setter for [`path`][Self::path].
106        #[unsafe(method(setPath:))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn setPath(&self, path: &NSString);
109    );
110}
111
112/// Methods declared on superclass `NSObject`.
113impl MDLPathAssetResolver {
114    extern_methods!(
115        #[unsafe(method(init))]
116        #[unsafe(method_family = init)]
117        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
118
119        #[unsafe(method(new))]
120        #[unsafe(method_family = new)]
121        pub unsafe fn new() -> Retained<Self>;
122    );
123}
124
125extern_class!(
126    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlbundleassetresolver?language=objc)
127    #[unsafe(super(NSObject))]
128    #[derive(Debug, PartialEq, Eq, Hash)]
129    pub struct MDLBundleAssetResolver;
130);
131
132unsafe impl MDLAssetResolver for MDLBundleAssetResolver {}
133
134unsafe impl NSObjectProtocol for MDLBundleAssetResolver {}
135
136impl MDLBundleAssetResolver {
137    extern_methods!(
138        #[unsafe(method(initWithBundle:))]
139        #[unsafe(method_family = init)]
140        pub unsafe fn initWithBundle(this: Allocated<Self>, path: &NSString) -> Retained<Self>;
141
142        #[unsafe(method(path))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn path(&self) -> Retained<NSString>;
145
146        /// Setter for [`path`][Self::path].
147        #[unsafe(method(setPath:))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn setPath(&self, path: &NSString);
150    );
151}
152
153/// Methods declared on superclass `NSObject`.
154impl MDLBundleAssetResolver {
155    extern_methods!(
156        #[unsafe(method(init))]
157        #[unsafe(method_family = init)]
158        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
159
160        #[unsafe(method(new))]
161        #[unsafe(method_family = new)]
162        pub unsafe fn new() -> Retained<Self>;
163    );
164}