//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uigravitybehavior?language=objc)
    #[unsafe(super(UIDynamicBehavior, NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "UIDynamicBehavior")]
    pub struct UIGravityBehavior;
);

#[cfg(feature = "UIDynamicBehavior")]
extern_conformance!(
    unsafe impl NSObjectProtocol for UIGravityBehavior {}
);

#[cfg(feature = "UIDynamicBehavior")]
impl UIGravityBehavior {
    extern_methods!(
        #[unsafe(method(initWithItems:))]
        #[unsafe(method_family = init)]
        pub fn initWithItems(
            this: Allocated<Self>,
            items: &NSArray<ProtocolObject<dyn UIDynamicItem>>,
        ) -> Retained<Self>;

        #[unsafe(method(addItem:))]
        #[unsafe(method_family = none)]
        pub fn addItem(&self, item: &ProtocolObject<dyn UIDynamicItem>);

        #[unsafe(method(removeItem:))]
        #[unsafe(method_family = none)]
        pub fn removeItem(&self, item: &ProtocolObject<dyn UIDynamicItem>);

        #[unsafe(method(items))]
        #[unsafe(method_family = none)]
        pub fn items(&self) -> Retained<NSArray<ProtocolObject<dyn UIDynamicItem>>>;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(gravityDirection))]
        #[unsafe(method_family = none)]
        pub fn gravityDirection(&self) -> CGVector;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`gravityDirection`][Self::gravityDirection].
        #[unsafe(method(setGravityDirection:))]
        #[unsafe(method_family = none)]
        pub fn setGravityDirection(&self, gravity_direction: CGVector);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(angle))]
        #[unsafe(method_family = none)]
        pub fn angle(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`angle`][Self::angle].
        #[unsafe(method(setAngle:))]
        #[unsafe(method_family = none)]
        pub fn setAngle(&self, angle: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(magnitude))]
        #[unsafe(method_family = none)]
        pub fn magnitude(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`magnitude`][Self::magnitude].
        #[unsafe(method(setMagnitude:))]
        #[unsafe(method_family = none)]
        pub fn setMagnitude(&self, magnitude: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(setAngle:magnitude:))]
        #[unsafe(method_family = none)]
        pub fn setAngle_magnitude(&self, angle: CGFloat, magnitude: CGFloat);
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "UIDynamicBehavior")]
impl UIGravityBehavior {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}
