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::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-ui-kit")]
use objc2_ui_kit::*;

use crate::*;

extern_class!(
    /// The MSMessageTemplateLayout encapsulates properties used in the construction of UI
    /// representing a message using the default message layout template.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/messages/msmessagetemplatelayout?language=objc)
    #[unsafe(super(MSMessageLayout, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "MSMessageLayout")]
    pub struct MSMessageTemplateLayout;
);

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

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

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

#[cfg(feature = "MSMessageLayout")]
impl MSMessageTemplateLayout {
    extern_methods!(
        /// Text to be used as a caption related to the message content.
        #[unsafe(method(caption))]
        #[unsafe(method_family = none)]
        pub unsafe fn caption(&self) -> Option<Retained<NSString>>;

        /// Setter for [`caption`][Self::caption].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setCaption:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCaption(&self, caption: Option<&NSString>);

        /// Text to be used as a subcaption related to the message content.
        #[unsafe(method(subcaption))]
        #[unsafe(method_family = none)]
        pub unsafe fn subcaption(&self) -> Option<Retained<NSString>>;

        /// Setter for [`subcaption`][Self::subcaption].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSubcaption:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSubcaption(&self, subcaption: Option<&NSString>);

        /// Text to be drawn right aligned on the same line as the caption text.
        #[unsafe(method(trailingCaption))]
        #[unsafe(method_family = none)]
        pub unsafe fn trailingCaption(&self) -> Option<Retained<NSString>>;

        /// Setter for [`trailingCaption`][Self::trailingCaption].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTrailingCaption:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTrailingCaption(&self, trailing_caption: Option<&NSString>);

        /// Text to be drawn right aligned on the same line as the subcaption text.
        #[unsafe(method(trailingSubcaption))]
        #[unsafe(method_family = none)]
        pub unsafe fn trailingSubcaption(&self) -> Option<Retained<NSString>>;

        /// Setter for [`trailingSubcaption`][Self::trailingSubcaption].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTrailingSubcaption:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTrailingSubcaption(&self, trailing_subcaption: Option<&NSString>);

        #[cfg(feature = "objc2-ui-kit")]
        /// A UIImage object used to construct the message representation in the conversation transcript.
        ///
        /// When this property and the mediaURL property are both set, the mediaURL
        /// property will be ignored.
        #[unsafe(method(image))]
        #[unsafe(method_family = none)]
        pub unsafe fn image(&self) -> Option<Retained<UIImage>>;

        #[cfg(feature = "objc2-ui-kit")]
        /// Setter for [`image`][Self::image].
        #[unsafe(method(setImage:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setImage(&self, image: Option<&UIImage>);

        /// The URL to a media file used to construct the message representation in the conversation transcript.
        ///
        /// This must be a file URL, the data contained in the file must conform to
        /// kUTTypeImage or kUTTypeMovie. When image property and
        /// this property are both set, then this property will be ignored.
        #[unsafe(method(mediaFileURL))]
        #[unsafe(method_family = none)]
        pub unsafe fn mediaFileURL(&self) -> Option<Retained<NSURL>>;

        /// Setter for [`mediaFileURL`][Self::mediaFileURL].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setMediaFileURL:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMediaFileURL(&self, media_file_url: Option<&NSURL>);

        /// Title text associated with the image or media .
        #[unsafe(method(imageTitle))]
        #[unsafe(method_family = none)]
        pub unsafe fn imageTitle(&self) -> Option<Retained<NSString>>;

        /// Setter for [`imageTitle`][Self::imageTitle].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setImageTitle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setImageTitle(&self, image_title: Option<&NSString>);

        /// Subtitle text associated with the image or media .
        #[unsafe(method(imageSubtitle))]
        #[unsafe(method_family = none)]
        pub unsafe fn imageSubtitle(&self) -> Option<Retained<NSString>>;

        /// Setter for [`imageSubtitle`][Self::imageSubtitle].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setImageSubtitle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setImageSubtitle(&self, image_subtitle: Option<&NSString>);
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "MSMessageLayout")]
impl MSMessageTemplateLayout {
    extern_methods!(
        #[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>;
    );
}