objc2-mail-kit 0.3.2

Bindings to the MailKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/mailkit/memessageactionmessagecolor?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MEMessageActionMessageColor(pub NSInteger);
impl MEMessageActionMessageColor {
    #[doc(alias = "MEMessageActionMessageColorNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "MEMessageActionMessageColorGreen")]
    pub const Green: Self = Self(1);
    #[doc(alias = "MEMessageActionMessageColorYellow")]
    pub const Yellow: Self = Self(2);
    #[doc(alias = "MEMessageActionMessageColorOrange")]
    pub const Orange: Self = Self(3);
    #[doc(alias = "MEMessageActionMessageColorRed")]
    pub const Red: Self = Self(4);
    #[doc(alias = "MEMessageActionMessageColorPurple")]
    pub const Purple: Self = Self(5);
    #[doc(alias = "MEMessageActionMessageColorBlue")]
    pub const Blue: Self = Self(6);
    #[doc(alias = "MEMessageActionMessageColorGray")]
    pub const Gray: Self = Self(7);
}

unsafe impl Encode for MEMessageActionMessageColor {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for MEMessageActionMessageColor {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/mailkit/memessageactionflag?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MEMessageActionFlag(pub NSInteger);
impl MEMessageActionFlag {
    #[doc(alias = "MEMessageActionFlagNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "MEMessageActionFlagDefaultColor")]
    pub const DefaultColor: Self = Self(1);
    #[doc(alias = "MEMessageActionFlagRed")]
    pub const Red: Self = Self(2);
    #[doc(alias = "MEMessageActionFlagOrange")]
    pub const Orange: Self = Self(3);
    #[doc(alias = "MEMessageActionFlagYellow")]
    pub const Yellow: Self = Self(4);
    #[doc(alias = "MEMessageActionFlagGreen")]
    pub const Green: Self = Self(5);
    #[doc(alias = "MEMessageActionFlagBlue")]
    pub const Blue: Self = Self(6);
    #[doc(alias = "MEMessageActionFlagPurple")]
    pub const Purple: Self = Self(7);
    #[doc(alias = "MEMessageActionFlagGray")]
    pub const Gray: Self = Self(8);
}

unsafe impl Encode for MEMessageActionFlag {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for MEMessageActionFlag {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// An action that can be performed on a mail message.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mailkit/memessageaction?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MEMessageAction;
);

extern_conformance!(
    unsafe impl NSCoding for MEMessageAction {}
);

extern_conformance!(
    unsafe impl NSObjectProtocol for MEMessageAction {}
);

extern_conformance!(
    unsafe impl NSSecureCoding for MEMessageAction {}
);

impl MEMessageAction {
    extern_methods!(
        /// Moves the mail message to the user's trash mailbox for the account.
        #[unsafe(method(moveToTrashAction))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveToTrashAction() -> Retained<MEMessageAction>;

        /// Moves the mail message to the user's archive mailbox for the account.
        #[unsafe(method(moveToArchiveAction))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveToArchiveAction() -> Retained<MEMessageAction>;

        /// Moves the mail message to the user's junk mailbox for the account.
        #[unsafe(method(moveToJunkAction))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveToJunkAction() -> Retained<MEMessageAction>;

        /// Marks the mail message as read.
        #[unsafe(method(markAsReadAction))]
        #[unsafe(method_family = none)]
        pub unsafe fn markAsReadAction() -> Retained<MEMessageAction>;

        /// Marks the mail  message as unread.
        #[unsafe(method(markAsUnreadAction))]
        #[unsafe(method_family = none)]
        pub unsafe fn markAsUnreadAction() -> Retained<MEMessageAction>;

        /// Marks the message as flagged with the provided color.
        #[unsafe(method(flagActionWithFlag:))]
        #[unsafe(method_family = none)]
        pub unsafe fn flagActionWithFlag(flag: MEMessageActionFlag) -> Retained<Self>;

        /// Adds a color to the message when shown in the message list.
        #[unsafe(method(setBackgroundColorActionWithColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setBackgroundColorActionWithColor(
            color: MEMessageActionMessageColor,
        ) -> 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() -> Retained<Self>;
    );
}