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 unsafe fn kind(&self) -> UIMailConversationEntryKind;
68
69        /// Setter for [`kind`][Self::kind].
70        #[unsafe(method(setKind:))]
71        #[unsafe(method_family = none)]
72        pub unsafe 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 unsafe fn responseSecondaryRecipientIdentifiers(&self) -> Retained<NSSet<NSString>>;
78
79        /// Setter for [`responseSecondaryRecipientIdentifiers`][Self::responseSecondaryRecipientIdentifiers].
80        #[unsafe(method(setResponseSecondaryRecipientIdentifiers:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn setResponseSecondaryRecipientIdentifiers(
83            &self,
84            response_secondary_recipient_identifiers: &NSSet<NSString>,
85        );
86    );
87}
88
89/// Methods declared on superclass `NSObject`.
90#[cfg(feature = "UIConversationEntry")]
91impl UIMailConversationEntry {
92    extern_methods!(
93        #[unsafe(method(init))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
96
97        #[unsafe(method(new))]
98        #[unsafe(method_family = new)]
99        pub unsafe fn new() -> Retained<Self>;
100    );
101}