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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
//! 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 UIFindInteractionDelegate: NSObjectProtocol + IsMainThreadOnly {
        #[cfg(all(feature = "UIFindSession", feature = "UIResponder", feature = "UIView"))]
        #[method_id(@__retain_semantics Other findInteraction:sessionForView:)]
        unsafe fn findInteraction_sessionForView(
            &self,
            interaction: &UIFindInteraction,
            view: &UIView,
        ) -> Option<Retained<UIFindSession>>;

        #[cfg(feature = "UIFindSession")]
        #[optional]
        #[method(findInteraction:didBeginFindSession:)]
        unsafe fn findInteraction_didBeginFindSession(
            &self,
            interaction: &UIFindInteraction,
            session: &UIFindSession,
        );

        #[cfg(feature = "UIFindSession")]
        #[optional]
        #[method(findInteraction:didEndFindSession:)]
        unsafe fn findInteraction_didEndFindSession(
            &self,
            interaction: &UIFindInteraction,
            session: &UIFindSession,
        );
    }

    unsafe impl ProtocolType for dyn UIFindInteractionDelegate {}
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UIFindInteraction;

    unsafe impl ClassType for UIFindInteraction {
        type Super = NSObject;
        type Mutability = MainThreadOnly;
    }
);

unsafe impl NSObjectProtocol for UIFindInteraction {}

#[cfg(feature = "UIInteraction")]
unsafe impl UIInteraction for UIFindInteraction {}

extern_methods!(
    unsafe impl UIFindInteraction {
        #[method(isFindNavigatorVisible)]
        pub unsafe fn isFindNavigatorVisible(&self) -> bool;

        #[cfg(feature = "UIFindSession")]
        #[method_id(@__retain_semantics Other activeFindSession)]
        pub unsafe fn activeFindSession(&self) -> Option<Retained<UIFindSession>>;

        #[method_id(@__retain_semantics Other searchText)]
        pub unsafe fn searchText(&self) -> Option<Retained<NSString>>;

        #[method(setSearchText:)]
        pub unsafe fn setSearchText(&self, search_text: Option<&NSString>);

        #[method_id(@__retain_semantics Other replacementText)]
        pub unsafe fn replacementText(&self) -> Option<Retained<NSString>>;

        #[method(setReplacementText:)]
        pub unsafe fn setReplacementText(&self, replacement_text: Option<&NSString>);

        #[cfg(all(feature = "UIMenu", feature = "UIMenuElement", feature = "block2"))]
        #[method(optionsMenuProvider)]
        pub unsafe fn optionsMenuProvider(
            &self,
        ) -> *mut block2::Block<dyn Fn(NonNull<NSArray<UIMenuElement>>) -> *mut UIMenu>;

        #[cfg(all(feature = "UIMenu", feature = "UIMenuElement", feature = "block2"))]
        #[method(setOptionsMenuProvider:)]
        pub unsafe fn setOptionsMenuProvider(
            &self,
            options_menu_provider: Option<
                &block2::Block<dyn Fn(NonNull<NSArray<UIMenuElement>>) -> *mut UIMenu>,
            >,
        );

        #[method_id(@__retain_semantics Other delegate)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn UIFindInteractionDelegate>>>;

        #[method_id(@__retain_semantics Init initWithSessionDelegate:)]
        pub unsafe fn initWithSessionDelegate(
            this: Allocated<Self>,
            session_delegate: &ProtocolObject<dyn UIFindInteractionDelegate>,
        ) -> Retained<Self>;

        #[method(presentFindNavigatorShowingReplace:)]
        pub unsafe fn presentFindNavigatorShowingReplace(&self, showing_replace: bool);

        #[method(dismissFindNavigator)]
        pub unsafe fn dismissFindNavigator(&self);

        #[method(findNext)]
        pub unsafe fn findNext(&self);

        #[method(findPrevious)]
        pub unsafe fn findPrevious(&self);

        #[method(updateResultCount)]
        pub unsafe fn updateResultCount(&self);

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    }
);