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_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIFocusEffect;
);
extern_conformance!(
unsafe impl NSCopying for UIFocusEffect {}
);
unsafe impl CopyingHelper for UIFocusEffect {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UIFocusEffect {}
);
impl UIFocusEffect {
extern_methods!(
#[unsafe(method(effect))]
#[unsafe(method_family = none)]
pub fn effect() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIFocusHaloEffectPosition(pub NSInteger);
impl UIFocusHaloEffectPosition {
#[doc(alias = "UIFocusHaloEffectPositionAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UIFocusHaloEffectPositionOutside")]
pub const Outside: Self = Self(1);
#[doc(alias = "UIFocusHaloEffectPositionInside")]
pub const Inside: Self = Self(2);
}
unsafe impl Encode for UIFocusHaloEffectPosition {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIFocusHaloEffectPosition {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(UIFocusEffect, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIFocusHaloEffect;
);
extern_conformance!(
unsafe impl NSCopying for UIFocusHaloEffect {}
);
unsafe impl CopyingHelper for UIFocusHaloEffect {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UIFocusHaloEffect {}
);
impl UIFocusHaloEffect {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(effectWithRect:))]
#[unsafe(method_family = none)]
pub fn effectWithRect(rect: CGRect) -> Retained<Self>;
#[cfg(all(feature = "objc2-core-foundation", feature = "objc2-quartz-core"))]
#[cfg(not(target_os = "watchos"))]
#[unsafe(method(effectWithRoundedRect:cornerRadius:curve:))]
#[unsafe(method_family = none)]
pub fn effectWithRoundedRect_cornerRadius_curve(
rect: CGRect,
corner_radius: CGFloat,
curve: &CALayerCornerCurve,
) -> Retained<Self>;
#[cfg(feature = "UIBezierPath")]
#[unsafe(method(effectWithPath:))]
#[unsafe(method_family = none)]
pub fn effectWithPath(bezier_path: &UIBezierPath) -> Retained<Self>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[unsafe(method(containerView))]
#[unsafe(method_family = none)]
pub fn containerView(&self, mtm: MainThreadMarker) -> Option<Retained<UIView>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[unsafe(method(setContainerView:))]
#[unsafe(method_family = none)]
pub fn setContainerView(&self, container_view: Option<&UIView>);
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[unsafe(method(referenceView))]
#[unsafe(method_family = none)]
pub fn referenceView(&self, mtm: MainThreadMarker) -> Option<Retained<UIView>>;
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[unsafe(method(setReferenceView:))]
#[unsafe(method_family = none)]
pub fn setReferenceView(&self, reference_view: Option<&UIView>);
#[unsafe(method(position))]
#[unsafe(method_family = none)]
pub fn position(&self) -> UIFocusHaloEffectPosition;
#[unsafe(method(setPosition:))]
#[unsafe(method_family = none)]
pub fn setPosition(&self, position: UIFocusHaloEffectPosition);
);
}
impl UIFocusHaloEffect {
extern_methods!(
#[unsafe(method(effect))]
#[unsafe(method_family = none)]
pub fn effect() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}