objc2_messages/generated/
MSMessageTemplateLayout.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#[cfg(feature = "objc2-ui-kit")]
8use objc2_ui_kit::*;
9
10use crate::*;
11
12extern_class!(
13    /// The MSMessageTemplateLayout encapsulates properties used in the construction of UI
14    /// representing a message using the default message layout template.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/messages/msmessagetemplatelayout?language=objc)
17    #[unsafe(super(MSMessageLayout, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(feature = "MSMessageLayout")]
20    pub struct MSMessageTemplateLayout;
21);
22
23#[cfg(feature = "MSMessageLayout")]
24extern_conformance!(
25    unsafe impl NSCopying for MSMessageTemplateLayout {}
26);
27
28#[cfg(feature = "MSMessageLayout")]
29unsafe impl CopyingHelper for MSMessageTemplateLayout {
30    type Result = Self;
31}
32
33#[cfg(feature = "MSMessageLayout")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for MSMessageTemplateLayout {}
36);
37
38#[cfg(feature = "MSMessageLayout")]
39impl MSMessageTemplateLayout {
40    extern_methods!(
41        /// Text to be used as a caption related to the message content.
42        #[unsafe(method(caption))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn caption(&self) -> Option<Retained<NSString>>;
45
46        /// Setter for [`caption`][Self::caption].
47        #[unsafe(method(setCaption:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn setCaption(&self, caption: Option<&NSString>);
50
51        /// Text to be used as a subcaption related to the message content.
52        #[unsafe(method(subcaption))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn subcaption(&self) -> Option<Retained<NSString>>;
55
56        /// Setter for [`subcaption`][Self::subcaption].
57        #[unsafe(method(setSubcaption:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn setSubcaption(&self, subcaption: Option<&NSString>);
60
61        /// Text to be drawn right aligned on the same line as the caption text.
62        #[unsafe(method(trailingCaption))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn trailingCaption(&self) -> Option<Retained<NSString>>;
65
66        /// Setter for [`trailingCaption`][Self::trailingCaption].
67        #[unsafe(method(setTrailingCaption:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn setTrailingCaption(&self, trailing_caption: Option<&NSString>);
70
71        /// Text to be drawn right aligned on the same line as the subcaption text.
72        #[unsafe(method(trailingSubcaption))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn trailingSubcaption(&self) -> Option<Retained<NSString>>;
75
76        /// Setter for [`trailingSubcaption`][Self::trailingSubcaption].
77        #[unsafe(method(setTrailingSubcaption:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn setTrailingSubcaption(&self, trailing_subcaption: Option<&NSString>);
80
81        #[cfg(feature = "objc2-ui-kit")]
82        /// A UIImage object used to construct the message representation in the conversation transcript.
83        ///
84        /// When this property and the mediaURL property are both set, the mediaURL
85        /// property will be ignored.
86        #[unsafe(method(image))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
89
90        #[cfg(feature = "objc2-ui-kit")]
91        /// Setter for [`image`][Self::image].
92        #[unsafe(method(setImage:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setImage(&self, image: Option<&UIImage>);
95
96        /// The URL to a media file used to construct the message representation in the conversation transcript.
97        ///
98        /// This must be a file URL, the data contained in the file must conform to
99        /// kUTTypeImage or kUTTypeMovie. When image property and
100        /// this property are both set, then this property will be ignored.
101        #[unsafe(method(mediaFileURL))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn mediaFileURL(&self) -> Option<Retained<NSURL>>;
104
105        /// Setter for [`mediaFileURL`][Self::mediaFileURL].
106        #[unsafe(method(setMediaFileURL:))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn setMediaFileURL(&self, media_file_url: Option<&NSURL>);
109
110        /// Title text associated with the image or media .
111        #[unsafe(method(imageTitle))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn imageTitle(&self) -> Option<Retained<NSString>>;
114
115        /// Setter for [`imageTitle`][Self::imageTitle].
116        #[unsafe(method(setImageTitle:))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn setImageTitle(&self, image_title: Option<&NSString>);
119
120        /// Subtitle text associated with the image or media .
121        #[unsafe(method(imageSubtitle))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn imageSubtitle(&self) -> Option<Retained<NSString>>;
124
125        /// Setter for [`imageSubtitle`][Self::imageSubtitle].
126        #[unsafe(method(setImageSubtitle:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn setImageSubtitle(&self, image_subtitle: Option<&NSString>);
129    );
130}
131
132/// Methods declared on superclass `NSObject`.
133#[cfg(feature = "MSMessageLayout")]
134impl MSMessageTemplateLayout {
135    extern_methods!(
136        #[unsafe(method(init))]
137        #[unsafe(method_family = init)]
138        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
139
140        #[unsafe(method(new))]
141        #[unsafe(method_family = new)]
142        pub unsafe fn new() -> Retained<Self>;
143    );
144}