use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIMessageConversationEntryDataKind(pub NSInteger);
impl UIMessageConversationEntryDataKind {
#[doc(alias = "UIMessageConversationEntryDataKindText")]
pub const Text: Self = Self(0);
#[doc(alias = "UIMessageConversationEntryDataKindAttachment")]
pub const Attachment: Self = Self(1);
#[doc(alias = "UIMessageConversationEntryDataKindOther")]
pub const Other: Self = Self(2);
}
unsafe impl Encode for UIMessageConversationEntryDataKind {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIMessageConversationEntryDataKind {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(UIConversationEntry, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UIConversationEntry")]
pub struct UIMessageConversationEntry;
);
#[cfg(feature = "UIConversationEntry")]
extern_conformance!(
unsafe impl NSObjectProtocol for UIMessageConversationEntry {}
);
#[cfg(feature = "UIConversationEntry")]
impl UIMessageConversationEntry {
extern_methods!(
#[unsafe(method(dataKind))]
#[unsafe(method_family = none)]
pub fn dataKind(&self) -> UIMessageConversationEntryDataKind;
#[unsafe(method(setDataKind:))]
#[unsafe(method_family = none)]
pub fn setDataKind(&self, data_kind: UIMessageConversationEntryDataKind);
#[unsafe(method(wasSentBySelf))]
#[unsafe(method_family = none)]
pub fn wasSentBySelf(&self) -> bool;
#[unsafe(method(setWasSentBySelf:))]
#[unsafe(method_family = none)]
pub fn setWasSentBySelf(&self, was_sent_by_self: bool);
);
}
#[cfg(feature = "UIConversationEntry")]
impl UIMessageConversationEntry {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
#[cfg(feature = "UIConversationEntry")]
impl DefaultRetained for UIMessageConversationEntry {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}