objc2_messages/generated/
MSStickerView.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10use objc2_quartz_core::*;
11#[cfg(feature = "objc2-ui-kit")]
12use objc2_ui_kit::*;
13
14use crate::*;
15
16extern_class!(
17    /// A UIView subclass that can display sticker assets.
18    ///
19    /// This class is a UIView subclass intended to display stickers. It provides
20    /// drag and drop functionality so that user may drag the displayed sticker from this
21    /// view and place it in the Messages transcript.
22    ///
23    /// See also [Apple's documentation](https://developer.apple.com/documentation/messages/msstickerview?language=objc)
24    #[unsafe(super(UIView, UIResponder, NSObject))]
25    #[derive(Debug, PartialEq, Eq, Hash)]
26    #[cfg(feature = "objc2-ui-kit")]
27    pub struct MSStickerView;
28);
29
30#[cfg(all(feature = "objc2-quartz-core", feature = "objc2-ui-kit"))]
31extern_conformance!(
32    unsafe impl CALayerDelegate for MSStickerView {}
33);
34
35#[cfg(feature = "objc2-ui-kit")]
36extern_conformance!(
37    unsafe impl NSCoding for MSStickerView {}
38);
39
40#[cfg(feature = "objc2-ui-kit")]
41extern_conformance!(
42    unsafe impl NSObjectProtocol for MSStickerView {}
43);
44
45#[cfg(feature = "objc2-ui-kit")]
46extern_conformance!(
47    unsafe impl UIAppearance for MSStickerView {}
48);
49
50#[cfg(feature = "objc2-ui-kit")]
51extern_conformance!(
52    unsafe impl UIAppearanceContainer for MSStickerView {}
53);
54
55#[cfg(feature = "objc2-ui-kit")]
56extern_conformance!(
57    unsafe impl UICoordinateSpace for MSStickerView {}
58);
59
60#[cfg(feature = "objc2-ui-kit")]
61extern_conformance!(
62    unsafe impl UIDynamicItem for MSStickerView {}
63);
64
65#[cfg(feature = "objc2-ui-kit")]
66extern_conformance!(
67    unsafe impl UIFocusEnvironment for MSStickerView {}
68);
69
70#[cfg(feature = "objc2-ui-kit")]
71extern_conformance!(
72    unsafe impl UIFocusItem for MSStickerView {}
73);
74
75#[cfg(feature = "objc2-ui-kit")]
76extern_conformance!(
77    unsafe impl UIFocusItemContainer for MSStickerView {}
78);
79
80#[cfg(feature = "objc2-ui-kit")]
81extern_conformance!(
82    unsafe impl UIResponderStandardEditActions for MSStickerView {}
83);
84
85#[cfg(feature = "objc2-ui-kit")]
86extern_conformance!(
87    unsafe impl UITraitEnvironment for MSStickerView {}
88);
89
90#[cfg(feature = "objc2-ui-kit")]
91impl MSStickerView {
92    extern_methods!(
93        #[cfg(all(feature = "MSSticker", feature = "objc2-core-foundation"))]
94        /// Initializes a MSStickerView with a frame and a MSSticker conforming object to display.
95        #[unsafe(method(initWithFrame:sticker:))]
96        #[unsafe(method_family = init)]
97        pub unsafe fn initWithFrame_sticker(
98            this: Allocated<Self>,
99            frame: CGRect,
100            sticker: Option<&MSSticker>,
101        ) -> Retained<Self>;
102
103        #[cfg(feature = "MSSticker")]
104        /// The MSSticker object to display.
105        ///
106        /// Set this property to nil to remove the current sticker. Setting the
107        /// sticker property does not change the size of a MSStickerView. Call sizeToFit to
108        /// adjust the size of the view to match the sticker.
109        #[unsafe(method(sticker))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn sticker(&self) -> Option<Retained<MSSticker>>;
112
113        #[cfg(feature = "MSSticker")]
114        /// Setter for [`sticker`][Self::sticker].
115        #[unsafe(method(setSticker:))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn setSticker(&self, sticker: Option<&MSSticker>);
118
119        /// The amount of time it takes to go through one cycle of the sticker animation.
120        #[unsafe(method(animationDuration))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn animationDuration(&self) -> NSTimeInterval;
123
124        /// Starts animating the sticker in the receiver.
125        ///
126        /// This method always starts the animation from the first frame.
127        #[unsafe(method(startAnimating))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn startAnimating(&self);
130
131        /// Stops animating the sticker in the receiver.
132        #[unsafe(method(stopAnimating))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn stopAnimating(&self);
135
136        /// Returns a Boolean value indicating whether the animation is running.
137        #[unsafe(method(isAnimating))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn isAnimating(&self) -> bool;
140    );
141}
142
143/// Methods declared on superclass `UIView`.
144#[cfg(feature = "objc2-ui-kit")]
145impl MSStickerView {
146    extern_methods!(
147        #[cfg(feature = "objc2-core-foundation")]
148        #[unsafe(method(initWithFrame:))]
149        #[unsafe(method_family = init)]
150        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
151
152        #[unsafe(method(initWithCoder:))]
153        #[unsafe(method_family = init)]
154        pub unsafe fn initWithCoder(
155            this: Allocated<Self>,
156            coder: &NSCoder,
157        ) -> Option<Retained<Self>>;
158    );
159}
160
161/// Methods declared on superclass `NSObject`.
162#[cfg(feature = "objc2-ui-kit")]
163impl MSStickerView {
164    extern_methods!(
165        #[unsafe(method(init))]
166        #[unsafe(method_family = init)]
167        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
168
169        #[unsafe(method(new))]
170        #[unsafe(method_family = new)]
171        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
172    );
173}