//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;

use crate::*;

extern_protocol!(
    /// A view that represents a selection handle drawn at the edges of contiguous selection ranges.
    ///
    /// When a selection is ranged (i.e., length is > 0), and the device supports range adjustment via a gesture,
    /// selection handles ("lollipops") are displayed at the edges of the contiguous selection (usually a UITextSelectionHighlightView).
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitextselectionhandleview?language=objc)
    #[cfg(feature = "UIView")]
    pub unsafe trait UITextSelectionHandleView: UICoordinateSpace + MainThreadOnly {
        #[cfg(feature = "UIGeometry")]
        /// Controls which direction the handle is oriented. For example, NSDirectionalRectEdgeLeading indicates the handle is on the leading
        /// edge, so the dot will be rendered on top.
        #[unsafe(method(direction))]
        #[unsafe(method_family = none)]
        fn direction(&self) -> NSDirectionalRectEdge;

        #[cfg(feature = "UIGeometry")]
        /// Setter for [`direction`][Self::direction].
        #[unsafe(method(setDirection:))]
        #[unsafe(method_family = none)]
        fn setDirection(&self, direction: NSDirectionalRectEdge);

        /// Convenience accessor for
        /// `direction`calculations.
        #[unsafe(method(isVertical))]
        #[unsafe(method_family = none)]
        fn isVertical(&self) -> bool;

        #[cfg(feature = "UIBezierPath")]
        /// If applicable, a custom shape for the lollipop stem. Default is
        /// `nil,`which results in a rounded rect style based on bounds.
        #[unsafe(method(customShape))]
        #[unsafe(method_family = none)]
        fn customShape(&self) -> Option<Retained<UIBezierPath>>;

        #[cfg(feature = "UIBezierPath")]
        /// Setter for [`customShape`][Self::customShape].
        #[unsafe(method(setCustomShape:))]
        #[unsafe(method_family = none)]
        fn setCustomShape(&self, custom_shape: Option<&UIBezierPath>);

        #[cfg(feature = "objc2-core-foundation")]
        /// Provides a preferred frame given
        /// `rect`based on the current appearance configuration.
        #[unsafe(method(preferredFrameForRect:))]
        #[unsafe(method_family = none)]
        fn preferredFrameForRect(&self, rect: CGRect) -> CGRect;
    }
);
