objc2_ui_kit/generated/
UITextLoupeSession.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#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8
9use crate::*;
10
11extern_class!(
12    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextloupesession?language=objc)
13    #[unsafe(super(NSObject))]
14    #[thread_kind = MainThreadOnly]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct UITextLoupeSession;
17);
18
19extern_conformance!(
20    unsafe impl NSObjectProtocol for UITextLoupeSession {}
21);
22
23impl UITextLoupeSession {
24    extern_methods!(
25        #[cfg(all(
26            feature = "UIResponder",
27            feature = "UIView",
28            feature = "objc2-core-foundation"
29        ))]
30        /// Begins a loupe session at the specified point. The system will animate the presentation of the loupe, as well as its position and hierarchy.
31        ///
32        ///
33        /// Parameter `at`: The point in
34        /// `view's`coordinate space where the loupe should begin.
35        ///
36        /// Parameter `widgetView`: Optionally, a system-provided selection view that the animation can start from.
37        ///
38        /// Parameter `view`: The coordinate space that all subsequent movement updates are provided in.
39        #[unsafe(method(beginLoupeSessionAtPoint:fromSelectionWidgetView:inView:))]
40        #[unsafe(method_family = none)]
41        pub fn beginLoupeSessionAtPoint_fromSelectionWidgetView_inView(
42            point: CGPoint,
43            selection_widget: Option<&UIView>,
44            interaction_view: &UIView,
45        ) -> Option<Retained<Self>>;
46
47        #[cfg(feature = "objc2-core-foundation")]
48        /// Call this when a text selection gesture moves to a particular point.
49        ///
50        ///
51        /// Parameter `point`: The center point of the touch tracked by the gesture recognizer.
52        ///
53        /// Parameter `caretRect`: The current position of the caret/range handle. Pass in CGRectNull if there is no current selection/no caret rect visible.
54        ///
55        /// Parameter `trackingCaret`: Provide YES if the loupe should track the caret instead of the touch.
56        #[unsafe(method(moveToPoint:withCaretRect:trackingCaret:))]
57        #[unsafe(method_family = none)]
58        pub fn moveToPoint_withCaretRect_trackingCaret(
59            &self,
60            point: CGPoint,
61            caret_rect: CGRect,
62            tracks_caret: bool,
63        );
64
65        /// Invalidates the loupe session. Hides the loupe and cleans up transient state.
66        #[unsafe(method(invalidate))]
67        #[unsafe(method_family = none)]
68        pub fn invalidate(&self);
69    );
70}
71
72/// Methods declared on superclass `NSObject`.
73impl UITextLoupeSession {
74    extern_methods!(
75        #[unsafe(method(init))]
76        #[unsafe(method_family = init)]
77        pub fn init(this: Allocated<Self>) -> Retained<Self>;
78
79        #[unsafe(method(new))]
80        #[unsafe(method_family = new)]
81        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
82    );
83}