objc2_ui_kit/generated/
UIMailConversationEntry.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// A set of categories for an email.
11///
12/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uimailconversationentrykind?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct UIMailConversationEntryKind(pub NSInteger);
17impl UIMailConversationEntryKind {
18    /// The email does not fit in a specific category.
19    #[doc(alias = "UIMailConversationEntryKindNone")]
20    pub const None: Self = Self(0);
21    /// The email is personal correspondence.
22    #[doc(alias = "UIMailConversationEntryKindPersonal")]
23    pub const Personal: Self = Self(1);
24    /// The email contains a promotional offer.
25    #[doc(alias = "UIMailConversationEntryKindPromotion")]
26    pub const Promotion: Self = Self(2);
27    /// The email is related to social media.
28    #[doc(alias = "UIMailConversationEntryKindSocial")]
29    pub const Social: Self = Self(3);
30    /// The email is related to a purchase or transaction.
31    #[doc(alias = "UIMailConversationEntryKindTransaction")]
32    pub const Transaction: Self = Self(4);
33    /// The email is related to news or current events.
34    #[doc(alias = "UIMailConversationEntryKindNews")]
35    pub const News: Self = Self(5);
36}
37
38unsafe impl Encode for UIMailConversationEntryKind {
39    const ENCODING: Encoding = NSInteger::ENCODING;
40}
41
42unsafe impl RefEncode for UIMailConversationEntryKind {
43    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
44}
45
46extern_class!(
47    /// A class that represents a specific email in an email thread.
48    ///
49    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uimailconversationentry?language=objc)
50    #[unsafe(super(UIConversationEntry, NSObject))]
51    #[derive(Debug, PartialEq, Eq, Hash)]
52    #[cfg(feature = "UIConversationEntry")]
53    pub struct UIMailConversationEntry;
54);
55
56#[cfg(feature = "UIConversationEntry")]
57extern_conformance!(
58    unsafe impl NSObjectProtocol for UIMailConversationEntry {}
59);
60
61#[cfg(feature = "UIConversationEntry")]
62impl UIMailConversationEntry {
63    extern_methods!(
64        /// An item that reflects the category that describes an email.
65        #[unsafe(method(kind))]
66        #[unsafe(method_family = none)]
67        pub fn kind(&self) -> UIMailConversationEntryKind;
68
69        /// Setter for [`kind`][Self::kind].
70        #[unsafe(method(setKind:))]
71        #[unsafe(method_family = none)]
72        pub fn setKind(&self, kind: UIMailConversationEntryKind);
73
74        /// A set of strings that identifies the secondary recipients of the message, such as those in CC or BCC messages.
75        #[unsafe(method(responseSecondaryRecipientIdentifiers))]
76        #[unsafe(method_family = none)]
77        pub fn responseSecondaryRecipientIdentifiers(&self) -> Retained<NSSet<NSString>>;
78
79        /// Setter for [`responseSecondaryRecipientIdentifiers`][Self::responseSecondaryRecipientIdentifiers].
80        ///
81        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
82        #[unsafe(method(setResponseSecondaryRecipientIdentifiers:))]
83        #[unsafe(method_family = none)]
84        pub fn setResponseSecondaryRecipientIdentifiers(
85            &self,
86            response_secondary_recipient_identifiers: &NSSet<NSString>,
87        );
88    );
89}
90
91/// Methods declared on superclass `NSObject`.
92#[cfg(feature = "UIConversationEntry")]
93impl UIMailConversationEntry {
94    extern_methods!(
95        #[unsafe(method(init))]
96        #[unsafe(method_family = init)]
97        pub fn init(this: Allocated<Self>) -> Retained<Self>;
98
99        #[unsafe(method(new))]
100        #[unsafe(method_family = new)]
101        pub fn new() -> Retained<Self>;
102    );
103}
104
105#[cfg(feature = "UIConversationEntry")]
106impl DefaultRetained for UIMailConversationEntry {
107    #[inline]
108    fn default_retained() -> Retained<Self> {
109        Self::new()
110    }
111}