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

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

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

impl NSDraggingSession {
    extern_methods!(
        #[cfg(feature = "NSDragging")]
        #[unsafe(method(draggingFormation))]
        #[unsafe(method_family = none)]
        pub fn draggingFormation(&self) -> NSDraggingFormation;

        #[cfg(feature = "NSDragging")]
        /// Setter for [`draggingFormation`][Self::draggingFormation].
        #[unsafe(method(setDraggingFormation:))]
        #[unsafe(method_family = none)]
        pub fn setDraggingFormation(&self, dragging_formation: NSDraggingFormation);

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

        /// Setter for [`animatesToStartingPositionsOnCancelOrFail`][Self::animatesToStartingPositionsOnCancelOrFail].
        #[unsafe(method(setAnimatesToStartingPositionsOnCancelOrFail:))]
        #[unsafe(method_family = none)]
        pub fn setAnimatesToStartingPositionsOnCancelOrFail(
            &self,
            animates_to_starting_positions_on_cancel_or_fail: bool,
        );

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

        /// Setter for [`draggingLeaderIndex`][Self::draggingLeaderIndex].
        #[unsafe(method(setDraggingLeaderIndex:))]
        #[unsafe(method_family = none)]
        pub fn setDraggingLeaderIndex(&self, dragging_leader_index: NSInteger);

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

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

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

        #[cfg(all(
            feature = "NSDragging",
            feature = "NSDraggingItem",
            feature = "NSPasteboard",
            feature = "NSResponder",
            feature = "NSView",
            feature = "block2"
        ))]
        /// # Safety
        ///
        /// - `class_array` generic probably has further requirements.
        /// - `search_options` generic should be of the correct type.
        #[unsafe(method(enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:))]
        #[unsafe(method_family = none)]
        pub unsafe fn enumerateDraggingItemsWithOptions_forView_classes_searchOptions_usingBlock(
            &self,
            enum_opts: NSDraggingItemEnumerationOptions,
            view: Option<&NSView>,
            class_array: &NSArray<AnyClass>,
            search_options: &NSDictionary<NSPasteboardReadingOptionKey, AnyObject>,
            block: &block2::DynBlock<
                dyn Fn(NonNull<NSDraggingItem>, NSInteger, NonNull<Bool>) + '_,
            >,
        );
    );
}

/// Methods declared on superclass `NSObject`.
impl NSDraggingSession {
    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() -> Retained<Self>;
    );
}

impl DefaultRetained for NSDraggingSession {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}
