objc2_ui_kit/generated/
UITextCursorDropPositionAnimator.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::*;
6
7use crate::*;
8
9extern_class!(
10    /// Provides a mechanism for displaying and animating a temporary text cursor to indicate a drop location.
11    ///
12    /// For custom text view implementations that implement drag and drop functionality, use this animator providing either your own UITextCursorView
13    /// implementation or a concrete implementation to indicate at which point in your document the dropped item will be inserted. Using this animator provides
14    /// you with all of the default system animations for how the text cursor would behave.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextcursordroppositionanimator?language=objc)
17    #[unsafe(super(NSObject))]
18    #[thread_kind = MainThreadOnly]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    pub struct UITextCursorDropPositionAnimator;
21);
22
23unsafe impl NSObjectProtocol for UITextCursorDropPositionAnimator {}
24
25impl UITextCursorDropPositionAnimator {
26    extern_methods!(
27        #[cfg(all(
28            feature = "UIResponder",
29            feature = "UITextCursorView",
30            feature = "UIView"
31        ))]
32        /// The cursor view to be animated.
33        #[unsafe(method(cursorView))]
34        #[unsafe(method_family = none)]
35        pub unsafe fn cursorView(&self) -> Option<Retained<UIView>>;
36
37        #[cfg(all(
38            feature = "UIResponder",
39            feature = "UITextInput",
40            feature = "UITextInputTraits",
41            feature = "UIView"
42        ))]
43        /// The object that implements the UITextInput protocol, used to query for geometry information regarding cursor placement.
44        #[unsafe(method(textInput))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn textInput(&self) -> Option<Retained<UIView>>;
47
48        #[cfg(all(
49            feature = "UIResponder",
50            feature = "UITextCursorView",
51            feature = "UITextInput",
52            feature = "UITextInputTraits",
53            feature = "UIView"
54        ))]
55        /// Creates an animator for the given text cursor view implementation, and the document object that implements the UITextInput protocol.
56        #[unsafe(method(initWithTextCursorView:textInput:))]
57        #[unsafe(method_family = init)]
58        pub unsafe fn initWithTextCursorView_textInput(
59            this: Allocated<Self>,
60            cursor_view: Option<&UIView>,
61            text_input: Option<&UIView>,
62        ) -> Option<Retained<Self>>;
63
64        /// Controls the visibility of the cursor.
65        #[unsafe(method(setCursorVisible:animated:))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn setCursorVisible_animated(&self, visible: bool, animated: bool);
68
69        #[cfg(feature = "UITextInput")]
70        /// Controls the placement of the cursor, using
71        /// `textInput`and
72        /// `position`to compute the final frame for the cursor view.
73        #[unsafe(method(placeCursorAtPosition:animated:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn placeCursorAtPosition_animated(
76            &self,
77            position: Option<&UITextPosition>,
78            animated: bool,
79        );
80
81        #[cfg(feature = "block2")]
82        /// Optionally, provide an animation block or completion block to run alongside cursor appearance or position update animations.
83        #[unsafe(method(animateAlongsideChanges:completion:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn animateAlongsideChanges_completion(
86            &self,
87            animation: Option<&block2::Block<dyn Fn()>>,
88            completion: Option<&block2::Block<dyn Fn()>>,
89        );
90
91        #[unsafe(method(init))]
92        #[unsafe(method_family = init)]
93        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
94    );
95}
96
97/// Methods declared on superclass `NSObject`.
98impl UITextCursorDropPositionAnimator {
99    extern_methods!(
100        #[unsafe(method(new))]
101        #[unsafe(method_family = new)]
102        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
103    );
104}