use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_protocol!(
pub unsafe trait UITextSelectionDisplayInteractionDelegate:
NSObjectProtocol + IsMainThreadOnly
{
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
#[optional]
#[method_id(@__retain_semantics Other selectionContainerViewBelowTextForSelectionDisplayInteraction:)]
unsafe fn selectionContainerViewBelowTextForSelectionDisplayInteraction(
&self,
interaction: &UITextSelectionDisplayInteraction,
) -> Option<Retained<UIView>>;
}
unsafe impl ProtocolType for dyn UITextSelectionDisplayInteractionDelegate {}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UITextSelectionDisplayInteraction;
unsafe impl ClassType for UITextSelectionDisplayInteraction {
type Super = NSObject;
type Mutability = MainThreadOnly;
}
);
unsafe impl NSObjectProtocol for UITextSelectionDisplayInteraction {}
#[cfg(feature = "UIInteraction")]
unsafe impl UIInteraction for UITextSelectionDisplayInteraction {}
extern_methods!(
unsafe impl UITextSelectionDisplayInteraction {
#[method(isActivated)]
pub unsafe fn isActivated(&self) -> bool;
#[method(setActivated:)]
pub unsafe fn setActivated(&self, activated: bool);
#[cfg(all(feature = "UITextInput", feature = "UITextInputTraits"))]
#[method_id(@__retain_semantics Other textInput)]
pub unsafe fn textInput(&self) -> Option<Retained<ProtocolObject<dyn UITextInput>>>;
#[method_id(@__retain_semantics Other delegate)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn UITextSelectionDisplayInteractionDelegate>>>;
#[cfg(all(
feature = "UIResponder",
feature = "UITextCursorView",
feature = "UIView"
))]
#[method_id(@__retain_semantics Other cursorView)]
pub unsafe fn cursorView(&self) -> Retained<UIView>;
#[cfg(all(
feature = "UIResponder",
feature = "UITextCursorView",
feature = "UIView"
))]
#[method(setCursorView:)]
pub unsafe fn setCursorView(&self, cursor_view: &UIView);
#[cfg(all(
feature = "UIResponder",
feature = "UITextSelectionHighlightView",
feature = "UIView"
))]
#[method_id(@__retain_semantics Other highlightView)]
pub unsafe fn highlightView(&self) -> Retained<UIView>;
#[cfg(all(
feature = "UIResponder",
feature = "UITextSelectionHighlightView",
feature = "UIView"
))]
#[method(setHighlightView:)]
pub unsafe fn setHighlightView(&self, highlight_view: &UIView);
#[cfg(all(
feature = "UIResponder",
feature = "UITextSelectionHandleView",
feature = "UIView"
))]
#[method_id(@__retain_semantics Other handleViews)]
pub unsafe fn handleViews(&self) -> Retained<NSArray<UIView>>;
#[cfg(all(
feature = "UIResponder",
feature = "UITextSelectionHandleView",
feature = "UIView"
))]
#[method(setHandleViews:)]
pub unsafe fn setHandleViews(&self, handle_views: &NSArray<UIView>);
#[cfg(all(feature = "UITextInput", feature = "UITextInputTraits"))]
#[method_id(@__retain_semantics Init initWithTextInput:delegate:)]
pub unsafe fn initWithTextInput_delegate(
this: Allocated<Self>,
text_input: &ProtocolObject<dyn UITextInput>,
delegate: &ProtocolObject<dyn UITextSelectionDisplayInteractionDelegate>,
) -> Retained<Self>;
#[method(layoutManagedSubviews)]
pub unsafe fn layoutManagedSubviews(&self);
#[method(setNeedsSelectionUpdate)]
pub unsafe fn setNeedsSelectionUpdate(&self);
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);