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
17extern_conformance!(
18    unsafe impl NSObjectProtocol for NSDraggingSession {}
19);
20
21impl NSDraggingSession {
22    extern_methods!(
23        #[cfg(feature = "NSDragging")]
24        #[unsafe(method(draggingFormation))]
25        #[unsafe(method_family = none)]
26        pub fn draggingFormation(&self) -> NSDraggingFormation;
27
28        #[cfg(feature = "NSDragging")]
29        /// Setter for [`draggingFormation`][Self::draggingFormation].
30        #[unsafe(method(setDraggingFormation:))]
31        #[unsafe(method_family = none)]
32        pub fn setDraggingFormation(&self, dragging_formation: NSDraggingFormation);
33
34        #[unsafe(method(animatesToStartingPositionsOnCancelOrFail))]
35        #[unsafe(method_family = none)]
36        pub fn animatesToStartingPositionsOnCancelOrFail(&self) -> bool;
37
38        /// Setter for [`animatesToStartingPositionsOnCancelOrFail`][Self::animatesToStartingPositionsOnCancelOrFail].
39        #[unsafe(method(setAnimatesToStartingPositionsOnCancelOrFail:))]
40        #[unsafe(method_family = none)]
41        pub fn setAnimatesToStartingPositionsOnCancelOrFail(
42            &self,
43            animates_to_starting_positions_on_cancel_or_fail: bool,
44        );
45
46        #[unsafe(method(draggingLeaderIndex))]
47        #[unsafe(method_family = none)]
48        pub fn draggingLeaderIndex(&self) -> NSInteger;
49
50        /// Setter for [`draggingLeaderIndex`][Self::draggingLeaderIndex].
51        #[unsafe(method(setDraggingLeaderIndex:))]
52        #[unsafe(method_family = none)]
53        pub fn setDraggingLeaderIndex(&self, dragging_leader_index: NSInteger);
54
55        #[cfg(feature = "NSPasteboard")]
56        #[unsafe(method(draggingPasteboard))]
57        #[unsafe(method_family = none)]
58        pub fn draggingPasteboard(&self) -> Retained<NSPasteboard>;
59
60        #[unsafe(method(draggingSequenceNumber))]
61        #[unsafe(method_family = none)]
62        pub fn draggingSequenceNumber(&self) -> NSInteger;
63
64        #[unsafe(method(draggingLocation))]
65        #[unsafe(method_family = none)]
66        pub fn draggingLocation(&self) -> NSPoint;
67
68        #[cfg(all(
69            feature = "NSDragging",
70            feature = "NSDraggingItem",
71            feature = "NSPasteboard",
72            feature = "NSResponder",
73            feature = "NSView",
74            feature = "block2"
75        ))]
76        /// # Safety
77        ///
78        /// - `class_array` generic probably has further requirements.
79        /// - `search_options` generic should be of the correct type.
80        #[unsafe(method(enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn enumerateDraggingItemsWithOptions_forView_classes_searchOptions_usingBlock(
83            &self,
84            enum_opts: NSDraggingItemEnumerationOptions,
85            view: Option<&NSView>,
86            class_array: &NSArray<AnyClass>,
87            search_options: &NSDictionary<NSPasteboardReadingOptionKey, AnyObject>,
88            block: &block2::DynBlock<
89                dyn Fn(NonNull<NSDraggingItem>, NSInteger, NonNull<Bool>) + '_,
90            >,
91        );
92    );
93}
94
95/// Methods declared on superclass `NSObject`.
96impl NSDraggingSession {
97    extern_methods!(
98        #[unsafe(method(init))]
99        #[unsafe(method_family = init)]
100        pub fn init(this: Allocated<Self>) -> Retained<Self>;
101
102        #[unsafe(method(new))]
103        #[unsafe(method_family = new)]
104        pub fn new() -> Retained<Self>;
105    );
106}
107
108impl DefaultRetained for NSDraggingSession {
109    #[inline]
110    fn default_retained() -> Retained<Self> {
111        Self::new()
112    }
113}