objc2_ui_kit/generated/
UIGravityBehavior.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-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uigravitybehavior?language=objc)
14    #[unsafe(super(UIDynamicBehavior, NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "UIDynamicBehavior")]
18    pub struct UIGravityBehavior;
19);
20
21#[cfg(feature = "UIDynamicBehavior")]
22extern_conformance!(
23    unsafe impl NSObjectProtocol for UIGravityBehavior {}
24);
25
26#[cfg(feature = "UIDynamicBehavior")]
27impl UIGravityBehavior {
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(gravityDirection))]
50        #[unsafe(method_family = none)]
51        pub fn gravityDirection(&self) -> CGVector;
52
53        #[cfg(feature = "objc2-core-foundation")]
54        /// Setter for [`gravityDirection`][Self::gravityDirection].
55        #[unsafe(method(setGravityDirection:))]
56        #[unsafe(method_family = none)]
57        pub fn setGravityDirection(&self, gravity_direction: CGVector);
58
59        #[cfg(feature = "objc2-core-foundation")]
60        #[unsafe(method(angle))]
61        #[unsafe(method_family = none)]
62        pub fn angle(&self) -> CGFloat;
63
64        #[cfg(feature = "objc2-core-foundation")]
65        /// Setter for [`angle`][Self::angle].
66        #[unsafe(method(setAngle:))]
67        #[unsafe(method_family = none)]
68        pub fn setAngle(&self, angle: CGFloat);
69
70        #[cfg(feature = "objc2-core-foundation")]
71        #[unsafe(method(magnitude))]
72        #[unsafe(method_family = none)]
73        pub fn magnitude(&self) -> CGFloat;
74
75        #[cfg(feature = "objc2-core-foundation")]
76        /// Setter for [`magnitude`][Self::magnitude].
77        #[unsafe(method(setMagnitude:))]
78        #[unsafe(method_family = none)]
79        pub fn setMagnitude(&self, magnitude: CGFloat);
80
81        #[cfg(feature = "objc2-core-foundation")]
82        #[unsafe(method(setAngle:magnitude:))]
83        #[unsafe(method_family = none)]
84        pub fn setAngle_magnitude(&self, angle: CGFloat, magnitude: CGFloat);
85    );
86}
87
88/// Methods declared on superclass `NSObject`.
89#[cfg(feature = "UIDynamicBehavior")]
90impl UIGravityBehavior {
91    extern_methods!(
92        #[unsafe(method(init))]
93        #[unsafe(method_family = init)]
94        pub fn init(this: Allocated<Self>) -> Retained<Self>;
95
96        #[unsafe(method(new))]
97        #[unsafe(method_family = new)]
98        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
99    );
100}