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
23extern_conformance!(
24    unsafe impl NSObjectProtocol for UITextCursorDropPositionAnimator {}
25);
26
27impl UITextCursorDropPositionAnimator {
28    extern_methods!(
29        #[cfg(all(
30            feature = "UIResponder",
31            feature = "UITextCursorView",
32            feature = "UIView"
33        ))]
34        /// The cursor view to be animated.
35        #[unsafe(method(cursorView))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn cursorView(&self) -> Option<Retained<UIView>>;
38
39        #[cfg(all(
40            feature = "UIResponder",
41            feature = "UITextInput",
42            feature = "UITextInputTraits",
43            feature = "UIView"
44        ))]
45        /// The object that implements the UITextInput protocol, used to query for geometry information regarding cursor placement.
46        #[unsafe(method(textInput))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn textInput(&self) -> Option<Retained<UIView>>;
49
50        #[cfg(all(
51            feature = "UIResponder",
52            feature = "UITextCursorView",
53            feature = "UITextInput",
54            feature = "UITextInputTraits",
55            feature = "UIView"
56        ))]
57        /// Creates an animator for the given text cursor view implementation, and the document object that implements the UITextInput protocol.
58        #[unsafe(method(initWithTextCursorView:textInput:))]
59        #[unsafe(method_family = init)]
60        pub unsafe fn initWithTextCursorView_textInput(
61            this: Allocated<Self>,
62            cursor_view: Option<&UIView>,
63            text_input: Option<&UIView>,
64        ) -> Option<Retained<Self>>;
65
66        /// Controls the visibility of the cursor.
67        #[unsafe(method(setCursorVisible:animated:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn setCursorVisible_animated(&self, visible: bool, animated: bool);
70
71        #[cfg(feature = "UITextInput")]
72        /// Controls the placement of the cursor, using
73        /// `textInput`and
74        /// `position`to compute the final frame for the cursor view.
75        #[unsafe(method(placeCursorAtPosition:animated:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn placeCursorAtPosition_animated(
78            &self,
79            position: Option<&UITextPosition>,
80            animated: bool,
81        );
82
83        #[cfg(feature = "block2")]
84        /// Optionally, provide an animation block or completion block to run alongside cursor appearance or position update animations.
85        #[unsafe(method(animateAlongsideChanges:completion:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn animateAlongsideChanges_completion(
88            &self,
89            animation: Option<&block2::DynBlock<dyn Fn()>>,
90            completion: Option<&block2::DynBlock<dyn Fn()>>,
91        );
92
93        #[unsafe(method(init))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
96    );
97}
98
99/// Methods declared on superclass `NSObject`.
100impl UITextCursorDropPositionAnimator {
101    extern_methods!(
102        #[unsafe(method(new))]
103        #[unsafe(method_family = new)]
104        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
105    );
106}