objc2_ui_kit/generated/
UITextDragPreviewRenderer.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::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextdragpreviewrenderer?language=objc)
14    #[unsafe(super(NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct UITextDragPreviewRenderer;
18);
19
20extern_conformance!(
21    unsafe impl NSObjectProtocol for UITextDragPreviewRenderer {}
22);
23
24impl UITextDragPreviewRenderer {
25    extern_methods!(
26        #[cfg(feature = "NSLayoutManager")]
27        #[unsafe(method(initWithLayoutManager:range:))]
28        #[unsafe(method_family = init)]
29        pub fn initWithLayoutManager_range(
30            this: Allocated<Self>,
31            layout_manager: &NSLayoutManager,
32            range: NSRange,
33        ) -> Retained<Self>;
34
35        #[cfg(feature = "NSLayoutManager")]
36        #[unsafe(method(initWithLayoutManager:range:unifyRects:))]
37        #[unsafe(method_family = init)]
38        pub fn initWithLayoutManager_range_unifyRects(
39            this: Allocated<Self>,
40            layout_manager: &NSLayoutManager,
41            range: NSRange,
42            unify_rects: bool,
43        ) -> Retained<Self>;
44
45        #[unsafe(method(new))]
46        #[unsafe(method_family = new)]
47        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
48
49        #[unsafe(method(init))]
50        #[unsafe(method_family = init)]
51        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
52
53        #[cfg(feature = "NSLayoutManager")]
54        #[unsafe(method(layoutManager))]
55        #[unsafe(method_family = none)]
56        pub fn layoutManager(&self) -> Retained<NSLayoutManager>;
57
58        #[cfg(feature = "UIImage")]
59        #[unsafe(method(image))]
60        #[unsafe(method_family = none)]
61        pub fn image(&self) -> Retained<UIImage>;
62
63        #[cfg(feature = "objc2-core-foundation")]
64        #[unsafe(method(firstLineRect))]
65        #[unsafe(method_family = none)]
66        pub fn firstLineRect(&self) -> CGRect;
67
68        #[cfg(feature = "objc2-core-foundation")]
69        #[unsafe(method(bodyRect))]
70        #[unsafe(method_family = none)]
71        pub fn bodyRect(&self) -> CGRect;
72
73        #[cfg(feature = "objc2-core-foundation")]
74        #[unsafe(method(lastLineRect))]
75        #[unsafe(method_family = none)]
76        pub fn lastLineRect(&self) -> CGRect;
77
78        #[cfg(feature = "objc2-core-foundation")]
79        /// # Safety
80        ///
81        /// - `first_line_rect` must be a valid pointer.
82        /// - `body_rect` must be a valid pointer.
83        /// - `last_line_rect` must be a valid pointer.
84        #[unsafe(method(adjustFirstLineRect:bodyRect:lastLineRect:textOrigin:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn adjustFirstLineRect_bodyRect_lastLineRect_textOrigin(
87            &self,
88            first_line_rect: NonNull<CGRect>,
89            body_rect: NonNull<CGRect>,
90            last_line_rect: NonNull<CGRect>,
91            origin: CGPoint,
92        );
93    );
94}