objc2_ui_kit/generated/
UIDynamicItemBehavior.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(UIDynamicBehavior, NSObject))]
15 #[thread_kind = MainThreadOnly]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 #[cfg(feature = "UIDynamicBehavior")]
18 pub struct UIDynamicItemBehavior;
19);
20
21#[cfg(feature = "UIDynamicBehavior")]
22extern_conformance!(
23 unsafe impl NSObjectProtocol for UIDynamicItemBehavior {}
24);
25
26#[cfg(feature = "UIDynamicBehavior")]
27impl UIDynamicItemBehavior {
28 extern_methods!(
29 #[unsafe(method(initWithItems:))]
30 #[unsafe(method_family = init)]
31 pub fn initWithItems(
32 this: Allocated<Self>,
33 items: &NSArray<ProtocolObject<dyn UIDynamicItem>>,
34 ) -> Retained<Self>;
35
36 #[unsafe(method(addItem:))]
37 #[unsafe(method_family = none)]
38 pub fn addItem(&self, item: &ProtocolObject<dyn UIDynamicItem>);
39
40 #[unsafe(method(removeItem:))]
41 #[unsafe(method_family = none)]
42 pub fn removeItem(&self, item: &ProtocolObject<dyn UIDynamicItem>);
43
44 #[unsafe(method(items))]
45 #[unsafe(method_family = none)]
46 pub fn items(&self) -> Retained<NSArray<ProtocolObject<dyn UIDynamicItem>>>;
47
48 #[cfg(feature = "objc2-core-foundation")]
49 #[unsafe(method(elasticity))]
50 #[unsafe(method_family = none)]
51 pub fn elasticity(&self) -> CGFloat;
52
53 #[cfg(feature = "objc2-core-foundation")]
54 #[unsafe(method(setElasticity:))]
56 #[unsafe(method_family = none)]
57 pub fn setElasticity(&self, elasticity: CGFloat);
58
59 #[cfg(feature = "objc2-core-foundation")]
60 #[unsafe(method(friction))]
61 #[unsafe(method_family = none)]
62 pub fn friction(&self) -> CGFloat;
63
64 #[cfg(feature = "objc2-core-foundation")]
65 #[unsafe(method(setFriction:))]
67 #[unsafe(method_family = none)]
68 pub fn setFriction(&self, friction: CGFloat);
69
70 #[cfg(feature = "objc2-core-foundation")]
71 #[unsafe(method(density))]
72 #[unsafe(method_family = none)]
73 pub fn density(&self) -> CGFloat;
74
75 #[cfg(feature = "objc2-core-foundation")]
76 #[unsafe(method(setDensity:))]
78 #[unsafe(method_family = none)]
79 pub fn setDensity(&self, density: CGFloat);
80
81 #[cfg(feature = "objc2-core-foundation")]
82 #[unsafe(method(resistance))]
83 #[unsafe(method_family = none)]
84 pub fn resistance(&self) -> CGFloat;
85
86 #[cfg(feature = "objc2-core-foundation")]
87 #[unsafe(method(setResistance:))]
89 #[unsafe(method_family = none)]
90 pub fn setResistance(&self, resistance: CGFloat);
91
92 #[cfg(feature = "objc2-core-foundation")]
93 #[unsafe(method(angularResistance))]
94 #[unsafe(method_family = none)]
95 pub fn angularResistance(&self) -> CGFloat;
96
97 #[cfg(feature = "objc2-core-foundation")]
98 #[unsafe(method(setAngularResistance:))]
100 #[unsafe(method_family = none)]
101 pub fn setAngularResistance(&self, angular_resistance: CGFloat);
102
103 #[cfg(feature = "objc2-core-foundation")]
104 #[unsafe(method(charge))]
108 #[unsafe(method_family = none)]
109 pub fn charge(&self) -> CGFloat;
110
111 #[cfg(feature = "objc2-core-foundation")]
112 #[unsafe(method(setCharge:))]
114 #[unsafe(method_family = none)]
115 pub fn setCharge(&self, charge: CGFloat);
116
117 #[unsafe(method(isAnchored))]
121 #[unsafe(method_family = none)]
122 pub fn isAnchored(&self) -> bool;
123
124 #[unsafe(method(setAnchored:))]
126 #[unsafe(method_family = none)]
127 pub fn setAnchored(&self, anchored: bool);
128
129 #[unsafe(method(allowsRotation))]
130 #[unsafe(method_family = none)]
131 pub fn allowsRotation(&self) -> bool;
132
133 #[unsafe(method(setAllowsRotation:))]
135 #[unsafe(method_family = none)]
136 pub fn setAllowsRotation(&self, allows_rotation: bool);
137
138 #[cfg(feature = "objc2-core-foundation")]
139 #[unsafe(method(addLinearVelocity:forItem:))]
140 #[unsafe(method_family = none)]
141 pub fn addLinearVelocity_forItem(
142 &self,
143 velocity: CGPoint,
144 item: &ProtocolObject<dyn UIDynamicItem>,
145 );
146
147 #[cfg(feature = "objc2-core-foundation")]
148 #[unsafe(method(linearVelocityForItem:))]
149 #[unsafe(method_family = none)]
150 pub fn linearVelocityForItem(&self, item: &ProtocolObject<dyn UIDynamicItem>) -> CGPoint;
151
152 #[cfg(feature = "objc2-core-foundation")]
153 #[unsafe(method(addAngularVelocity:forItem:))]
154 #[unsafe(method_family = none)]
155 pub fn addAngularVelocity_forItem(
156 &self,
157 velocity: CGFloat,
158 item: &ProtocolObject<dyn UIDynamicItem>,
159 );
160
161 #[cfg(feature = "objc2-core-foundation")]
162 #[unsafe(method(angularVelocityForItem:))]
163 #[unsafe(method_family = none)]
164 pub fn angularVelocityForItem(&self, item: &ProtocolObject<dyn UIDynamicItem>) -> CGFloat;
165 );
166}
167
168#[cfg(feature = "UIDynamicBehavior")]
170impl UIDynamicItemBehavior {
171 extern_methods!(
172 #[unsafe(method(init))]
173 #[unsafe(method_family = init)]
174 pub fn init(this: Allocated<Self>) -> Retained<Self>;
175
176 #[unsafe(method(new))]
177 #[unsafe(method_family = new)]
178 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
179 );
180}