//! 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::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;

use crate::*;

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uipopoverbackgroundviewmethods?language=objc)
    pub unsafe trait UIPopoverBackgroundViewMethods {
        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(arrowBase))]
        #[unsafe(method_family = none)]
        fn arrowBase() -> CGFloat;

        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
        #[unsafe(method(contentViewInsets))]
        #[unsafe(method_family = none)]
        fn contentViewInsets() -> UIEdgeInsets;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(arrowHeight))]
        #[unsafe(method_family = none)]
        fn arrowHeight() -> CGFloat;
    }
);

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uipopoverbackgroundview?language=objc)
    #[unsafe(super(UIView, UIResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "UIResponder", feature = "UIView"))]
    pub struct UIPopoverBackgroundView;
);

#[cfg(all(
    feature = "UIResponder",
    feature = "UIView",
    feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
    unsafe impl CALayerDelegate for UIPopoverBackgroundView {}
);

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl NSCoding for UIPopoverBackgroundView {}
);

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for UIPopoverBackgroundView {}
);

#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIAppearance for UIPopoverBackgroundView {}
);

#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIAppearanceContainer for UIPopoverBackgroundView {}
);

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UICoordinateSpace for UIPopoverBackgroundView {}
);

#[cfg(all(
    feature = "UIDynamicBehavior",
    feature = "UIResponder",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UIDynamicItem for UIPopoverBackgroundView {}
);

#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIFocusEnvironment for UIPopoverBackgroundView {}
);

#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIFocusItem for UIPopoverBackgroundView {}
);

#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIFocusItemContainer for UIPopoverBackgroundView {}
);

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIPopoverBackgroundViewMethods for UIPopoverBackgroundView {}
);

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
    unsafe impl UIResponderStandardEditActions for UIPopoverBackgroundView {}
);

#[cfg(all(
    feature = "UIResponder",
    feature = "UITraitCollection",
    feature = "UIView"
))]
extern_conformance!(
    unsafe impl UITraitEnvironment for UIPopoverBackgroundView {}
);

#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIPopoverBackgroundView {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(arrowOffset))]
        #[unsafe(method_family = none)]
        pub fn arrowOffset(&self) -> CGFloat;

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

        #[cfg(feature = "UIPopoverSupport")]
        #[unsafe(method(arrowDirection))]
        #[unsafe(method_family = none)]
        pub fn arrowDirection(&self) -> UIPopoverArrowDirection;

        #[cfg(feature = "UIPopoverSupport")]
        /// Setter for [`arrowDirection`][Self::arrowDirection].
        #[unsafe(method(setArrowDirection:))]
        #[unsafe(method_family = none)]
        pub fn setArrowDirection(&self, arrow_direction: UIPopoverArrowDirection);

        #[deprecated = "No longer supported"]
        #[unsafe(method(wantsDefaultContentAppearance))]
        #[unsafe(method_family = none)]
        pub fn wantsDefaultContentAppearance(mtm: MainThreadMarker) -> bool;
    );
}

/// Methods declared on superclass `UIView`.
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIPopoverBackgroundView {
    extern_methods!(
        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIPopoverBackgroundView {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}
