objc2_sprite_kit/generated/
SKReferenceNode.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::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern_class!(
14    /// [Apple's documentation](https://developer.apple.com/documentation/spritekit/skreferencenode?language=objc)
15    #[unsafe(super(SKNode, NSResponder, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
18    #[cfg(target_os = "macos")]
19    pub struct SKReferenceNode;
20);
21
22#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
23#[cfg(target_os = "macos")]
24extern_conformance!(
25    unsafe impl NSCoding for SKReferenceNode {}
26);
27
28#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
29#[cfg(target_os = "macos")]
30extern_conformance!(
31    unsafe impl NSCopying for SKReferenceNode {}
32);
33
34#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
35#[cfg(target_os = "macos")]
36unsafe impl CopyingHelper for SKReferenceNode {
37    type Result = Self;
38}
39
40#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
41#[cfg(target_os = "macos")]
42extern_conformance!(
43    unsafe impl NSObjectProtocol for SKReferenceNode {}
44);
45
46#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
47#[cfg(target_os = "macos")]
48extern_conformance!(
49    unsafe impl NSSecureCoding for SKReferenceNode {}
50);
51
52#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
53#[cfg(target_os = "macos")]
54impl SKReferenceNode {
55    extern_methods!(
56        /// Create a reference node with a url
57        #[unsafe(method(initWithURL:))]
58        #[unsafe(method_family = init)]
59        pub unsafe fn initWithURL(this: Allocated<Self>, url: Option<&NSURL>) -> Retained<Self>;
60
61        /// Create a reference node with a url
62        #[unsafe(method(initWithFileNamed:))]
63        #[unsafe(method_family = init)]
64        pub unsafe fn initWithFileNamed(
65            this: Allocated<Self>,
66            file_name: Option<&NSString>,
67        ) -> Retained<Self>;
68
69        /// Support coding and decoding via NSKeyedArchiver.
70        ///
71        /// # Safety
72        ///
73        /// `a_decoder` possibly has further requirements.
74        #[unsafe(method(initWithCoder:))]
75        #[unsafe(method_family = init)]
76        pub unsafe fn initWithCoder(
77            this: Allocated<Self>,
78            a_decoder: &NSCoder,
79        ) -> Option<Retained<Self>>;
80
81        /// Create a reference node with a url
82        #[unsafe(method(referenceNodeWithFileNamed:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn referenceNodeWithFileNamed(
85            file_name: &NSString,
86            mtm: MainThreadMarker,
87        ) -> Retained<Self>;
88
89        /// Create a reference node with a url
90        #[unsafe(method(referenceNodeWithURL:))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn referenceNodeWithURL(
93            reference_url: &NSURL,
94            mtm: MainThreadMarker,
95        ) -> Retained<Self>;
96
97        /// called each time the url is loaded, after it has been added as a child
98        #[unsafe(method(didLoadReferenceNode:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn didLoadReferenceNode(&self, node: Option<&SKNode>);
101
102        /// Force the reference to be reloaded. The resolved node will added
103        /// as a child of this node. If the resolved node has not yet been loaded,
104        /// it will be automatically loaded when the resolved node is queryed or
105        /// the refenece node is rendered.
106        #[unsafe(method(resolveReferenceNode))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn resolveReferenceNode(&self);
109    );
110}
111
112/// Methods declared on superclass `SKNode`.
113#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
114#[cfg(target_os = "macos")]
115impl SKReferenceNode {
116    extern_methods!(
117        #[unsafe(method(init))]
118        #[unsafe(method_family = init)]
119        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
120
121        #[unsafe(method(node))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn node(mtm: MainThreadMarker) -> Retained<Self>;
124
125        #[unsafe(method(nodeWithFileNamed:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn nodeWithFileNamed(
128            filename: &NSString,
129            mtm: MainThreadMarker,
130        ) -> Option<Retained<Self>>;
131
132        /// # Safety
133        ///
134        /// `classes` generic probably has further requirements.
135        #[unsafe(method(nodeWithFileNamed:securelyWithClasses:andError:_))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn nodeWithFileNamed_securelyWithClasses_andError(
138            filename: &NSString,
139            classes: &NSSet<AnyClass>,
140            mtm: MainThreadMarker,
141        ) -> Result<Retained<Self>, Retained<NSError>>;
142    );
143}
144
145/// Methods declared on superclass `NSObject`.
146#[cfg(all(feature = "SKNode", feature = "objc2-app-kit"))]
147#[cfg(target_os = "macos")]
148impl SKReferenceNode {
149    extern_methods!(
150        #[unsafe(method(new))]
151        #[unsafe(method_family = new)]
152        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
153    );
154}