use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITextDropAction(pub NSUInteger);
impl UITextDropAction {
#[doc(alias = "UITextDropActionInsert")]
pub const Insert: Self = Self(0);
#[doc(alias = "UITextDropActionReplaceSelection")]
pub const ReplaceSelection: Self = Self(1);
#[doc(alias = "UITextDropActionReplaceAll")]
pub const ReplaceAll: Self = Self(2);
}
unsafe impl Encode for UITextDropAction {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for UITextDropAction {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITextDropProgressMode(pub NSUInteger);
impl UITextDropProgressMode {
#[doc(alias = "UITextDropProgressModeSystem")]
pub const System: Self = Self(0);
#[doc(alias = "UITextDropProgressModeCustom")]
pub const Custom: Self = Self(1);
}
unsafe impl Encode for UITextDropProgressMode {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for UITextDropProgressMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITextDropPerformer(pub NSUInteger);
impl UITextDropPerformer {
#[doc(alias = "UITextDropPerformerView")]
pub const View: Self = Self(0);
#[doc(alias = "UITextDropPerformerDelegate")]
pub const Delegate: Self = Self(1);
}
unsafe impl Encode for UITextDropPerformer {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for UITextDropPerformer {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(UIDropProposal, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UIDropInteraction")]
pub struct UITextDropProposal;
);
#[cfg(feature = "UIDropInteraction")]
extern_conformance!(
unsafe impl NSCopying for UITextDropProposal {}
);
#[cfg(feature = "UIDropInteraction")]
unsafe impl CopyingHelper for UITextDropProposal {
type Result = Self;
}
#[cfg(feature = "UIDropInteraction")]
extern_conformance!(
unsafe impl NSObjectProtocol for UITextDropProposal {}
);
#[cfg(feature = "UIDropInteraction")]
impl UITextDropProposal {
extern_methods!(
#[unsafe(method(dropAction))]
#[unsafe(method_family = none)]
pub fn dropAction(&self) -> UITextDropAction;
#[unsafe(method(setDropAction:))]
#[unsafe(method_family = none)]
pub fn setDropAction(&self, drop_action: UITextDropAction);
#[unsafe(method(dropProgressMode))]
#[unsafe(method_family = none)]
pub fn dropProgressMode(&self) -> UITextDropProgressMode;
#[unsafe(method(setDropProgressMode:))]
#[unsafe(method_family = none)]
pub fn setDropProgressMode(&self, drop_progress_mode: UITextDropProgressMode);
#[unsafe(method(useFastSameViewOperations))]
#[unsafe(method_family = none)]
pub fn useFastSameViewOperations(&self) -> bool;
#[unsafe(method(setUseFastSameViewOperations:))]
#[unsafe(method_family = none)]
pub fn setUseFastSameViewOperations(&self, use_fast_same_view_operations: bool);
#[unsafe(method(dropPerformer))]
#[unsafe(method_family = none)]
pub fn dropPerformer(&self) -> UITextDropPerformer;
#[unsafe(method(setDropPerformer:))]
#[unsafe(method_family = none)]
pub fn setDropPerformer(&self, drop_performer: UITextDropPerformer);
);
}
#[cfg(feature = "UIDropInteraction")]
impl UITextDropProposal {
extern_methods!(
#[unsafe(method(initWithDropOperation:))]
#[unsafe(method_family = init)]
pub fn initWithDropOperation(
this: Allocated<Self>,
operation: UIDropOperation,
) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}