objc2-messages 0.3.2

Bindings to the Messages 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::*;

extern_class!(
    /// The MSMessageLiveLayout is used to indicate a message should be rendered in Messages using an instance of `MSMessagesAppViewController` with a `presentationStyle` of `MSMessagesAppPresentationStyleTranscript`.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/messages/msmessagelivelayout?language=objc)
    #[unsafe(super(MSMessageLayout, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "MSMessageLayout")]
    pub struct MSMessageLiveLayout;
);

#[cfg(feature = "MSMessageLayout")]
extern_conformance!(
    unsafe impl NSCopying for MSMessageLiveLayout {}
);

#[cfg(feature = "MSMessageLayout")]
unsafe impl CopyingHelper for MSMessageLiveLayout {
    type Result = Self;
}

#[cfg(feature = "MSMessageLayout")]
extern_conformance!(
    unsafe impl NSObjectProtocol for MSMessageLiveLayout {}
);

#[cfg(feature = "MSMessageLayout")]
impl MSMessageLiveLayout {
    extern_methods!(
        #[cfg(feature = "MSMessageTemplateLayout")]
        /// Parameter `alternateLayout`: The alternate layout of the message. This layout will be used on devices that don't support live layout or don't have the iMessage app installed.
        #[unsafe(method(initWithAlternateLayout:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithAlternateLayout(
            this: Allocated<Self>,
            alternate_layout: &MSMessageTemplateLayout,
        ) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "MSMessageTemplateLayout")]
        /// The alternate layout of the message. This layout will be used on devices that don't support live layout or don't have the iMessage app installed.
        #[unsafe(method(alternateLayout))]
        #[unsafe(method_family = none)]
        pub unsafe fn alternateLayout(&self) -> Retained<MSMessageTemplateLayout>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "MSMessageLayout")]
impl MSMessageLiveLayout {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}