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