use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[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")]
#[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;
#[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;
#[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"
))]
#[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>) + '_,
>,
);
);
}
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()
}
}