objc2_messages/generated/
MSSticker.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/messages/mssticker?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct MSSticker;
14);
15
16extern_conformance!(
17    unsafe impl NSObjectProtocol for MSSticker {}
18);
19
20impl MSSticker {
21    extern_methods!(
22        #[unsafe(method(init))]
23        #[unsafe(method_family = init)]
24        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
25
26        /// Initializes a sticker with the contents of the URL and the localized description.
27        ///
28        /// Initializes a sticker with the contents of the URL and the localized description.
29        /// The specified file must have a maximum size of 500KB and must conform to kUTTypePNG, kUTTypeGIF
30        /// or kUTTypeJPEG. The image loaded from the file must be no smaller than 300px X 300px and must
31        /// be no larger 618px x 618px. This localized description string is limited to 150 Unicode
32        /// characters in length.
33        ///
34        /// Parameter `fileURL`: The URL from which to read sticker data.
35        ///
36        /// Parameter `localizedDescription`: A succinct localized string describing the sticker.
37        ///
38        /// Parameter `error`: If this method could not initialize a sticker, this will contain an NSError object describing the failure.
39        ///
40        /// Returns: A new sticker object or nil if the method could not initialize a sticker from the specified file and localizedDescription.
41        #[unsafe(method(initWithContentsOfFileURL:localizedDescription:error:_))]
42        #[unsafe(method_family = init)]
43        pub unsafe fn initWithContentsOfFileURL_localizedDescription_error(
44            this: Allocated<Self>,
45            file_url: &NSURL,
46            localized_description: &NSString,
47        ) -> Result<Retained<Self>, Retained<NSError>>;
48
49        /// The file URL to the Sticker was initialized with.
50        #[unsafe(method(imageFileURL))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn imageFileURL(&self) -> Retained<NSURL>;
53
54        /// A succinct localized string describing the sticker.
55        #[unsafe(method(localizedDescription))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn localizedDescription(&self) -> Retained<NSString>;
58    );
59}
60
61/// Methods declared on superclass `NSObject`.
62impl MSSticker {
63    extern_methods!(
64        #[unsafe(method(new))]
65        #[unsafe(method_family = new)]
66        pub unsafe fn new() -> Retained<Self>;
67    );
68}