1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    pub unsafe trait UIDragDropSession: NSObjectProtocol + IsMainThreadOnly {
        #[cfg(feature = "UIDragItem")]
        #[method_id(@__retain_semantics Other items)]
        unsafe fn items(&self) -> Retained<NSArray<UIDragItem>>;

        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
        #[method(locationInView:)]
        unsafe fn locationInView(&self, view: &UIView) -> CGPoint;

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

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

        #[method(hasItemsConformingToTypeIdentifiers:)]
        unsafe fn hasItemsConformingToTypeIdentifiers(
            &self,
            type_identifiers: &NSArray<NSString>,
        ) -> bool;

        #[method(canLoadObjectsOfClass:)]
        unsafe fn canLoadObjectsOfClass(&self, a_class: &AnyClass) -> bool;
    }

    unsafe impl ProtocolType for dyn UIDragDropSession {}
);

extern_protocol!(
    pub unsafe trait UIDragSession: UIDragDropSession + IsMainThreadOnly {
        #[method_id(@__retain_semantics Other localContext)]
        unsafe fn localContext(&self) -> Option<Retained<AnyObject>>;

        #[method(setLocalContext:)]
        unsafe fn setLocalContext(&self, local_context: Option<&AnyObject>);
    }

    unsafe impl ProtocolType for dyn UIDragSession {}
);

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIDropSessionProgressIndicatorStyle(pub NSUInteger);
impl UIDropSessionProgressIndicatorStyle {
    #[doc(alias = "UIDropSessionProgressIndicatorStyleNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "UIDropSessionProgressIndicatorStyleDefault")]
    pub const Default: Self = Self(1);
}

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

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

extern_protocol!(
    pub unsafe trait UIDropSession:
        NSProgressReporting + UIDragDropSession + IsMainThreadOnly
    {
        #[method_id(@__retain_semantics Other localDragSession)]
        unsafe fn localDragSession(&self) -> Option<Retained<ProtocolObject<dyn UIDragSession>>>;

        #[method(progressIndicatorStyle)]
        unsafe fn progressIndicatorStyle(&self) -> UIDropSessionProgressIndicatorStyle;

        #[method(setProgressIndicatorStyle:)]
        unsafe fn setProgressIndicatorStyle(
            &self,
            progress_indicator_style: UIDropSessionProgressIndicatorStyle,
        );

        #[cfg(feature = "block2")]
        #[method_id(@__retain_semantics Other loadObjectsOfClass:completion:)]
        unsafe fn loadObjectsOfClass_completion(
            &self,
            a_class: &AnyClass,
            completion: &block2::Block<
                dyn Fn(NonNull<NSArray<ProtocolObject<dyn NSItemProviderReading>>>),
            >,
        ) -> Retained<NSProgress>;
    }

    unsafe impl ProtocolType for dyn UIDropSession {}
);