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        ///
48        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
49        #[unsafe(method(setCaption:))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn setCaption(&self, caption: Option<&NSString>);
52
53        /// Text to be used as a subcaption related to the message content.
54        #[unsafe(method(subcaption))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn subcaption(&self) -> Option<Retained<NSString>>;
57
58        /// Setter for [`subcaption`][Self::subcaption].
59        ///
60        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
61        #[unsafe(method(setSubcaption:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn setSubcaption(&self, subcaption: Option<&NSString>);
64
65        /// Text to be drawn right aligned on the same line as the caption text.
66        #[unsafe(method(trailingCaption))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn trailingCaption(&self) -> Option<Retained<NSString>>;
69
70        /// Setter for [`trailingCaption`][Self::trailingCaption].
71        ///
72        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
73        #[unsafe(method(setTrailingCaption:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn setTrailingCaption(&self, trailing_caption: Option<&NSString>);
76
77        /// Text to be drawn right aligned on the same line as the subcaption text.
78        #[unsafe(method(trailingSubcaption))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn trailingSubcaption(&self) -> Option<Retained<NSString>>;
81
82        /// Setter for [`trailingSubcaption`][Self::trailingSubcaption].
83        ///
84        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
85        #[unsafe(method(setTrailingSubcaption:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn setTrailingSubcaption(&self, trailing_subcaption: Option<&NSString>);
88
89        #[cfg(feature = "objc2-ui-kit")]
90        /// A UIImage object used to construct the message representation in the conversation transcript.
91        ///
92        /// When this property and the mediaURL property are both set, the mediaURL
93        /// property will be ignored.
94        #[unsafe(method(image))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
97
98        #[cfg(feature = "objc2-ui-kit")]
99        /// Setter for [`image`][Self::image].
100        #[unsafe(method(setImage:))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn setImage(&self, image: Option<&UIImage>);
103
104        /// The URL to a media file used to construct the message representation in the conversation transcript.
105        ///
106        /// This must be a file URL, the data contained in the file must conform to
107        /// kUTTypeImage or kUTTypeMovie. When image property and
108        /// this property are both set, then this property will be ignored.
109        #[unsafe(method(mediaFileURL))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn mediaFileURL(&self) -> Option<Retained<NSURL>>;
112
113        /// Setter for [`mediaFileURL`][Self::mediaFileURL].
114        ///
115        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
116        #[unsafe(method(setMediaFileURL:))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn setMediaFileURL(&self, media_file_url: Option<&NSURL>);
119
120        /// Title text associated with the image or media .
121        #[unsafe(method(imageTitle))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn imageTitle(&self) -> Option<Retained<NSString>>;
124
125        /// Setter for [`imageTitle`][Self::imageTitle].
126        ///
127        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
128        #[unsafe(method(setImageTitle:))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn setImageTitle(&self, image_title: Option<&NSString>);
131
132        /// Subtitle text associated with the image or media .
133        #[unsafe(method(imageSubtitle))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn imageSubtitle(&self) -> Option<Retained<NSString>>;
136
137        /// Setter for [`imageSubtitle`][Self::imageSubtitle].
138        ///
139        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
140        #[unsafe(method(setImageSubtitle:))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn setImageSubtitle(&self, image_subtitle: Option<&NSString>);
143    );
144}
145
146/// Methods declared on superclass `NSObject`.
147#[cfg(feature = "MSMessageLayout")]
148impl MSMessageTemplateLayout {
149    extern_methods!(
150        #[unsafe(method(init))]
151        #[unsafe(method_family = init)]
152        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
153
154        #[unsafe(method(new))]
155        #[unsafe(method_family = new)]
156        pub unsafe fn new() -> Retained<Self>;
157    );
158}