//! 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::*;
use objc2_foundation::*;

use crate::*;

/// The position along the perimeter of a rectangular frame (its edges and corners) from which it’s resized.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nscursorframeresizeposition?language=objc)
// NS_CLOSED_ENUM
#[repr(usize)] // NSUInteger
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum NSCursorFrameResizePosition {
    /// The top edge of the frame.
    #[doc(alias = "NSCursorFrameResizePositionTop")]
    Top = 1 << 0,
    /// The left edge of the frame.
    #[doc(alias = "NSCursorFrameResizePositionLeft")]
    Left = 1 << 1,
    /// The bottom edge of the frame.
    #[doc(alias = "NSCursorFrameResizePositionBottom")]
    Bottom = 1 << 2,
    /// The right edge of the frame.
    #[doc(alias = "NSCursorFrameResizePositionRight")]
    Right = 1 << 3,
    /// The top left corner of the frame.
    #[doc(alias = "NSCursorFrameResizePositionTopLeft")]
    TopLeft =
        NSCursorFrameResizePosition::Top as usize | NSCursorFrameResizePosition::Left as usize,
    /// The top right corner of the frame.
    #[doc(alias = "NSCursorFrameResizePositionTopRight")]
    TopRight =
        NSCursorFrameResizePosition::Top as usize | NSCursorFrameResizePosition::Right as usize,
    /// The bottom left corner of the frame.
    #[doc(alias = "NSCursorFrameResizePositionBottomLeft")]
    BottomLeft =
        NSCursorFrameResizePosition::Bottom as usize | NSCursorFrameResizePosition::Left as usize,
    /// The bottom right corner of the frame.
    #[doc(alias = "NSCursorFrameResizePositionBottomRight")]
    BottomRight =
        NSCursorFrameResizePosition::Bottom as usize | NSCursorFrameResizePosition::Right as usize,
}

unsafe impl Encode for NSCursorFrameResizePosition {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSCursorFrameResizePosition {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// The directions in which a rectangular frame can be resized.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nscursorframeresizedirections?language=objc)
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSCursorFrameResizeDirections(pub NSUInteger);
bitflags::bitflags! {
    impl NSCursorFrameResizeDirections: NSUInteger {
/// Indicates that the shape can be resized inwards to be smaller.
        #[doc(alias = "NSCursorFrameResizeDirectionsInward")]
        const Inward = 1<<0;
/// Indicates that the shape can be resized outwards to be larger.
        #[doc(alias = "NSCursorFrameResizeDirectionsOutward")]
        const Outward = 1<<1;
/// Indicates that the shape can be resized inwards or wards to be either smaller or larger, respectively.
        #[doc(alias = "NSCursorFrameResizeDirectionsAll")]
        const All = NSCursorFrameResizeDirections::Inward.0|NSCursorFrameResizeDirections::Outward.0;
    }
}

unsafe impl Encode for NSCursorFrameResizeDirections {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSCursorFrameResizeDirections {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscursor?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSCursor;
);

unsafe impl NSCoding for NSCursor {}

unsafe impl NSObjectProtocol for NSCursor {}

unsafe impl NSSecureCoding for NSCursor {}

impl NSCursor {
    extern_methods!(
        #[cfg(feature = "NSImage")]
        #[unsafe(method(initWithImage:hotSpot:))]
        #[unsafe(method_family = init)]
        pub fn initWithImage_hotSpot(
            this: Allocated<Self>,
            new_image: &NSImage,
            point: NSPoint,
        ) -> Retained<Self>;

        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;

        #[cfg(feature = "NSImage")]
        #[unsafe(method(image))]
        #[unsafe(method_family = none)]
        pub unsafe fn image(&self) -> Retained<NSImage>;

        #[unsafe(method(hotSpot))]
        #[unsafe(method_family = none)]
        pub unsafe fn hotSpot(&self) -> NSPoint;

        #[unsafe(method(hide))]
        #[unsafe(method_family = none)]
        pub unsafe fn hide();

        #[unsafe(method(unhide))]
        #[unsafe(method_family = none)]
        pub unsafe fn unhide();

        #[unsafe(method(setHiddenUntilMouseMoves:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setHiddenUntilMouseMoves(flag: bool);

        #[unsafe(method(pop))]
        #[unsafe(method_family = none)]
        pub unsafe fn pop_class();

        #[unsafe(method(pop))]
        #[unsafe(method_family = none)]
        pub unsafe fn pop(&self);

        #[unsafe(method(push))]
        #[unsafe(method_family = none)]
        pub unsafe fn push(&self);

        #[unsafe(method(set))]
        #[unsafe(method_family = none)]
        pub unsafe fn set(&self);

        /// Returns the application’s current cursor.
        /// - Note: This isn’t necessarily the cursor that is currently being displayed, as the system may be showing the cursor for another running application.
        #[unsafe(method(currentCursor))]
        #[unsafe(method_family = none)]
        pub unsafe fn currentCursor() -> Retained<NSCursor>;

        /// Returns the default cursor, the arrow cursor.
        /// - Discussion: The default cursor, a slanted arrow with its hot spot at the tip. The arrow cursor is the one you’re used to seeing over buttons, scrollers, and many other objects in the window system.
        #[unsafe(method(arrowCursor))]
        #[unsafe(method_family = none)]
        pub fn arrowCursor() -> Retained<NSCursor>;

        #[unsafe(method(crosshairCursor))]
        #[unsafe(method_family = none)]
        pub fn crosshairCursor() -> Retained<NSCursor>;

        #[unsafe(method(disappearingItemCursor))]
        #[unsafe(method_family = none)]
        pub fn disappearingItemCursor() -> Retained<NSCursor>;

        #[unsafe(method(operationNotAllowedCursor))]
        #[unsafe(method_family = none)]
        pub fn operationNotAllowedCursor() -> Retained<NSCursor>;

        #[unsafe(method(dragLinkCursor))]
        #[unsafe(method_family = none)]
        pub fn dragLinkCursor() -> Retained<NSCursor>;

        #[unsafe(method(dragCopyCursor))]
        #[unsafe(method_family = none)]
        pub fn dragCopyCursor() -> Retained<NSCursor>;

        #[unsafe(method(contextualMenuCursor))]
        #[unsafe(method_family = none)]
        pub fn contextualMenuCursor() -> Retained<NSCursor>;

        #[unsafe(method(pointingHandCursor))]
        #[unsafe(method_family = none)]
        pub fn pointingHandCursor() -> Retained<NSCursor>;

        #[unsafe(method(closedHandCursor))]
        #[unsafe(method_family = none)]
        pub fn closedHandCursor() -> Retained<NSCursor>;

        #[unsafe(method(openHandCursor))]
        #[unsafe(method_family = none)]
        pub fn openHandCursor() -> Retained<NSCursor>;

        #[unsafe(method(IBeamCursor))]
        #[unsafe(method_family = none)]
        pub fn IBeamCursor() -> Retained<NSCursor>;

        #[unsafe(method(IBeamCursorForVerticalLayout))]
        #[unsafe(method_family = none)]
        pub fn IBeamCursorForVerticalLayout() -> Retained<NSCursor>;

        /// Returns the zoom-in cursor.
        /// - Note: This cursor is used to indicate zooming in on (magnifying) a canvas or object.
        #[unsafe(method(zoomInCursor))]
        #[unsafe(method_family = none)]
        pub unsafe fn zoomInCursor() -> Retained<NSCursor>;

        /// Returns the zoom-out cursor.
        /// - Note: This cursor is used to indicate zooming out of a canvas or object.
        #[unsafe(method(zoomOutCursor))]
        #[unsafe(method_family = none)]
        pub unsafe fn zoomOutCursor() -> Retained<NSCursor>;

        /// Returns the cursor for resizing a column (vertical divider) in either direction.
        #[unsafe(method(columnResizeCursor))]
        #[unsafe(method_family = none)]
        pub unsafe fn columnResizeCursor() -> Retained<NSCursor>;

        #[cfg(feature = "NSDirection")]
        /// Returns the cursor for resizing a column (vertical divider) in the specified directions.
        /// - Parameter directions: The direction in which a column can be resized.
        #[unsafe(method(columnResizeCursorInDirections:))]
        #[unsafe(method_family = none)]
        pub unsafe fn columnResizeCursorInDirections(
            directions: NSHorizontalDirections,
        ) -> Retained<NSCursor>;

        /// Returns the cursor for resizing a row (horizontal divider) in either direction.
        #[unsafe(method(rowResizeCursor))]
        #[unsafe(method_family = none)]
        pub unsafe fn rowResizeCursor() -> Retained<NSCursor>;

        #[cfg(feature = "NSDirection")]
        /// Returns the cursor for resizing a row (horizontal divider) in the specified directions.
        /// - Parameter directions: The direction in which a row can be resized.
        #[unsafe(method(rowResizeCursorInDirections:))]
        #[unsafe(method_family = none)]
        pub unsafe fn rowResizeCursorInDirections(
            directions: NSVerticalDirections,
        ) -> Retained<NSCursor>;

        /// Returns the cursor for resizing a rectangular frame from the specified edge or corner.
        /// - Parameters:
        /// - position: The position along the perimeter of a rectangular frame (its edges and corners) from which it’s resized.
        /// - directions: The directions in which a rectangular frame can be resized.
        #[unsafe(method(frameResizeCursorFromPosition:inDirections:))]
        #[unsafe(method_family = none)]
        pub unsafe fn frameResizeCursorFromPosition_inDirections(
            position: NSCursorFrameResizePosition,
            directions: NSCursorFrameResizeDirections,
        ) -> Retained<NSCursor>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSCursor {
    extern_methods!(
        #[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>;
    );
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumberwithcursorsizesupport?language=objc)
#[cfg(feature = "NSApplication")]
pub static NSAppKitVersionNumberWithCursorSizeSupport: NSAppKitVersion = 682.0 as _;

/// Deprecated.
impl NSCursor {
    extern_methods!(
        /// This property will always be `nil` in a future version of macOS.
        #[deprecated = "No longer recommended. Use ScreenCaptureKit to capture the screen. Use the `showsCursor` property on `SCStreamConfiguration` to control whether or not to include the cursor in the capture. Or, use `NSCursor.currentCursor` if needing to just get the current cursor for this application."]
        #[unsafe(method(currentSystemCursor))]
        #[unsafe(method_family = none)]
        pub unsafe fn currentSystemCursor() -> Option<Retained<NSCursor>>;

        #[deprecated = "Use either `+[NSCursor columnResizeCursorInDirections:]` or `+[NSCursor frameResizeCursorFromPosition:inDirections:]` instead, depending on whether a divider is being re-positioned or a rectangular frame is being resized."]
        #[unsafe(method(resizeLeftCursor))]
        #[unsafe(method_family = none)]
        pub fn resizeLeftCursor() -> Retained<NSCursor>;

        #[deprecated = "Use either `+[NSCursor columnResizeCursorInDirections:]` or `+[NSCursor frameResizeCursorFromPosition:inDirections:]` instead, depending on whether a divider is being re-positioned or a rectangular frame is being resized."]
        #[unsafe(method(resizeRightCursor))]
        #[unsafe(method_family = none)]
        pub fn resizeRightCursor() -> Retained<NSCursor>;

        #[deprecated = "Use either `+[NSCursor columnResizeCursorInDirections:]` or `+[NSCursor frameResizeCursorFromPosition:inDirections:]` instead, depending on whether a divider is being re-positioned or a rectangular frame is being resized."]
        #[unsafe(method(resizeLeftRightCursor))]
        #[unsafe(method_family = none)]
        pub fn resizeLeftRightCursor() -> Retained<NSCursor>;

        #[deprecated = "Use either `+[NSCursor rowResizeCursorInDirections:]` or `+[NSCursor frameResizeCursorFromPosition:inDirections:]` instead, depending on whether a divider is being re-positioned or a rectangular frame is being resized."]
        #[unsafe(method(resizeUpCursor))]
        #[unsafe(method_family = none)]
        pub fn resizeUpCursor() -> Retained<NSCursor>;

        #[deprecated = "Use either `+[NSCursor rowResizeCursorInDirections:]` or `+[NSCursor frameResizeCursorFromPosition:inDirections:]` instead, depending on whether a divider is being re-positioned or a rectangular frame is being resized."]
        #[unsafe(method(resizeDownCursor))]
        #[unsafe(method_family = none)]
        pub fn resizeDownCursor() -> Retained<NSCursor>;

        #[deprecated = "Use either `+[NSCursor rowResizeCursorInDirections:]` or `+[NSCursor frameResizeCursorFromPosition:inDirections:]` instead, depending on whether a divider is being re-positioned or a rectangular frame is being resized."]
        #[unsafe(method(resizeUpDownCursor))]
        #[unsafe(method_family = none)]
        pub fn resizeUpDownCursor() -> Retained<NSCursor>;
    );
}

/// NSDeprecated.
impl NSCursor {
    extern_methods!(
        #[cfg(all(feature = "NSColor", feature = "NSImage"))]
        #[deprecated = "Color hints are ignored. Use -initWithImage:hotSpot: instead"]
        #[unsafe(method(initWithImage:foregroundColorHint:backgroundColorHint:hotSpot:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithImage_foregroundColorHint_backgroundColorHint_hotSpot(
            this: Allocated<Self>,
            new_image: &NSImage,
            fg: Option<&NSColor>,
            bg: Option<&NSColor>,
            hot_spot: NSPoint,
        ) -> Retained<Self>;

        #[deprecated = "setOnMouseExited is unused and should not be called"]
        #[unsafe(method(setOnMouseExited:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setOnMouseExited(&self, flag: bool);

        #[deprecated = "setOnMouseEntered is unused and should not be called"]
        #[unsafe(method(setOnMouseEntered:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setOnMouseEntered(&self, flag: bool);

        #[deprecated = "isSetOnMouseExited is unused"]
        #[unsafe(method(isSetOnMouseExited))]
        #[unsafe(method_family = none)]
        pub unsafe fn isSetOnMouseExited(&self) -> bool;

        #[deprecated = "isSetOnMouseEntered is unused"]
        #[unsafe(method(isSetOnMouseEntered))]
        #[unsafe(method_family = none)]
        pub unsafe fn isSetOnMouseEntered(&self) -> bool;

        #[cfg(feature = "NSEvent")]
        #[deprecated = "mouseEntered: is unused and should not be called"]
        #[unsafe(method(mouseEntered:))]
        #[unsafe(method_family = none)]
        pub unsafe fn mouseEntered(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[deprecated = "mouseExited: is unused and should not be called"]
        #[unsafe(method(mouseExited:))]
        #[unsafe(method_family = none)]
        pub unsafe fn mouseExited(&self, event: &NSEvent);
    );
}
