//! 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;
);

unsafe impl NSObjectProtocol for NSDraggingSession {}

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

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

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

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

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

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

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

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

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

        #[cfg(all(
            feature = "NSDragging",
            feature = "NSDraggingItem",
            feature = "NSPasteboard",
            feature = "NSResponder",
            feature = "NSView",
            feature = "block2"
        ))]
        #[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::Block<dyn Fn(NonNull<NSDraggingItem>, NSInteger, NonNull<Bool>) + '_>,
        );
    );
}

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