objc2_app_kit/generated/
NSDraggingSession.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdraggingsession?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct NSDraggingSession;
15);
16
17unsafe impl NSObjectProtocol for NSDraggingSession {}
18
19impl NSDraggingSession {
20    extern_methods!(
21        #[cfg(feature = "NSDragging")]
22        #[unsafe(method(draggingFormation))]
23        #[unsafe(method_family = none)]
24        pub unsafe fn draggingFormation(&self) -> NSDraggingFormation;
25
26        #[cfg(feature = "NSDragging")]
27        /// Setter for [`draggingFormation`][Self::draggingFormation].
28        #[unsafe(method(setDraggingFormation:))]
29        #[unsafe(method_family = none)]
30        pub unsafe fn setDraggingFormation(&self, dragging_formation: NSDraggingFormation);
31
32        #[unsafe(method(animatesToStartingPositionsOnCancelOrFail))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn animatesToStartingPositionsOnCancelOrFail(&self) -> bool;
35
36        /// Setter for [`animatesToStartingPositionsOnCancelOrFail`][Self::animatesToStartingPositionsOnCancelOrFail].
37        #[unsafe(method(setAnimatesToStartingPositionsOnCancelOrFail:))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn setAnimatesToStartingPositionsOnCancelOrFail(
40            &self,
41            animates_to_starting_positions_on_cancel_or_fail: bool,
42        );
43
44        #[unsafe(method(draggingLeaderIndex))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn draggingLeaderIndex(&self) -> NSInteger;
47
48        /// Setter for [`draggingLeaderIndex`][Self::draggingLeaderIndex].
49        #[unsafe(method(setDraggingLeaderIndex:))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn setDraggingLeaderIndex(&self, dragging_leader_index: NSInteger);
52
53        #[cfg(feature = "NSPasteboard")]
54        #[unsafe(method(draggingPasteboard))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn draggingPasteboard(&self) -> Retained<NSPasteboard>;
57
58        #[unsafe(method(draggingSequenceNumber))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn draggingSequenceNumber(&self) -> NSInteger;
61
62        #[unsafe(method(draggingLocation))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn draggingLocation(&self) -> NSPoint;
65
66        #[cfg(all(
67            feature = "NSDragging",
68            feature = "NSDraggingItem",
69            feature = "NSPasteboard",
70            feature = "NSResponder",
71            feature = "NSView",
72            feature = "block2"
73        ))]
74        #[unsafe(method(enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn enumerateDraggingItemsWithOptions_forView_classes_searchOptions_usingBlock(
77            &self,
78            enum_opts: NSDraggingItemEnumerationOptions,
79            view: Option<&NSView>,
80            class_array: &NSArray<AnyClass>,
81            search_options: &NSDictionary<NSPasteboardReadingOptionKey, AnyObject>,
82            block: &block2::Block<dyn Fn(NonNull<NSDraggingItem>, NSInteger, NonNull<Bool>) + '_>,
83        );
84    );
85}
86
87/// Methods declared on superclass `NSObject`.
88impl NSDraggingSession {
89    extern_methods!(
90        #[unsafe(method(init))]
91        #[unsafe(method_family = init)]
92        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
93
94        #[unsafe(method(new))]
95        #[unsafe(method_family = new)]
96        pub unsafe fn new() -> Retained<Self>;
97    );
98}