objc2_messages/generated/
MSMessagesAppViewController.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-ui-kit")]
10use objc2_ui_kit::*;
11
12use crate::*;
13
14#[repr(transparent)]
19#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
20pub struct MSMessagesAppPresentationStyle(pub NSUInteger);
21impl MSMessagesAppPresentationStyle {
22 #[doc(alias = "MSMessagesAppPresentationStyleCompact")]
23 pub const Compact: Self = Self(0);
24 #[doc(alias = "MSMessagesAppPresentationStyleExpanded")]
25 pub const Expanded: Self = Self(1);
26 #[doc(alias = "MSMessagesAppPresentationStyleTranscript")]
27 pub const Transcript: Self = Self(2);
28}
29
30unsafe impl Encode for MSMessagesAppPresentationStyle {
31 const ENCODING: Encoding = NSUInteger::ENCODING;
32}
33
34unsafe impl RefEncode for MSMessagesAppPresentationStyle {
35 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
36}
37
38#[repr(transparent)]
43#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
44pub struct MSMessagesAppPresentationContext(pub NSUInteger);
45impl MSMessagesAppPresentationContext {
46 #[doc(alias = "MSMessagesAppPresentationContextMessages")]
47 pub const Messages: Self = Self(0);
48 #[doc(alias = "MSMessagesAppPresentationContextMedia")]
49 pub const Media: Self = Self(1);
50}
51
52unsafe impl Encode for MSMessagesAppPresentationContext {
53 const ENCODING: Encoding = NSUInteger::ENCODING;
54}
55
56unsafe impl RefEncode for MSMessagesAppPresentationContext {
57 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
58}
59
60extern_protocol!(
61 pub unsafe trait MSMessagesAppTranscriptPresentation {
63 #[cfg(feature = "objc2-core-foundation")]
64 #[unsafe(method(contentSizeThatFits:))]
70 #[unsafe(method_family = none)]
71 unsafe fn contentSizeThatFits(&self, size: CGSize) -> CGSize;
72
73 #[cfg(feature = "objc2-ui-kit")]
74 #[unsafe(method(messageTintColor))]
78 #[unsafe(method_family = none)]
79 unsafe fn messageTintColor(&self) -> Option<Retained<UIColor>>;
80
81 #[cfg(feature = "objc2-core-foundation")]
82 #[unsafe(method(messageCornerRadius))]
86 #[unsafe(method_family = none)]
87 unsafe fn messageCornerRadius(&self) -> CGFloat;
88
89 #[unsafe(method(invalidateMessageTintColor))]
93 #[unsafe(method_family = none)]
94 unsafe fn invalidateMessageTintColor(&self);
95 }
96);
97
98extern_class!(
99 #[unsafe(super(UIViewController, UIResponder, NSObject))]
101 #[derive(Debug, PartialEq, Eq, Hash)]
102 #[cfg(feature = "objc2-ui-kit")]
103 pub struct MSMessagesAppViewController;
104);
105
106#[cfg(feature = "objc2-ui-kit")]
107extern_conformance!(
108 unsafe impl MSMessagesAppTranscriptPresentation for MSMessagesAppViewController {}
109);
110
111#[cfg(feature = "objc2-ui-kit")]
112extern_conformance!(
113 unsafe impl NSCoding for MSMessagesAppViewController {}
114);
115
116#[cfg(feature = "objc2-ui-kit")]
117extern_conformance!(
118 unsafe impl NSObjectProtocol for MSMessagesAppViewController {}
119);
120
121#[cfg(feature = "objc2-ui-kit")]
122extern_conformance!(
123 unsafe impl UIAppearanceContainer for MSMessagesAppViewController {}
124);
125
126#[cfg(feature = "objc2-ui-kit")]
127extern_conformance!(
128 unsafe impl UIContentContainer for MSMessagesAppViewController {}
129);
130
131#[cfg(feature = "objc2-ui-kit")]
132extern_conformance!(
133 unsafe impl UIFocusEnvironment for MSMessagesAppViewController {}
134);
135
136#[cfg(feature = "objc2-ui-kit")]
137extern_conformance!(
138 unsafe impl UIResponderStandardEditActions for MSMessagesAppViewController {}
139);
140
141#[cfg(feature = "objc2-ui-kit")]
142extern_conformance!(
143 unsafe impl UITraitEnvironment for MSMessagesAppViewController {}
144);
145
146#[cfg(feature = "objc2-ui-kit")]
147impl MSMessagesAppViewController {
148 extern_methods!(
149 #[cfg(feature = "MSConversation")]
150 #[unsafe(method(activeConversation))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn activeConversation(&self) -> Option<Retained<MSConversation>>;
154
155 #[unsafe(method(presentationStyle))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn presentationStyle(&self) -> MSMessagesAppPresentationStyle;
159
160 #[unsafe(method(presentationContext))]
162 #[unsafe(method_family = none)]
163 pub unsafe fn presentationContext(&self) -> MSMessagesAppPresentationContext;
164
165 #[unsafe(method(requestPresentationStyle:))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn requestPresentationStyle(
173 &self,
174 presentation_style: MSMessagesAppPresentationStyle,
175 );
176
177 #[cfg(feature = "MSConversation")]
178 #[unsafe(method(willBecomeActiveWithConversation:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn willBecomeActiveWithConversation(&self, conversation: &MSConversation);
184
185 #[cfg(feature = "MSConversation")]
186 #[unsafe(method(didBecomeActiveWithConversation:))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn didBecomeActiveWithConversation(&self, conversation: &MSConversation);
192
193 #[cfg(feature = "MSConversation")]
194 #[unsafe(method(willResignActiveWithConversation:))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn willResignActiveWithConversation(&self, conversation: &MSConversation);
200
201 #[cfg(feature = "MSConversation")]
202 #[unsafe(method(didResignActiveWithConversation:))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn didResignActiveWithConversation(&self, conversation: &MSConversation);
208 );
209}
210
211#[cfg(feature = "objc2-ui-kit")]
213impl MSMessagesAppViewController {
214 extern_methods!(
215 #[unsafe(method(initWithNibName:bundle:))]
216 #[unsafe(method_family = init)]
217 pub unsafe fn initWithNibName_bundle(
218 this: Allocated<Self>,
219 nib_name_or_nil: Option<&NSString>,
220 nib_bundle_or_nil: Option<&NSBundle>,
221 ) -> Retained<Self>;
222
223 #[unsafe(method(initWithCoder:))]
227 #[unsafe(method_family = init)]
228 pub unsafe fn initWithCoder(
229 this: Allocated<Self>,
230 coder: &NSCoder,
231 ) -> Option<Retained<Self>>;
232 );
233}
234
235#[cfg(feature = "objc2-ui-kit")]
237impl MSMessagesAppViewController {
238 extern_methods!(
239 #[unsafe(method(init))]
240 #[unsafe(method_family = init)]
241 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
242
243 #[unsafe(method(new))]
244 #[unsafe(method_family = new)]
245 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
246 );
247}
248
249#[cfg(feature = "objc2-ui-kit")]
251impl MSMessagesAppViewController {
252 extern_methods!(
253 #[unsafe(method(dismiss))]
257 #[unsafe(method_family = none)]
258 pub unsafe fn dismiss(&self);
259
260 #[cfg(all(feature = "MSConversation", feature = "MSMessage"))]
261 #[unsafe(method(willSelectMessage:conversation:))]
269 #[unsafe(method_family = none)]
270 pub unsafe fn willSelectMessage_conversation(
271 &self,
272 message: &MSMessage,
273 conversation: &MSConversation,
274 );
275
276 #[cfg(all(feature = "MSConversation", feature = "MSMessage"))]
277 #[unsafe(method(didSelectMessage:conversation:))]
285 #[unsafe(method_family = none)]
286 pub unsafe fn didSelectMessage_conversation(
287 &self,
288 message: &MSMessage,
289 conversation: &MSConversation,
290 );
291
292 #[cfg(all(feature = "MSConversation", feature = "MSMessage"))]
293 #[unsafe(method(didReceiveMessage:conversation:))]
301 #[unsafe(method_family = none)]
302 pub unsafe fn didReceiveMessage_conversation(
303 &self,
304 message: &MSMessage,
305 conversation: &MSConversation,
306 );
307
308 #[cfg(all(feature = "MSConversation", feature = "MSMessage"))]
309 #[unsafe(method(didStartSendingMessage:conversation:))]
317 #[unsafe(method_family = none)]
318 pub unsafe fn didStartSendingMessage_conversation(
319 &self,
320 message: &MSMessage,
321 conversation: &MSConversation,
322 );
323
324 #[cfg(all(feature = "MSConversation", feature = "MSMessage"))]
325 #[unsafe(method(didCancelSendingMessage:conversation:))]
333 #[unsafe(method_family = none)]
334 pub unsafe fn didCancelSendingMessage_conversation(
335 &self,
336 message: &MSMessage,
337 conversation: &MSConversation,
338 );
339
340 #[unsafe(method(willTransitionToPresentationStyle:))]
346 #[unsafe(method_family = none)]
347 pub unsafe fn willTransitionToPresentationStyle(
348 &self,
349 presentation_style: MSMessagesAppPresentationStyle,
350 );
351
352 #[unsafe(method(didTransitionToPresentationStyle:))]
358 #[unsafe(method_family = none)]
359 pub unsafe fn didTransitionToPresentationStyle(
360 &self,
361 presentation_style: MSMessagesAppPresentationStyle,
362 );
363 );
364}