objc2_phase/generated/
PHASEObject.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_class!(
11    /// *************************************************************************************************
12    ///
13    ///
14    ///
15    /// A PHASEObject represents a 3D object in the engine, which can be organized into a hierarchy with relative transforms.
16    ///
17    /// See also [Apple's documentation](https://developer.apple.com/documentation/phase/phaseobject?language=objc)
18    #[unsafe(super(NSObject))]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    pub struct PHASEObject;
21);
22
23extern_conformance!(
24    unsafe impl NSCopying for PHASEObject {}
25);
26
27unsafe impl CopyingHelper for PHASEObject {
28    type Result = Self;
29}
30
31extern_conformance!(
32    unsafe impl NSObjectProtocol for PHASEObject {}
33);
34
35impl PHASEObject {
36    extern_methods!(
37        #[unsafe(method(init))]
38        #[unsafe(method_family = init)]
39        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
40
41        #[unsafe(method(new))]
42        #[unsafe(method_family = new)]
43        pub unsafe fn new() -> Retained<Self>;
44
45        #[cfg(feature = "PHASEEngine")]
46        /// Initialize a new object.
47        #[unsafe(method(initWithEngine:))]
48        #[unsafe(method_family = init)]
49        pub unsafe fn initWithEngine(this: Allocated<Self>, engine: &PHASEEngine)
50            -> Retained<Self>;
51
52        /// Add a child to this object
53        ///
54        /// Parameter `child`: The child object
55        ///
56        /// Parameter `error`: Returns an error if the child already has a parent.
57        ///
58        /// Returns: YES for success
59        #[unsafe(method(addChild:error:_))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn addChild_error(&self, child: &PHASEObject) -> Result<(), Retained<NSError>>;
62
63        /// Remove a child from this object.
64        #[unsafe(method(removeChild:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn removeChild(&self, child: &PHASEObject);
67
68        /// Remove all the children from this object
69        #[unsafe(method(removeChildren))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn removeChildren(&self);
72
73        /// The parent of this object, or nil if this object doesn't have a parent object.
74        #[unsafe(method(parent))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn parent(&self) -> Option<Retained<PHASEObject>>;
77
78        /// The children of this object.
79        #[unsafe(method(children))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn children(&self) -> Retained<NSArray<PHASEObject>>;
82    );
83}