objc2-app-kit 0.3.2

Bindings to the AppKit 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::*;
#[cfg(feature = "objc2-uniform-type-identifiers")]
#[cfg(target_vendor = "apple")]
use objc2_uniform_type_identifiers::*;

use crate::*;

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

unsafe impl Send for NSAdaptiveImageGlyph {}

unsafe impl Sync for NSAdaptiveImageGlyph {}

extern_conformance!(
    unsafe impl NSCoding for NSAdaptiveImageGlyph {}
);

extern_conformance!(
    unsafe impl NSCopying for NSAdaptiveImageGlyph {}
);

unsafe impl CopyingHelper for NSAdaptiveImageGlyph {
    type Result = Self;
}

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

extern_conformance!(
    unsafe impl NSSecureCoding for NSAdaptiveImageGlyph {}
);

impl NSAdaptiveImageGlyph {
    extern_methods!(
        #[unsafe(method(initWithImageContent:))]
        #[unsafe(method_family = init)]
        pub fn initWithImageContent(
            this: Allocated<Self>,
            image_content: &NSData,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;

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

        #[unsafe(method(imageContent))]
        #[unsafe(method_family = none)]
        pub fn imageContent(&self) -> Retained<NSData>;

        #[unsafe(method(contentIdentifier))]
        #[unsafe(method_family = none)]
        pub fn contentIdentifier(&self) -> Retained<NSString>;

        #[unsafe(method(contentDescription))]
        #[unsafe(method_family = none)]
        pub fn contentDescription(&self) -> Retained<NSString>;

        #[cfg(feature = "objc2-uniform-type-identifiers")]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(contentType))]
        #[unsafe(method_family = none)]
        pub fn contentType() -> Retained<UTType>;
    );
}

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

mod private_NSAttributedStringAdaptiveImageGlyphConveniences {
    pub trait Sealed {}
}

/// Category on [`NSAttributedString`].
pub unsafe trait NSAttributedStringAdaptiveImageGlyphConveniences:
    ClassType + Sized + private_NSAttributedStringAdaptiveImageGlyphConveniences::Sealed
{
    extern_methods!(
        /// # Safety
        ///
        /// `attributes` generic should be of the correct type.
        #[unsafe(method(attributedStringWithAdaptiveImageGlyph:attributes:))]
        #[unsafe(method_family = none)]
        unsafe fn attributedStringWithAdaptiveImageGlyph_attributes(
            adaptive_image_glyph: &NSAdaptiveImageGlyph,
            attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
        ) -> Retained<Self>;
    );
}

impl private_NSAttributedStringAdaptiveImageGlyphConveniences::Sealed for NSAttributedString {}
unsafe impl NSAttributedStringAdaptiveImageGlyphConveniences for NSAttributedString {}