objc2-messages 0.3.2

Bindings to the Messages framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/messages/mssticker?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MSSticker;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for MSSticker {}
);

impl MSSticker {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        /// Initializes a sticker with the contents of the URL and the localized description.
        ///
        /// Initializes a sticker with the contents of the URL and the localized description.
        /// The specified file must have a maximum size of 500KB and must conform to kUTTypePNG, kUTTypeGIF
        /// or kUTTypeJPEG. The image loaded from the file must be no smaller than 300px X 300px and must
        /// be no larger 618px x 618px. This localized description string is limited to 150 Unicode
        /// characters in length.
        ///
        /// Parameter `fileURL`: The URL from which to read sticker data.
        ///
        /// Parameter `localizedDescription`: A succinct localized string describing the sticker.
        ///
        /// Parameter `error`: If this method could not initialize a sticker, this will contain an NSError object describing the failure.
        ///
        /// Returns: A new sticker object or nil if the method could not initialize a sticker from the specified file and localizedDescription.
        #[unsafe(method(initWithContentsOfFileURL:localizedDescription:error:_))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithContentsOfFileURL_localizedDescription_error(
            this: Allocated<Self>,
            file_url: &NSURL,
            localized_description: &NSString,
        ) -> Result<Retained<Self>, Retained<NSError>>;

        /// The file URL to the Sticker was initialized with.
        #[unsafe(method(imageFileURL))]
        #[unsafe(method_family = none)]
        pub unsafe fn imageFileURL(&self) -> Retained<NSURL>;

        /// A succinct localized string describing the sticker.
        #[unsafe(method(localizedDescription))]
        #[unsafe(method_family = none)]
        pub unsafe fn localizedDescription(&self) -> Retained<NSString>;
    );
}

/// Methods declared on superclass `NSObject`.
impl MSSticker {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}