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);
74
75extern_class!(
76 #[unsafe(super(UIViewController, UIResponder, NSObject))]
78 #[derive(Debug, PartialEq, Eq, Hash)]
79 #[cfg(feature = "objc2-ui-kit")]
80 pub struct MSMessagesAppViewController;
81);
82
83#[cfg(feature = "objc2-ui-kit")]
84extern_conformance!(
85 unsafe impl MSMessagesAppTranscriptPresentation for MSMessagesAppViewController {}
86);
87
88#[cfg(feature = "objc2-ui-kit")]
89extern_conformance!(
90 unsafe impl NSCoding for MSMessagesAppViewController {}
91);
92
93#[cfg(feature = "objc2-ui-kit")]
94extern_conformance!(
95 unsafe impl NSObjectProtocol for MSMessagesAppViewController {}
96);
97
98#[cfg(feature = "objc2-ui-kit")]
99extern_conformance!(
100 unsafe impl UIAppearanceContainer for MSMessagesAppViewController {}
101);
102
103#[cfg(feature = "objc2-ui-kit")]
104extern_conformance!(
105 unsafe impl UIContentContainer for MSMessagesAppViewController {}
106);
107
108#[cfg(feature = "objc2-ui-kit")]
109extern_conformance!(
110 unsafe impl UIFocusEnvironment for MSMessagesAppViewController {}
111);
112
113#[cfg(feature = "objc2-ui-kit")]
114extern_conformance!(
115 unsafe impl UIResponderStandardEditActions for MSMessagesAppViewController {}
116);
117
118#[cfg(feature = "objc2-ui-kit")]
119extern_conformance!(
120 unsafe impl UITraitEnvironment for MSMessagesAppViewController {}
121);
122
123#[cfg(feature = "objc2-ui-kit")]
124impl MSMessagesAppViewController {
125 extern_methods!(
126 #[cfg(feature = "MSConversation")]
127 #[unsafe(method(activeConversation))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn activeConversation(&self) -> Option<Retained<MSConversation>>;
131
132 #[unsafe(method(presentationStyle))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn presentationStyle(&self) -> MSMessagesAppPresentationStyle;
136
137 #[unsafe(method(presentationContext))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn presentationContext(&self) -> MSMessagesAppPresentationContext;
141
142 #[unsafe(method(requestPresentationStyle:))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn requestPresentationStyle(
150 &self,
151 presentation_style: MSMessagesAppPresentationStyle,
152 );
153
154 #[cfg(feature = "MSConversation")]
155 #[unsafe(method(willBecomeActiveWithConversation:))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn willBecomeActiveWithConversation(&self, conversation: &MSConversation);
161
162 #[cfg(feature = "MSConversation")]
163 #[unsafe(method(didBecomeActiveWithConversation:))]
167 #[unsafe(method_family = none)]
168 pub unsafe fn didBecomeActiveWithConversation(&self, conversation: &MSConversation);
169
170 #[cfg(feature = "MSConversation")]
171 #[unsafe(method(willResignActiveWithConversation:))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn willResignActiveWithConversation(&self, conversation: &MSConversation);
177
178 #[cfg(feature = "MSConversation")]
179 #[unsafe(method(didResignActiveWithConversation:))]
183 #[unsafe(method_family = none)]
184 pub unsafe fn didResignActiveWithConversation(&self, conversation: &MSConversation);
185 );
186}
187
188#[cfg(feature = "objc2-ui-kit")]
190impl MSMessagesAppViewController {
191 extern_methods!(
192 #[unsafe(method(initWithNibName:bundle:))]
193 #[unsafe(method_family = init)]
194 pub unsafe fn initWithNibName_bundle(
195 this: Allocated<Self>,
196 nib_name_or_nil: Option<&NSString>,
197 nib_bundle_or_nil: Option<&NSBundle>,
198 ) -> Retained<Self>;
199
200 #[unsafe(method(initWithCoder:))]
201 #[unsafe(method_family = init)]
202 pub unsafe fn initWithCoder(
203 this: Allocated<Self>,
204 coder: &NSCoder,
205 ) -> Option<Retained<Self>>;
206 );
207}
208
209#[cfg(feature = "objc2-ui-kit")]
211impl MSMessagesAppViewController {
212 extern_methods!(
213 #[unsafe(method(init))]
214 #[unsafe(method_family = init)]
215 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
216
217 #[unsafe(method(new))]
218 #[unsafe(method_family = new)]
219 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
220 );
221}
222
223#[cfg(feature = "objc2-ui-kit")]
225impl MSMessagesAppViewController {
226 extern_methods!(
227 #[unsafe(method(dismiss))]
231 #[unsafe(method_family = none)]
232 pub unsafe fn dismiss(&self);
233
234 #[cfg(all(feature = "MSConversation", feature = "MSMessage"))]
235 #[unsafe(method(willSelectMessage:conversation:))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn willSelectMessage_conversation(
245 &self,
246 message: &MSMessage,
247 conversation: &MSConversation,
248 );
249
250 #[cfg(all(feature = "MSConversation", feature = "MSMessage"))]
251 #[unsafe(method(didSelectMessage:conversation:))]
259 #[unsafe(method_family = none)]
260 pub unsafe fn didSelectMessage_conversation(
261 &self,
262 message: &MSMessage,
263 conversation: &MSConversation,
264 );
265
266 #[cfg(all(feature = "MSConversation", feature = "MSMessage"))]
267 #[unsafe(method(didReceiveMessage:conversation:))]
275 #[unsafe(method_family = none)]
276 pub unsafe fn didReceiveMessage_conversation(
277 &self,
278 message: &MSMessage,
279 conversation: &MSConversation,
280 );
281
282 #[cfg(all(feature = "MSConversation", feature = "MSMessage"))]
283 #[unsafe(method(didStartSendingMessage:conversation:))]
291 #[unsafe(method_family = none)]
292 pub unsafe fn didStartSendingMessage_conversation(
293 &self,
294 message: &MSMessage,
295 conversation: &MSConversation,
296 );
297
298 #[cfg(all(feature = "MSConversation", feature = "MSMessage"))]
299 #[unsafe(method(didCancelSendingMessage:conversation:))]
307 #[unsafe(method_family = none)]
308 pub unsafe fn didCancelSendingMessage_conversation(
309 &self,
310 message: &MSMessage,
311 conversation: &MSConversation,
312 );
313
314 #[unsafe(method(willTransitionToPresentationStyle:))]
320 #[unsafe(method_family = none)]
321 pub unsafe fn willTransitionToPresentationStyle(
322 &self,
323 presentation_style: MSMessagesAppPresentationStyle,
324 );
325
326 #[unsafe(method(didTransitionToPresentationStyle:))]
332 #[unsafe(method_family = none)]
333 pub unsafe fn didTransitionToPresentationStyle(
334 &self,
335 presentation_style: MSMessagesAppPresentationStyle,
336 );
337 );
338}