objc2_ui_kit/generated/UITextSelectionHandleView.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 /// A view that represents a selection handle drawn at the edges of contiguous selection ranges.
12 ///
13 /// When a selection is ranged (i.e., length is > 0), and the device supports range adjustment via a gesture,
14 /// selection handles ("lollipops") are displayed at the edges of the contiguous selection (usually a UITextSelectionHighlightView).
15 ///
16 /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextselectionhandleview?language=objc)
17 #[cfg(feature = "UIView")]
18 pub unsafe trait UITextSelectionHandleView: UICoordinateSpace + MainThreadOnly {
19 #[cfg(feature = "UIGeometry")]
20 /// Controls which direction the handle is oriented. For example, NSDirectionalRectEdgeLeading indicates the handle is on the leading
21 /// edge, so the dot will be rendered on top.
22 #[unsafe(method(direction))]
23 #[unsafe(method_family = none)]
24 fn direction(&self) -> NSDirectionalRectEdge;
25
26 #[cfg(feature = "UIGeometry")]
27 /// Setter for [`direction`][Self::direction].
28 #[unsafe(method(setDirection:))]
29 #[unsafe(method_family = none)]
30 fn setDirection(&self, direction: NSDirectionalRectEdge);
31
32 /// Convenience accessor for
33 /// `direction`calculations.
34 #[unsafe(method(isVertical))]
35 #[unsafe(method_family = none)]
36 fn isVertical(&self) -> bool;
37
38 #[cfg(feature = "UIBezierPath")]
39 /// If applicable, a custom shape for the lollipop stem. Default is
40 /// `nil,`which results in a rounded rect style based on bounds.
41 #[unsafe(method(customShape))]
42 #[unsafe(method_family = none)]
43 fn customShape(&self) -> Option<Retained<UIBezierPath>>;
44
45 #[cfg(feature = "UIBezierPath")]
46 /// Setter for [`customShape`][Self::customShape].
47 #[unsafe(method(setCustomShape:))]
48 #[unsafe(method_family = none)]
49 fn setCustomShape(&self, custom_shape: Option<&UIBezierPath>);
50
51 #[cfg(feature = "objc2-core-foundation")]
52 /// Provides a preferred frame given
53 /// `rect`based on the current appearance configuration.
54 #[unsafe(method(preferredFrameForRect:))]
55 #[unsafe(method_family = none)]
56 fn preferredFrameForRect(&self, rect: CGRect) -> CGRect;
57 }
58);