//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSDragOperation(pub NSUInteger);
bitflags::bitflags! {
    impl NSDragOperation: NSUInteger {
        #[doc(alias = "NSDragOperationNone")]
        const None = 0;
        #[doc(alias = "NSDragOperationCopy")]
        const Copy = 1;
        #[doc(alias = "NSDragOperationLink")]
        const Link = 2;
        #[doc(alias = "NSDragOperationGeneric")]
        const Generic = 4;
        #[doc(alias = "NSDragOperationPrivate")]
        const Private = 8;
        #[doc(alias = "NSDragOperationMove")]
        const Move = 16;
        #[doc(alias = "NSDragOperationDelete")]
        const Delete = 32;
        #[doc(alias = "NSDragOperationEvery")]
        const Every = NSUIntegerMax as _;
#[deprecated]
        #[doc(alias = "NSDragOperationAll_Obsolete")]
        const All_Obsolete = 15;
#[deprecated]
        #[doc(alias = "NSDragOperationAll")]
        const All = NSDragOperation::All_Obsolete.0;
    }
}

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

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

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSDraggingFormation(pub NSInteger);
impl NSDraggingFormation {
    #[doc(alias = "NSDraggingFormationDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "NSDraggingFormationNone")]
    pub const None: Self = Self(1);
    #[doc(alias = "NSDraggingFormationPile")]
    pub const Pile: Self = Self(2);
    #[doc(alias = "NSDraggingFormationList")]
    pub const List: Self = Self(3);
    #[doc(alias = "NSDraggingFormationStack")]
    pub const Stack: Self = Self(4);
}

unsafe impl Encode for NSDraggingFormation {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

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

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSDraggingContext(pub NSInteger);
impl NSDraggingContext {
    #[doc(alias = "NSDraggingContextOutsideApplication")]
    pub const OutsideApplication: Self = Self(0);
    #[doc(alias = "NSDraggingContextWithinApplication")]
    pub const WithinApplication: Self = Self(1);
}

unsafe impl Encode for NSDraggingContext {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

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

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSDraggingItemEnumerationOptions(pub NSUInteger);
bitflags::bitflags! {
    impl NSDraggingItemEnumerationOptions: NSUInteger {
        const NSDraggingItemEnumerationConcurrent = NSEnumerationOptions::NSEnumerationConcurrent.0;
        const NSDraggingItemEnumerationClearNonenumeratedImages = 1<<16;
    }
}

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

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

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSSpringLoadingHighlight(pub NSInteger);
impl NSSpringLoadingHighlight {
    #[doc(alias = "NSSpringLoadingHighlightNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "NSSpringLoadingHighlightStandard")]
    pub const Standard: Self = Self(1);
    #[doc(alias = "NSSpringLoadingHighlightEmphasized")]
    pub const Emphasized: Self = Self(2);
}

unsafe impl Encode for NSSpringLoadingHighlight {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

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

extern_protocol!(
    pub unsafe trait NSDraggingInfo: NSObjectProtocol + IsMainThreadOnly {
        #[cfg(all(feature = "NSResponder", feature = "NSWindow"))]
        #[method_id(@__retain_semantics Other draggingDestinationWindow)]
        unsafe fn draggingDestinationWindow(&self) -> Option<Retained<NSWindow>>;

        #[method(draggingSourceOperationMask)]
        unsafe fn draggingSourceOperationMask(&self) -> NSDragOperation;

        #[method(draggingLocation)]
        unsafe fn draggingLocation(&self) -> NSPoint;

        #[method(draggedImageLocation)]
        unsafe fn draggedImageLocation(&self) -> NSPoint;

        #[cfg(feature = "NSImage")]
        #[deprecated = "Use NSDraggingItem objects instead"]
        #[method_id(@__retain_semantics Other draggedImage)]
        unsafe fn draggedImage(&self) -> Option<Retained<NSImage>>;

        #[cfg(feature = "NSPasteboard")]
        #[method_id(@__retain_semantics Other draggingPasteboard)]
        unsafe fn draggingPasteboard(&self) -> Retained<NSPasteboard>;

        #[method_id(@__retain_semantics Other draggingSource)]
        unsafe fn draggingSource(&self) -> Option<Retained<AnyObject>>;

        #[method(draggingSequenceNumber)]
        unsafe fn draggingSequenceNumber(&self) -> NSInteger;

        #[method(slideDraggedImageTo:)]
        unsafe fn slideDraggedImageTo(&self, screen_point: NSPoint);

        #[deprecated = "Use NSFilePromiseReceiver objects instead"]
        #[method_id(@__retain_semantics Other namesOfPromisedFilesDroppedAtDestination:)]
        unsafe fn namesOfPromisedFilesDroppedAtDestination(
            &self,
            drop_destination: &NSURL,
        ) -> Option<Retained<NSArray<NSString>>>;

        #[method(draggingFormation)]
        unsafe fn draggingFormation(&self) -> NSDraggingFormation;

        #[method(setDraggingFormation:)]
        unsafe fn setDraggingFormation(&self, dragging_formation: NSDraggingFormation);

        #[method(animatesToDestination)]
        unsafe fn animatesToDestination(&self) -> bool;

        #[method(setAnimatesToDestination:)]
        unsafe fn setAnimatesToDestination(&self, animates_to_destination: bool);

        #[method(numberOfValidItemsForDrop)]
        unsafe fn numberOfValidItemsForDrop(&self) -> NSInteger;

        #[method(setNumberOfValidItemsForDrop:)]
        unsafe fn setNumberOfValidItemsForDrop(&self, number_of_valid_items_for_drop: NSInteger);

        #[cfg(all(
            feature = "NSDraggingItem",
            feature = "NSPasteboard",
            feature = "NSResponder",
            feature = "NSView",
            feature = "block2"
        ))]
        #[method(enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:)]
        unsafe fn enumerateDraggingItemsWithOptions_forView_classes_searchOptions_usingBlock(
            &self,
            enum_opts: NSDraggingItemEnumerationOptions,
            view: Option<&NSView>,
            class_array: &NSArray<TodoClass>,
            search_options: &NSDictionary<NSPasteboardReadingOptionKey, AnyObject>,
            block: &block2::Block<dyn Fn(NonNull<NSDraggingItem>, NSInteger, NonNull<Bool>)>,
        );

        #[method(springLoadingHighlight)]
        unsafe fn springLoadingHighlight(&self) -> NSSpringLoadingHighlight;

        #[method(resetSpringLoading)]
        unsafe fn resetSpringLoading(&self);
    }

    unsafe impl ProtocolType for dyn NSDraggingInfo {}
);

extern_protocol!(
    pub unsafe trait NSDraggingDestination: NSObjectProtocol + IsMainThreadOnly {
        #[optional]
        #[method(draggingEntered:)]
        unsafe fn draggingEntered(
            &self,
            sender: &ProtocolObject<dyn NSDraggingInfo>,
        ) -> NSDragOperation;

        #[optional]
        #[method(draggingUpdated:)]
        unsafe fn draggingUpdated(
            &self,
            sender: &ProtocolObject<dyn NSDraggingInfo>,
        ) -> NSDragOperation;

        #[optional]
        #[method(draggingExited:)]
        unsafe fn draggingExited(&self, sender: Option<&ProtocolObject<dyn NSDraggingInfo>>);

        #[optional]
        #[method(prepareForDragOperation:)]
        unsafe fn prepareForDragOperation(
            &self,
            sender: &ProtocolObject<dyn NSDraggingInfo>,
        ) -> bool;

        #[optional]
        #[method(performDragOperation:)]
        unsafe fn performDragOperation(&self, sender: &ProtocolObject<dyn NSDraggingInfo>) -> bool;

        #[optional]
        #[method(concludeDragOperation:)]
        unsafe fn concludeDragOperation(&self, sender: Option<&ProtocolObject<dyn NSDraggingInfo>>);

        #[optional]
        #[method(draggingEnded:)]
        unsafe fn draggingEnded(&self, sender: &ProtocolObject<dyn NSDraggingInfo>);

        #[optional]
        #[method(wantsPeriodicDraggingUpdates)]
        unsafe fn wantsPeriodicDraggingUpdates(&self) -> bool;

        #[optional]
        #[method(updateDraggingItemsForDrag:)]
        unsafe fn updateDraggingItemsForDrag(
            &self,
            sender: Option<&ProtocolObject<dyn NSDraggingInfo>>,
        );
    }

    unsafe impl ProtocolType for dyn NSDraggingDestination {}
);

extern_protocol!(
    pub unsafe trait NSDraggingSource: NSObjectProtocol + IsMainThreadOnly {
        #[cfg(feature = "NSDraggingSession")]
        #[method(draggingSession:sourceOperationMaskForDraggingContext:)]
        unsafe fn draggingSession_sourceOperationMaskForDraggingContext(
            &self,
            session: &NSDraggingSession,
            context: NSDraggingContext,
        ) -> NSDragOperation;

        #[cfg(feature = "NSDraggingSession")]
        #[optional]
        #[method(draggingSession:willBeginAtPoint:)]
        unsafe fn draggingSession_willBeginAtPoint(
            &self,
            session: &NSDraggingSession,
            screen_point: NSPoint,
        );

        #[cfg(feature = "NSDraggingSession")]
        #[optional]
        #[method(draggingSession:movedToPoint:)]
        unsafe fn draggingSession_movedToPoint(
            &self,
            session: &NSDraggingSession,
            screen_point: NSPoint,
        );

        #[cfg(feature = "NSDraggingSession")]
        #[optional]
        #[method(draggingSession:endedAtPoint:operation:)]
        unsafe fn draggingSession_endedAtPoint_operation(
            &self,
            session: &NSDraggingSession,
            screen_point: NSPoint,
            operation: NSDragOperation,
        );

        #[cfg(feature = "NSDraggingSession")]
        #[optional]
        #[method(ignoreModifierKeysForDraggingSession:)]
        unsafe fn ignoreModifierKeysForDraggingSession(&self, session: &NSDraggingSession) -> bool;
    }

    unsafe impl ProtocolType for dyn NSDraggingSource {}
);

// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSSpringLoadingOptions(pub NSUInteger);
bitflags::bitflags! {
    impl NSSpringLoadingOptions: NSUInteger {
        const NSSpringLoadingDisabled = 0;
        const NSSpringLoadingEnabled = 1<<0;
        const NSSpringLoadingContinuousActivation = 1<<1;
        const NSSpringLoadingNoHover = 1<<3;
    }
}

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

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

extern_protocol!(
    pub unsafe trait NSSpringLoadingDestination:
        NSObjectProtocol + IsMainThreadOnly
    {
        #[method(springLoadingActivated:draggingInfo:)]
        unsafe fn springLoadingActivated_draggingInfo(
            &self,
            activated: bool,
            dragging_info: &ProtocolObject<dyn NSDraggingInfo>,
        );

        #[method(springLoadingHighlightChanged:)]
        unsafe fn springLoadingHighlightChanged(
            &self,
            dragging_info: &ProtocolObject<dyn NSDraggingInfo>,
        );

        #[optional]
        #[method(springLoadingEntered:)]
        unsafe fn springLoadingEntered(
            &self,
            dragging_info: &ProtocolObject<dyn NSDraggingInfo>,
        ) -> NSSpringLoadingOptions;

        #[optional]
        #[method(springLoadingUpdated:)]
        unsafe fn springLoadingUpdated(
            &self,
            dragging_info: &ProtocolObject<dyn NSDraggingInfo>,
        ) -> NSSpringLoadingOptions;

        #[optional]
        #[method(springLoadingExited:)]
        unsafe fn springLoadingExited(&self, dragging_info: &ProtocolObject<dyn NSDraggingInfo>);

        #[optional]
        #[method(draggingEnded:)]
        unsafe fn draggingEnded(&self, dragging_info: &ProtocolObject<dyn NSDraggingInfo>);
    }

    unsafe impl ProtocolType for dyn NSSpringLoadingDestination {}
);
