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

use crate::*;

extern "C" {
    /// ********************** Attributes ***********************
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/nsfontattributename?language=objc)
    pub static NSFontAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsparagraphstyleattributename?language=objc)
    pub static NSParagraphStyleAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsforegroundcolorattributename?language=objc)
    pub static NSForegroundColorAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsbackgroundcolorattributename?language=objc)
    pub static NSBackgroundColorAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsligatureattributename?language=objc)
    pub static NSLigatureAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nskernattributename?language=objc)
    pub static NSKernAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstrackingattributename?language=objc)
    pub static NSTrackingAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsstrikethroughstyleattributename?language=objc)
    pub static NSStrikethroughStyleAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsunderlinestyleattributename?language=objc)
    pub static NSUnderlineStyleAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsstrokecolorattributename?language=objc)
    pub static NSStrokeColorAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsstrokewidthattributename?language=objc)
    pub static NSStrokeWidthAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsshadowattributename?language=objc)
    pub static NSShadowAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexteffectattributename?language=objc)
    pub static NSTextEffectAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsattachmentattributename?language=objc)
    pub static NSAttachmentAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nslinkattributename?language=objc)
    pub static NSLinkAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsbaselineoffsetattributename?language=objc)
    pub static NSBaselineOffsetAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsunderlinecolorattributename?language=objc)
    pub static NSUnderlineColorAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsstrikethroughcolorattributename?language=objc)
    pub static NSStrikethroughColorAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nswritingdirectionattributename?language=objc)
    pub static NSWritingDirectionAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexthighlightstyleattributename?language=objc)
    pub static NSTextHighlightStyleAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexthighlightcolorschemeattributename?language=objc)
    pub static NSTextHighlightColorSchemeAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsadaptiveimageglyphattributename?language=objc)
    pub static NSAdaptiveImageGlyphAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nswritingtoolsexclusionattributename?language=objc)
    pub static NSWritingToolsExclusionAttributeName: &'static NSAttributedStringKey;
}

/// ********************** Attribute values ***********************
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/nsunderlinestyle?language=objc)
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSUnderlineStyle(pub NSInteger);
bitflags::bitflags! {
    impl NSUnderlineStyle: NSInteger {
        #[doc(alias = "NSUnderlineStyleNone")]
        const None = 0x00;
        #[doc(alias = "NSUnderlineStyleSingle")]
        const Single = 0x01;
        #[doc(alias = "NSUnderlineStyleThick")]
        const Thick = 0x02;
        #[doc(alias = "NSUnderlineStyleDouble")]
        const Double = 0x09;
        #[doc(alias = "NSUnderlineStylePatternSolid")]
        const PatternSolid = 0x0000;
        #[doc(alias = "NSUnderlineStylePatternDot")]
        const PatternDot = 0x0100;
        #[doc(alias = "NSUnderlineStylePatternDash")]
        const PatternDash = 0x0200;
        #[doc(alias = "NSUnderlineStylePatternDashDot")]
        const PatternDashDot = 0x0300;
        #[doc(alias = "NSUnderlineStylePatternDashDotDot")]
        const PatternDashDotDot = 0x0400;
        #[doc(alias = "NSUnderlineStyleByWord")]
        const ByWord = 0x8000;
    }
}

unsafe impl Encode for NSUnderlineStyle {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSUnderlineStyle {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nswritingdirectionformattype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSWritingDirectionFormatType(pub NSInteger);
impl NSWritingDirectionFormatType {
    #[doc(alias = "NSWritingDirectionEmbedding")]
    pub const Embedding: Self = Self(0 << 1);
    #[doc(alias = "NSWritingDirectionOverride")]
    pub const Override: Self = Self(1 << 1);
}

unsafe impl Encode for NSWritingDirectionFormatType {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSWritingDirectionFormatType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexteffectstyle?language=objc)
// NS_TYPED_ENUM
pub type NSTextEffectStyle = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexteffectletterpressstyle?language=objc)
    pub static NSTextEffectLetterpressStyle: &'static NSTextEffectStyle;
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexthighlightstyle?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSTextHighlightStyle = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexthighlightstyledefault?language=objc)
    pub static NSTextHighlightStyleDefault: &'static NSTextHighlightStyle;
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexthighlightcolorscheme?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSTextHighlightColorScheme = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexthighlightcolorschemedefault?language=objc)
    pub static NSTextHighlightColorSchemeDefault: &'static NSTextHighlightColorScheme;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexthighlightcolorschemepurple?language=objc)
    pub static NSTextHighlightColorSchemePurple: &'static NSTextHighlightColorScheme;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexthighlightcolorschemepink?language=objc)
    pub static NSTextHighlightColorSchemePink: &'static NSTextHighlightColorScheme;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexthighlightcolorschemeorange?language=objc)
    pub static NSTextHighlightColorSchemeOrange: &'static NSTextHighlightColorScheme;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexthighlightcolorschememint?language=objc)
    pub static NSTextHighlightColorSchemeMint: &'static NSTextHighlightColorScheme;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstexthighlightcolorschemeblue?language=objc)
    pub static NSTextHighlightColorSchemeBlue: &'static NSTextHighlightColorScheme;
}

mod private_NSAttributedStringAttributeFixing {
    pub trait Sealed {}
}

/// Category on [`NSMutableAttributedString`].
///
/// ********************** Attribute fixing ***********************
pub unsafe trait NSAttributedStringAttributeFixing:
    ClassType + Sized + private_NSAttributedStringAttributeFixing::Sealed
{
    extern_methods!(
        #[unsafe(method(fixAttributesInRange:))]
        #[unsafe(method_family = none)]
        fn fixAttributesInRange(&self, range: NSRange);
    );
}

impl private_NSAttributedStringAttributeFixing::Sealed for NSMutableAttributedString {}
unsafe impl NSAttributedStringAttributeFixing for NSMutableAttributedString {}

/// ********************** Document formats ***********************
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/nsattributedstringdocumenttype?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSAttributedStringDocumentType = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsplaintextdocumenttype?language=objc)
    pub static NSPlainTextDocumentType: &'static NSAttributedStringDocumentType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsrtftextdocumenttype?language=objc)
    pub static NSRTFTextDocumentType: &'static NSAttributedStringDocumentType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsrtfdtextdocumenttype?language=objc)
    pub static NSRTFDTextDocumentType: &'static NSAttributedStringDocumentType;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nshtmltextdocumenttype?language=objc)
    pub static NSHTMLTextDocumentType: &'static NSAttributedStringDocumentType;
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlayoutsectionkey?language=objc)
// NS_TYPED_ENUM
pub type NSTextLayoutSectionKey = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlayoutsectionorientation?language=objc)
    pub static NSTextLayoutSectionOrientation: &'static NSTextLayoutSectionKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlayoutsectionrange?language=objc)
    pub static NSTextLayoutSectionRange: &'static NSTextLayoutSectionKey;
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextscalingtype?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextScalingType(pub NSInteger);
impl NSTextScalingType {
    #[doc(alias = "NSTextScalingStandard")]
    pub const ScalingStandard: Self = Self(0);
    #[doc(alias = "NSTextScalingiOS")]
    pub const ScalingiOS: Self = Self(1);
}

unsafe impl Encode for NSTextScalingType {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSTextScalingType {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsattributedstringdocumentattributekey?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSAttributedStringDocumentAttributeKey = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsdocumenttypedocumentattribute?language=objc)
    pub static NSDocumentTypeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscharacterencodingdocumentattribute?language=objc)
    pub static NSCharacterEncodingDocumentAttribute:
        &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsdefaultattributesdocumentattribute?language=objc)
    pub static NSDefaultAttributesDocumentAttribute:
        &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nspapersizedocumentattribute?language=objc)
    pub static NSPaperSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsviewsizedocumentattribute?language=objc)
    pub static NSViewSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsviewzoomdocumentattribute?language=objc)
    pub static NSViewZoomDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsviewmodedocumentattribute?language=objc)
    pub static NSViewModeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsdefaultfontexcludeddocumentattribute?language=objc)
    pub static NSDefaultFontExcludedDocumentAttribute:
        &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsreadonlydocumentattribute?language=objc)
    pub static NSReadOnlyDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsbackgroundcolordocumentattribute?language=objc)
    pub static NSBackgroundColorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nshyphenationfactordocumentattribute?language=objc)
    pub static NSHyphenationFactorDocumentAttribute:
        &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsdefaulttabintervaldocumentattribute?language=objc)
    pub static NSDefaultTabIntervalDocumentAttribute:
        &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextlayoutsectionsattribute?language=objc)
    pub static NSTextLayoutSectionsAttribute: &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextscalingdocumentattribute?language=objc)
    pub static NSTextScalingDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nssourcetextscalingdocumentattribute?language=objc)
    pub static NSSourceTextScalingDocumentAttribute:
        &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscocoaversiondocumentattribute?language=objc)
    pub static NSCocoaVersionDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsattributedstringdocumentreadingoptionkey?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSAttributedStringDocumentReadingOptionKey = NSString;

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsdocumenttypedocumentoption?language=objc)
    pub static NSDocumentTypeDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsdefaultattributesdocumentoption?language=objc)
    pub static NSDefaultAttributesDocumentOption:
        &'static NSAttributedStringDocumentReadingOptionKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nscharacterencodingdocumentoption?language=objc)
    pub static NSCharacterEncodingDocumentOption:
        &'static NSAttributedStringDocumentReadingOptionKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstargettextscalingdocumentoption?language=objc)
    pub static NSTargetTextScalingDocumentOption:
        &'static NSAttributedStringDocumentReadingOptionKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nssourcetextscalingdocumentoption?language=objc)
    pub static NSSourceTextScalingDocumentOption:
        &'static NSAttributedStringDocumentReadingOptionKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextkit1listmarkerformatdocumentoption?language=objc)
    pub static NSTextKit1ListMarkerFormatDocumentOption:
        &'static NSAttributedStringDocumentReadingOptionKey;
}

mod private_NSAttributedStringDocumentFormats {
    pub trait Sealed {}
}

/// Category on [`NSAttributedString`].
pub unsafe trait NSAttributedStringDocumentFormats:
    ClassType + Sized + private_NSAttributedStringDocumentFormats::Sealed
{
    extern_methods!(
        /// # Safety
        ///
        /// - `options` generic should be of the correct type.
        /// - `dict` generic should be of the correct type.
        #[unsafe(method(initWithURL:options:documentAttributes:error:_))]
        #[unsafe(method_family = init)]
        unsafe fn initWithURL_options_documentAttributes_error(
            this: Allocated<Self>,
            url: &NSURL,
            options: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
            dict: Option<
                &mut Option<
                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
                >,
            >,
        ) -> Result<Retained<Self>, Retained<NSError>>;

        /// # Safety
        ///
        /// - `options` generic should be of the correct type.
        /// - `dict` generic should be of the correct type.
        #[unsafe(method(initWithData:options:documentAttributes:error:_))]
        #[unsafe(method_family = init)]
        unsafe fn initWithData_options_documentAttributes_error(
            this: Allocated<Self>,
            data: &NSData,
            options: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
            dict: Option<
                &mut Option<
                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
                >,
            >,
        ) -> Result<Retained<Self>, Retained<NSError>>;

        /// # Safety
        ///
        /// `dict` generic should be of the correct type.
        #[unsafe(method(dataFromRange:documentAttributes:error:_))]
        #[unsafe(method_family = none)]
        unsafe fn dataFromRange_documentAttributes_error(
            &self,
            range: NSRange,
            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
        ) -> Result<Retained<NSData>, Retained<NSError>>;

        /// # Safety
        ///
        /// `dict` generic should be of the correct type.
        #[unsafe(method(fileWrapperFromRange:documentAttributes:error:_))]
        #[unsafe(method_family = none)]
        unsafe fn fileWrapperFromRange_documentAttributes_error(
            &self,
            range: NSRange,
            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
        ) -> Result<Retained<NSFileWrapper>, Retained<NSError>>;
    );
}

impl private_NSAttributedStringDocumentFormats::Sealed for NSAttributedString {}
unsafe impl NSAttributedStringDocumentFormats for NSAttributedString {}

mod private_NSMutableAttributedStringDocumentFormats {
    pub trait Sealed {}
}

/// Category on [`NSMutableAttributedString`].
pub unsafe trait NSMutableAttributedStringDocumentFormats:
    ClassType + Sized + private_NSMutableAttributedStringDocumentFormats::Sealed
{
    extern_methods!(
        /// # Safety
        ///
        /// - `opts` generic should be of the correct type.
        /// - `dict` generic should be of the correct type.
        #[unsafe(method(readFromURL:options:documentAttributes:error:_))]
        #[unsafe(method_family = none)]
        unsafe fn readFromURL_options_documentAttributes_error(
            &self,
            url: &NSURL,
            opts: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
            dict: Option<
                &mut Option<
                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
                >,
            >,
        ) -> Result<(), Retained<NSError>>;

        /// # Safety
        ///
        /// - `opts` generic should be of the correct type.
        /// - `dict` generic should be of the correct type.
        #[unsafe(method(readFromData:options:documentAttributes:error:_))]
        #[unsafe(method_family = none)]
        unsafe fn readFromData_options_documentAttributes_error(
            &self,
            data: &NSData,
            opts: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
            dict: Option<
                &mut Option<
                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
                >,
            >,
        ) -> Result<(), Retained<NSError>>;
    );
}

impl private_NSMutableAttributedStringDocumentFormats::Sealed for NSMutableAttributedString {}
unsafe impl NSMutableAttributedStringDocumentFormats for NSMutableAttributedString {}

mod private_NSAttributedStringKitAdditions {
    pub trait Sealed {}
}

/// Category on [`NSAttributedString`].
///
/// ********************** Misc methods ***********************
pub unsafe trait NSAttributedStringKitAdditions:
    ClassType + Sized + private_NSAttributedStringKitAdditions::Sealed
{
    extern_methods!(
        #[unsafe(method(containsAttachmentsInRange:))]
        #[unsafe(method_family = none)]
        fn containsAttachmentsInRange(&self, range: NSRange) -> bool;

        #[unsafe(method(prefersRTFDInRange:))]
        #[unsafe(method_family = none)]
        fn prefersRTFDInRange(&self, range: NSRange) -> bool;
    );
}

impl private_NSAttributedStringKitAdditions::Sealed for NSAttributedString {}
unsafe impl NSAttributedStringKitAdditions for NSAttributedString {}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nspapermargindocumentattribute?language=objc)
    pub static NSPaperMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
}

extern "C" {
    /// ********************** Deprecated ***********************
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/nsobliquenessattributename?language=objc)
    #[deprecated = "This attribute is not supported with TextKit 2"]
    pub static NSObliquenessAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsexpansionattributename?language=objc)
    #[deprecated = "This attribute is not supported with TextKit 2"]
    pub static NSExpansionAttributeName: &'static NSAttributedStringKey;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsverticalglyphformattributename?language=objc)
    #[deprecated = "This attribute is not supported with TextKit 2"]
    pub static NSVerticalGlyphFormAttributeName: &'static NSAttributedStringKey;
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsunderlinepatternsolid?language=objc)
#[deprecated]
pub static NSUnderlinePatternSolid: NSUnderlineStyle =
    NSUnderlineStyle(NSUnderlineStyle::PatternSolid.0);

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsunderlinepatterndot?language=objc)
#[deprecated]
pub static NSUnderlinePatternDot: NSUnderlineStyle =
    NSUnderlineStyle(NSUnderlineStyle::PatternDot.0);

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsunderlinepatterndash?language=objc)
#[deprecated]
pub static NSUnderlinePatternDash: NSUnderlineStyle =
    NSUnderlineStyle(NSUnderlineStyle::PatternDash.0);

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsunderlinepatterndashdot?language=objc)
#[deprecated]
pub static NSUnderlinePatternDashDot: NSUnderlineStyle =
    NSUnderlineStyle(NSUnderlineStyle::PatternDashDot.0);

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsunderlinepatterndashdotdot?language=objc)
#[deprecated]
pub static NSUnderlinePatternDashDotDot: NSUnderlineStyle =
    NSUnderlineStyle(NSUnderlineStyle::PatternDashDotDot.0);

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nsunderlinebyword?language=objc)
#[deprecated]
pub static NSUnderlineByWord: NSUnderlineStyle = NSUnderlineStyle(NSUnderlineStyle::ByWord.0);

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/nstextwritingdirection?language=objc)
// NS_ENUM
#[deprecated]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSTextWritingDirection(pub NSInteger);
impl NSTextWritingDirection {
    #[doc(alias = "NSTextWritingDirectionEmbedding")]
    #[deprecated]
    pub const Embedding: Self = Self(0 << 1);
    #[doc(alias = "NSTextWritingDirectionOverride")]
    #[deprecated]
    pub const Override: Self = Self(1 << 1);
}

unsafe impl Encode for NSTextWritingDirection {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSTextWritingDirection {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
