objc2-ui-kit 0.3.2

Bindings to the UIKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    /// A hover effect that can be applied to a `UIView` via a `UIHoverStyle`.
    /// You don't conform to this protocol directly. Instead, you use a built-in
    /// `UIHoverEffect` like `UIHoverAutomaticEffect`.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uihovereffect?language=objc)
    pub unsafe trait UIHoverEffect: NSObjectProtocol + NSCopying + MainThreadOnly {}
);

extern_class!(
    /// An effect that applies a highlight to the view on hover.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uihoverhighlighteffect?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIHoverHighlightEffect;
);

extern_conformance!(
    unsafe impl NSCopying for UIHoverHighlightEffect {}
);

unsafe impl CopyingHelper for UIHoverHighlightEffect {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for UIHoverHighlightEffect {}
);

extern_conformance!(
    unsafe impl UIHoverEffect for UIHoverHighlightEffect {}
);

impl UIHoverHighlightEffect {
    extern_methods!(
        #[unsafe(method(effect))]
        #[unsafe(method_family = none)]
        pub fn effect(mtm: MainThreadMarker) -> 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(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

extern_class!(
    /// An effect that can visually lift the view on hover where appropriate.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uihoverlifteffect?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIHoverLiftEffect;
);

extern_conformance!(
    unsafe impl NSCopying for UIHoverLiftEffect {}
);

unsafe impl CopyingHelper for UIHoverLiftEffect {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for UIHoverLiftEffect {}
);

extern_conformance!(
    unsafe impl UIHoverEffect for UIHoverLiftEffect {}
);

impl UIHoverLiftEffect {
    extern_methods!(
        #[unsafe(method(effect))]
        #[unsafe(method_family = none)]
        pub fn effect(mtm: MainThreadMarker) -> 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(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

extern_class!(
    /// A system-default hover effect that automatically selects the appropriate
    /// effect based on the view to which it is applied.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uihoverautomaticeffect?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIHoverAutomaticEffect;
);

extern_conformance!(
    unsafe impl NSCopying for UIHoverAutomaticEffect {}
);

unsafe impl CopyingHelper for UIHoverAutomaticEffect {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for UIHoverAutomaticEffect {}
);

extern_conformance!(
    unsafe impl UIHoverEffect for UIHoverAutomaticEffect {}
);

impl UIHoverAutomaticEffect {
    extern_methods!(
        #[unsafe(method(effect))]
        #[unsafe(method_family = none)]
        pub fn effect(mtm: MainThreadMarker) -> 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(mtm: MainThreadMarker) -> Retained<Self>;
    );
}