objc2_app_kit/generated/
NSAttributedString.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11    /// ********************** Attributes ***********************
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfontattributename?language=objc)
14    pub static NSFontAttributeName: &'static NSAttributedStringKey;
15}
16
17extern "C" {
18    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsparagraphstyleattributename?language=objc)
19    pub static NSParagraphStyleAttributeName: &'static NSAttributedStringKey;
20}
21
22extern "C" {
23    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsforegroundcolorattributename?language=objc)
24    pub static NSForegroundColorAttributeName: &'static NSAttributedStringKey;
25}
26
27extern "C" {
28    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbackgroundcolorattributename?language=objc)
29    pub static NSBackgroundColorAttributeName: &'static NSAttributedStringKey;
30}
31
32extern "C" {
33    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsligatureattributename?language=objc)
34    pub static NSLigatureAttributeName: &'static NSAttributedStringKey;
35}
36
37extern "C" {
38    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nskernattributename?language=objc)
39    pub static NSKernAttributeName: &'static NSAttributedStringKey;
40}
41
42extern "C" {
43    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstrackingattributename?language=objc)
44    pub static NSTrackingAttributeName: &'static NSAttributedStringKey;
45}
46
47extern "C" {
48    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsstrikethroughstyleattributename?language=objc)
49    pub static NSStrikethroughStyleAttributeName: &'static NSAttributedStringKey;
50}
51
52extern "C" {
53    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinestyleattributename?language=objc)
54    pub static NSUnderlineStyleAttributeName: &'static NSAttributedStringKey;
55}
56
57extern "C" {
58    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsstrokecolorattributename?language=objc)
59    pub static NSStrokeColorAttributeName: &'static NSAttributedStringKey;
60}
61
62extern "C" {
63    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsstrokewidthattributename?language=objc)
64    pub static NSStrokeWidthAttributeName: &'static NSAttributedStringKey;
65}
66
67extern "C" {
68    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsshadowattributename?language=objc)
69    pub static NSShadowAttributeName: &'static NSAttributedStringKey;
70}
71
72extern "C" {
73    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexteffectattributename?language=objc)
74    pub static NSTextEffectAttributeName: &'static NSAttributedStringKey;
75}
76
77extern "C" {
78    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsattachmentattributename?language=objc)
79    pub static NSAttachmentAttributeName: &'static NSAttributedStringKey;
80}
81
82extern "C" {
83    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslinkattributename?language=objc)
84    pub static NSLinkAttributeName: &'static NSAttributedStringKey;
85}
86
87extern "C" {
88    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbaselineoffsetattributename?language=objc)
89    pub static NSBaselineOffsetAttributeName: &'static NSAttributedStringKey;
90}
91
92extern "C" {
93    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinecolorattributename?language=objc)
94    pub static NSUnderlineColorAttributeName: &'static NSAttributedStringKey;
95}
96
97extern "C" {
98    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsstrikethroughcolorattributename?language=objc)
99    pub static NSStrikethroughColorAttributeName: &'static NSAttributedStringKey;
100}
101
102extern "C" {
103    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswritingdirectionattributename?language=objc)
104    pub static NSWritingDirectionAttributeName: &'static NSAttributedStringKey;
105}
106
107extern "C" {
108    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexthighlightstyleattributename?language=objc)
109    pub static NSTextHighlightStyleAttributeName: &'static NSAttributedStringKey;
110}
111
112extern "C" {
113    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexthighlightcolorschemeattributename?language=objc)
114    pub static NSTextHighlightColorSchemeAttributeName: &'static NSAttributedStringKey;
115}
116
117extern "C" {
118    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsadaptiveimageglyphattributename?language=objc)
119    pub static NSAdaptiveImageGlyphAttributeName: &'static NSAttributedStringKey;
120}
121
122extern "C" {
123    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswritingtoolsexclusionattributename?language=objc)
124    pub static NSWritingToolsExclusionAttributeName: &'static NSAttributedStringKey;
125}
126
127/// ********************** Attribute values ***********************
128///
129/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinestyle?language=objc)
130// NS_OPTIONS
131#[repr(transparent)]
132#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
133pub struct NSUnderlineStyle(pub NSInteger);
134bitflags::bitflags! {
135    impl NSUnderlineStyle: NSInteger {
136        #[doc(alias = "NSUnderlineStyleNone")]
137        const None = 0x00;
138        #[doc(alias = "NSUnderlineStyleSingle")]
139        const Single = 0x01;
140        #[doc(alias = "NSUnderlineStyleThick")]
141        const Thick = 0x02;
142        #[doc(alias = "NSUnderlineStyleDouble")]
143        const Double = 0x09;
144        #[doc(alias = "NSUnderlineStylePatternSolid")]
145        const PatternSolid = 0x0000;
146        #[doc(alias = "NSUnderlineStylePatternDot")]
147        const PatternDot = 0x0100;
148        #[doc(alias = "NSUnderlineStylePatternDash")]
149        const PatternDash = 0x0200;
150        #[doc(alias = "NSUnderlineStylePatternDashDot")]
151        const PatternDashDot = 0x0300;
152        #[doc(alias = "NSUnderlineStylePatternDashDotDot")]
153        const PatternDashDotDot = 0x0400;
154        #[doc(alias = "NSUnderlineStyleByWord")]
155        const ByWord = 0x8000;
156    }
157}
158
159unsafe impl Encode for NSUnderlineStyle {
160    const ENCODING: Encoding = NSInteger::ENCODING;
161}
162
163unsafe impl RefEncode for NSUnderlineStyle {
164    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
165}
166
167/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswritingdirectionformattype?language=objc)
168// NS_ENUM
169#[repr(transparent)]
170#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
171pub struct NSWritingDirectionFormatType(pub NSInteger);
172impl NSWritingDirectionFormatType {
173    #[doc(alias = "NSWritingDirectionEmbedding")]
174    pub const Embedding: Self = Self(0 << 1);
175    #[doc(alias = "NSWritingDirectionOverride")]
176    pub const Override: Self = Self(1 << 1);
177}
178
179unsafe impl Encode for NSWritingDirectionFormatType {
180    const ENCODING: Encoding = NSInteger::ENCODING;
181}
182
183unsafe impl RefEncode for NSWritingDirectionFormatType {
184    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
185}
186
187/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexteffectstyle?language=objc)
188// NS_TYPED_ENUM
189pub type NSTextEffectStyle = NSString;
190
191extern "C" {
192    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexteffectletterpressstyle?language=objc)
193    pub static NSTextEffectLetterpressStyle: &'static NSTextEffectStyle;
194}
195
196/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexthighlightstyle?language=objc)
197// NS_TYPED_EXTENSIBLE_ENUM
198pub type NSTextHighlightStyle = NSString;
199
200extern "C" {
201    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexthighlightstyledefault?language=objc)
202    pub static NSTextHighlightStyleDefault: &'static NSTextHighlightStyle;
203}
204
205/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexthighlightcolorscheme?language=objc)
206// NS_TYPED_EXTENSIBLE_ENUM
207pub type NSTextHighlightColorScheme = NSString;
208
209extern "C" {
210    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexthighlightcolorschemedefault?language=objc)
211    pub static NSTextHighlightColorSchemeDefault: &'static NSTextHighlightColorScheme;
212}
213
214extern "C" {
215    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexthighlightcolorschemepurple?language=objc)
216    pub static NSTextHighlightColorSchemePurple: &'static NSTextHighlightColorScheme;
217}
218
219extern "C" {
220    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexthighlightcolorschemepink?language=objc)
221    pub static NSTextHighlightColorSchemePink: &'static NSTextHighlightColorScheme;
222}
223
224extern "C" {
225    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexthighlightcolorschemeorange?language=objc)
226    pub static NSTextHighlightColorSchemeOrange: &'static NSTextHighlightColorScheme;
227}
228
229extern "C" {
230    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexthighlightcolorschememint?language=objc)
231    pub static NSTextHighlightColorSchemeMint: &'static NSTextHighlightColorScheme;
232}
233
234extern "C" {
235    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexthighlightcolorschemeblue?language=objc)
236    pub static NSTextHighlightColorSchemeBlue: &'static NSTextHighlightColorScheme;
237}
238
239mod private_NSAttributedStringAttributeFixing {
240    pub trait Sealed {}
241}
242
243/// Category on [`NSMutableAttributedString`].
244/// ********************** Attribute fixing ***********************
245pub unsafe trait NSAttributedStringAttributeFixing:
246    ClassType + Sized + private_NSAttributedStringAttributeFixing::Sealed
247{
248    extern_methods!(
249        #[unsafe(method(fixAttributesInRange:))]
250        #[unsafe(method_family = none)]
251        unsafe fn fixAttributesInRange(&self, range: NSRange);
252    );
253}
254
255impl private_NSAttributedStringAttributeFixing::Sealed for NSMutableAttributedString {}
256unsafe impl NSAttributedStringAttributeFixing for NSMutableAttributedString {}
257
258/// ********************** Document formats ***********************
259///
260/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsattributedstringdocumenttype?language=objc)
261// NS_TYPED_EXTENSIBLE_ENUM
262pub type NSAttributedStringDocumentType = NSString;
263
264extern "C" {
265    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsplaintextdocumenttype?language=objc)
266    pub static NSPlainTextDocumentType: &'static NSAttributedStringDocumentType;
267}
268
269extern "C" {
270    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrtftextdocumenttype?language=objc)
271    pub static NSRTFTextDocumentType: &'static NSAttributedStringDocumentType;
272}
273
274extern "C" {
275    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrtfdtextdocumenttype?language=objc)
276    pub static NSRTFDTextDocumentType: &'static NSAttributedStringDocumentType;
277}
278
279extern "C" {
280    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nshtmltextdocumenttype?language=objc)
281    pub static NSHTMLTextDocumentType: &'static NSAttributedStringDocumentType;
282}
283
284/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextlayoutsectionkey?language=objc)
285// NS_TYPED_ENUM
286pub type NSTextLayoutSectionKey = NSString;
287
288extern "C" {
289    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextlayoutsectionorientation?language=objc)
290    pub static NSTextLayoutSectionOrientation: &'static NSTextLayoutSectionKey;
291}
292
293extern "C" {
294    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextlayoutsectionrange?language=objc)
295    pub static NSTextLayoutSectionRange: &'static NSTextLayoutSectionKey;
296}
297
298/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextscalingtype?language=objc)
299// NS_ENUM
300#[repr(transparent)]
301#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
302pub struct NSTextScalingType(pub NSInteger);
303impl NSTextScalingType {
304    #[doc(alias = "NSTextScalingStandard")]
305    pub const ScalingStandard: Self = Self(0);
306    #[doc(alias = "NSTextScalingiOS")]
307    pub const ScalingiOS: Self = Self(1);
308}
309
310unsafe impl Encode for NSTextScalingType {
311    const ENCODING: Encoding = NSInteger::ENCODING;
312}
313
314unsafe impl RefEncode for NSTextScalingType {
315    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
316}
317
318/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsattributedstringdocumentattributekey?language=objc)
319// NS_TYPED_EXTENSIBLE_ENUM
320pub type NSAttributedStringDocumentAttributeKey = NSString;
321
322extern "C" {
323    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdocumenttypedocumentattribute?language=objc)
324    pub static NSDocumentTypeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
325}
326
327extern "C" {
328    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscharacterencodingdocumentattribute?language=objc)
329    pub static NSCharacterEncodingDocumentAttribute:
330        &'static NSAttributedStringDocumentAttributeKey;
331}
332
333extern "C" {
334    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdefaultattributesdocumentattribute?language=objc)
335    pub static NSDefaultAttributesDocumentAttribute:
336        &'static NSAttributedStringDocumentAttributeKey;
337}
338
339extern "C" {
340    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspapersizedocumentattribute?language=objc)
341    pub static NSPaperSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
342}
343
344extern "C" {
345    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsviewsizedocumentattribute?language=objc)
346    pub static NSViewSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
347}
348
349extern "C" {
350    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsviewzoomdocumentattribute?language=objc)
351    pub static NSViewZoomDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
352}
353
354extern "C" {
355    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsviewmodedocumentattribute?language=objc)
356    pub static NSViewModeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
357}
358
359extern "C" {
360    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdefaultfontexcludeddocumentattribute?language=objc)
361    pub static NSDefaultFontExcludedDocumentAttribute:
362        &'static NSAttributedStringDocumentAttributeKey;
363}
364
365extern "C" {
366    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsreadonlydocumentattribute?language=objc)
367    pub static NSReadOnlyDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
368}
369
370extern "C" {
371    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbackgroundcolordocumentattribute?language=objc)
372    pub static NSBackgroundColorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
373}
374
375extern "C" {
376    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nshyphenationfactordocumentattribute?language=objc)
377    pub static NSHyphenationFactorDocumentAttribute:
378        &'static NSAttributedStringDocumentAttributeKey;
379}
380
381extern "C" {
382    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdefaulttabintervaldocumentattribute?language=objc)
383    pub static NSDefaultTabIntervalDocumentAttribute:
384        &'static NSAttributedStringDocumentAttributeKey;
385}
386
387extern "C" {
388    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextlayoutsectionsattribute?language=objc)
389    pub static NSTextLayoutSectionsAttribute: &'static NSAttributedStringDocumentAttributeKey;
390}
391
392extern "C" {
393    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextscalingdocumentattribute?language=objc)
394    pub static NSTextScalingDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
395}
396
397extern "C" {
398    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssourcetextscalingdocumentattribute?language=objc)
399    pub static NSSourceTextScalingDocumentAttribute:
400        &'static NSAttributedStringDocumentAttributeKey;
401}
402
403extern "C" {
404    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscocoaversiondocumentattribute?language=objc)
405    pub static NSCocoaVersionDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
406}
407
408/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsattributedstringdocumentreadingoptionkey?language=objc)
409// NS_TYPED_EXTENSIBLE_ENUM
410pub type NSAttributedStringDocumentReadingOptionKey = NSString;
411
412extern "C" {
413    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdocumenttypedocumentoption?language=objc)
414    pub static NSDocumentTypeDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
415}
416
417extern "C" {
418    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdefaultattributesdocumentoption?language=objc)
419    pub static NSDefaultAttributesDocumentOption:
420        &'static NSAttributedStringDocumentReadingOptionKey;
421}
422
423extern "C" {
424    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscharacterencodingdocumentoption?language=objc)
425    pub static NSCharacterEncodingDocumentOption:
426        &'static NSAttributedStringDocumentReadingOptionKey;
427}
428
429extern "C" {
430    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstargettextscalingdocumentoption?language=objc)
431    pub static NSTargetTextScalingDocumentOption:
432        &'static NSAttributedStringDocumentReadingOptionKey;
433}
434
435extern "C" {
436    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssourcetextscalingdocumentoption?language=objc)
437    pub static NSSourceTextScalingDocumentOption:
438        &'static NSAttributedStringDocumentReadingOptionKey;
439}
440
441extern "C" {
442    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextkit1listmarkerformatdocumentoption?language=objc)
443    pub static NSTextKit1ListMarkerFormatDocumentOption:
444        &'static NSAttributedStringDocumentReadingOptionKey;
445}
446
447mod private_NSAttributedStringDocumentFormats {
448    pub trait Sealed {}
449}
450
451/// Category on [`NSAttributedString`].
452pub unsafe trait NSAttributedStringDocumentFormats:
453    ClassType + Sized + private_NSAttributedStringDocumentFormats::Sealed
454{
455    extern_methods!(
456        #[unsafe(method(initWithURL:options:documentAttributes:error:_))]
457        #[unsafe(method_family = init)]
458        unsafe fn initWithURL_options_documentAttributes_error(
459            this: Allocated<Self>,
460            url: &NSURL,
461            options: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
462            dict: Option<
463                &mut Option<
464                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
465                >,
466            >,
467        ) -> Result<Retained<Self>, Retained<NSError>>;
468
469        #[unsafe(method(initWithData:options:documentAttributes:error:_))]
470        #[unsafe(method_family = init)]
471        unsafe fn initWithData_options_documentAttributes_error(
472            this: Allocated<Self>,
473            data: &NSData,
474            options: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
475            dict: Option<
476                &mut Option<
477                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
478                >,
479            >,
480        ) -> Result<Retained<Self>, Retained<NSError>>;
481
482        #[unsafe(method(dataFromRange:documentAttributes:error:_))]
483        #[unsafe(method_family = none)]
484        unsafe fn dataFromRange_documentAttributes_error(
485            &self,
486            range: NSRange,
487            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
488        ) -> Result<Retained<NSData>, Retained<NSError>>;
489
490        #[unsafe(method(fileWrapperFromRange:documentAttributes:error:_))]
491        #[unsafe(method_family = none)]
492        unsafe fn fileWrapperFromRange_documentAttributes_error(
493            &self,
494            range: NSRange,
495            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
496        ) -> Result<Retained<NSFileWrapper>, Retained<NSError>>;
497    );
498}
499
500impl private_NSAttributedStringDocumentFormats::Sealed for NSAttributedString {}
501unsafe impl NSAttributedStringDocumentFormats for NSAttributedString {}
502
503mod private_NSMutableAttributedStringDocumentFormats {
504    pub trait Sealed {}
505}
506
507/// Category on [`NSMutableAttributedString`].
508pub unsafe trait NSMutableAttributedStringDocumentFormats:
509    ClassType + Sized + private_NSMutableAttributedStringDocumentFormats::Sealed
510{
511    extern_methods!(
512        #[unsafe(method(readFromURL:options:documentAttributes:error:_))]
513        #[unsafe(method_family = none)]
514        unsafe fn readFromURL_options_documentAttributes_error(
515            &self,
516            url: &NSURL,
517            opts: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
518            dict: Option<
519                &mut Option<
520                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
521                >,
522            >,
523        ) -> Result<(), Retained<NSError>>;
524
525        #[unsafe(method(readFromData:options:documentAttributes:error:_))]
526        #[unsafe(method_family = none)]
527        unsafe fn readFromData_options_documentAttributes_error(
528            &self,
529            data: &NSData,
530            opts: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
531            dict: Option<
532                &mut Option<
533                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
534                >,
535            >,
536        ) -> Result<(), Retained<NSError>>;
537    );
538}
539
540impl private_NSMutableAttributedStringDocumentFormats::Sealed for NSMutableAttributedString {}
541unsafe impl NSMutableAttributedStringDocumentFormats for NSMutableAttributedString {}
542
543mod private_NSAttributedStringKitAdditions {
544    pub trait Sealed {}
545}
546
547/// Category on [`NSAttributedString`].
548/// ********************** Misc methods ***********************
549pub unsafe trait NSAttributedStringKitAdditions:
550    ClassType + Sized + private_NSAttributedStringKitAdditions::Sealed
551{
552    extern_methods!(
553        #[unsafe(method(containsAttachmentsInRange:))]
554        #[unsafe(method_family = none)]
555        unsafe fn containsAttachmentsInRange(&self, range: NSRange) -> bool;
556
557        #[unsafe(method(prefersRTFDInRange:))]
558        #[unsafe(method_family = none)]
559        unsafe fn prefersRTFDInRange(&self, range: NSRange) -> bool;
560    );
561}
562
563impl private_NSAttributedStringKitAdditions::Sealed for NSAttributedString {}
564unsafe impl NSAttributedStringKitAdditions for NSAttributedString {}
565
566extern "C" {
567    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscursorattributename?language=objc)
568    pub static NSCursorAttributeName: &'static NSAttributedStringKey;
569}
570
571extern "C" {
572    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstooltipattributename?language=objc)
573    pub static NSToolTipAttributeName: &'static NSAttributedStringKey;
574}
575
576extern "C" {
577    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmarkedclausesegmentattributename?language=objc)
578    pub static NSMarkedClauseSegmentAttributeName: &'static NSAttributedStringKey;
579}
580
581extern "C" {
582    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextalternativesattributename?language=objc)
583    pub static NSTextAlternativesAttributeName: &'static NSAttributedStringKey;
584}
585
586extern "C" {
587    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsspellingstateattributename?language=objc)
588    pub static NSSpellingStateAttributeName: &'static NSAttributedStringKey;
589}
590
591extern "C" {
592    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssuperscriptattributename?language=objc)
593    pub static NSSuperscriptAttributeName: &'static NSAttributedStringKey;
594}
595
596extern "C" {
597    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsglyphinfoattributename?language=objc)
598    pub static NSGlyphInfoAttributeName: &'static NSAttributedStringKey;
599}
600
601/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsspellingstate?language=objc)
602// NS_ENUM
603#[repr(transparent)]
604#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
605pub struct NSSpellingState(pub NSInteger);
606impl NSSpellingState {
607    #[doc(alias = "NSSpellingStateSpellingFlag")]
608    pub const SpellingFlag: Self = Self(1 << 0);
609    #[doc(alias = "NSSpellingStateGrammarFlag")]
610    pub const GrammarFlag: Self = Self(1 << 1);
611}
612
613unsafe impl Encode for NSSpellingState {
614    const ENCODING: Encoding = NSInteger::ENCODING;
615}
616
617unsafe impl RefEncode for NSSpellingState {
618    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
619}
620
621mod private_NSAttributedStringAppKitAttributeFixing {
622    pub trait Sealed {}
623}
624
625/// Category on [`NSMutableAttributedString`].
626/// ********************** Attribute fixing ***********************
627pub unsafe trait NSAttributedStringAppKitAttributeFixing:
628    ClassType + Sized + private_NSAttributedStringAppKitAttributeFixing::Sealed
629{
630    extern_methods!(
631        #[unsafe(method(fixFontAttributeInRange:))]
632        #[unsafe(method_family = none)]
633        unsafe fn fixFontAttributeInRange(&self, range: NSRange);
634
635        #[unsafe(method(fixParagraphStyleAttributeInRange:))]
636        #[unsafe(method_family = none)]
637        unsafe fn fixParagraphStyleAttributeInRange(&self, range: NSRange);
638
639        #[unsafe(method(fixAttachmentAttributeInRange:))]
640        #[unsafe(method_family = none)]
641        unsafe fn fixAttachmentAttributeInRange(&self, range: NSRange);
642    );
643}
644
645impl private_NSAttributedStringAppKitAttributeFixing::Sealed for NSMutableAttributedString {}
646unsafe impl NSAttributedStringAppKitAttributeFixing for NSMutableAttributedString {}
647
648extern "C" {
649    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmacsimpletextdocumenttype?language=objc)
650    pub static NSMacSimpleTextDocumentType: &'static NSAttributedStringDocumentType;
651}
652
653extern "C" {
654    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdocformattextdocumenttype?language=objc)
655    pub static NSDocFormatTextDocumentType: &'static NSAttributedStringDocumentType;
656}
657
658extern "C" {
659    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswordmltextdocumenttype?language=objc)
660    pub static NSWordMLTextDocumentType: &'static NSAttributedStringDocumentType;
661}
662
663extern "C" {
664    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswebarchivetextdocumenttype?language=objc)
665    pub static NSWebArchiveTextDocumentType: &'static NSAttributedStringDocumentType;
666}
667
668extern "C" {
669    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsofficeopenxmltextdocumenttype?language=objc)
670    pub static NSOfficeOpenXMLTextDocumentType: &'static NSAttributedStringDocumentType;
671}
672
673extern "C" {
674    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsopendocumenttextdocumenttype?language=objc)
675    pub static NSOpenDocumentTextDocumentType: &'static NSAttributedStringDocumentType;
676}
677
678extern "C" {
679    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsconverteddocumentattribute?language=objc)
680    pub static NSConvertedDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
681}
682
683extern "C" {
684    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfiletypedocumentattribute?language=objc)
685    pub static NSFileTypeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
686}
687
688extern "C" {
689    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstitledocumentattribute?language=objc)
690    pub static NSTitleDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
691}
692
693extern "C" {
694    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompanydocumentattribute?language=objc)
695    pub static NSCompanyDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
696}
697
698extern "C" {
699    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscopyrightdocumentattribute?language=objc)
700    pub static NSCopyrightDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
701}
702
703extern "C" {
704    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssubjectdocumentattribute?language=objc)
705    pub static NSSubjectDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
706}
707
708extern "C" {
709    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsauthordocumentattribute?language=objc)
710    pub static NSAuthorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
711}
712
713extern "C" {
714    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nskeywordsdocumentattribute?language=objc)
715    pub static NSKeywordsDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
716}
717
718extern "C" {
719    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscommentdocumentattribute?language=objc)
720    pub static NSCommentDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
721}
722
723extern "C" {
724    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nseditordocumentattribute?language=objc)
725    pub static NSEditorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
726}
727
728extern "C" {
729    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscreationtimedocumentattribute?language=objc)
730    pub static NSCreationTimeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
731}
732
733extern "C" {
734    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmodificationtimedocumentattribute?language=objc)
735    pub static NSModificationTimeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
736}
737
738extern "C" {
739    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmanagerdocumentattribute?language=objc)
740    pub static NSManagerDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
741}
742
743extern "C" {
744    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscategorydocumentattribute?language=objc)
745    pub static NSCategoryDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
746}
747
748extern "C" {
749    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappearancedocumentattribute?language=objc)
750    pub static NSAppearanceDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
751}
752
753extern "C" {
754    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsexcludedelementsdocumentattribute?language=objc)
755    pub static NSExcludedElementsDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
756}
757
758extern "C" {
759    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextencodingnamedocumentattribute?language=objc)
760    pub static NSTextEncodingNameDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
761}
762
763extern "C" {
764    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsprefixspacesdocumentattribute?language=objc)
765    pub static NSPrefixSpacesDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
766}
767
768extern "C" {
769    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsleftmargindocumentattribute?language=objc)
770    pub static NSLeftMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
771}
772
773extern "C" {
774    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrightmargindocumentattribute?language=objc)
775    pub static NSRightMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
776}
777
778extern "C" {
779    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstopmargindocumentattribute?language=objc)
780    pub static NSTopMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
781}
782
783extern "C" {
784    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbottommargindocumentattribute?language=objc)
785    pub static NSBottomMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
786}
787
788extern "C" {
789    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextencodingnamedocumentoption?language=objc)
790    pub static NSTextEncodingNameDocumentOption:
791        &'static NSAttributedStringDocumentReadingOptionKey;
792}
793
794extern "C" {
795    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbaseurldocumentoption?language=objc)
796    pub static NSBaseURLDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
797}
798
799extern "C" {
800    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstimeoutdocumentoption?language=objc)
801    pub static NSTimeoutDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
802}
803
804extern "C" {
805    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswebpreferencesdocumentoption?language=objc)
806    pub static NSWebPreferencesDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
807}
808
809extern "C" {
810    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswebresourceloaddelegatedocumentoption?language=objc)
811    pub static NSWebResourceLoadDelegateDocumentOption:
812        &'static NSAttributedStringDocumentReadingOptionKey;
813}
814
815extern "C" {
816    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextsizemultiplierdocumentoption?language=objc)
817    pub static NSTextSizeMultiplierDocumentOption:
818        &'static NSAttributedStringDocumentReadingOptionKey;
819}
820
821extern "C" {
822    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfiletypedocumentoption?language=objc)
823    pub static NSFileTypeDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
824}
825
826mod private_NSAttributedStringAppKitDocumentFormats {
827    pub trait Sealed {}
828}
829
830/// Category on [`NSAttributedString`].
831pub unsafe trait NSAttributedStringAppKitDocumentFormats:
832    ClassType + Sized + private_NSAttributedStringAppKitDocumentFormats::Sealed
833{
834    extern_methods!(
835        #[unsafe(method(initWithRTF:documentAttributes:))]
836        #[unsafe(method_family = init)]
837        unsafe fn initWithRTF_documentAttributes(
838            this: Allocated<Self>,
839            data: &NSData,
840            dict: Option<
841                &mut Option<
842                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
843                >,
844            >,
845        ) -> Option<Retained<Self>>;
846
847        #[unsafe(method(initWithRTFD:documentAttributes:))]
848        #[unsafe(method_family = init)]
849        unsafe fn initWithRTFD_documentAttributes(
850            this: Allocated<Self>,
851            data: &NSData,
852            dict: Option<
853                &mut Option<
854                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
855                >,
856            >,
857        ) -> Option<Retained<Self>>;
858
859        #[unsafe(method(initWithHTML:documentAttributes:))]
860        #[unsafe(method_family = init)]
861        unsafe fn initWithHTML_documentAttributes(
862            this: Allocated<Self>,
863            data: &NSData,
864            dict: Option<
865                &mut Option<
866                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
867                >,
868            >,
869        ) -> Option<Retained<Self>>;
870
871        #[unsafe(method(initWithHTML:baseURL:documentAttributes:))]
872        #[unsafe(method_family = init)]
873        unsafe fn initWithHTML_baseURL_documentAttributes(
874            this: Allocated<Self>,
875            data: &NSData,
876            base: &NSURL,
877            dict: Option<
878                &mut Option<
879                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
880                >,
881            >,
882        ) -> Option<Retained<Self>>;
883
884        #[unsafe(method(initWithDocFormat:documentAttributes:))]
885        #[unsafe(method_family = init)]
886        unsafe fn initWithDocFormat_documentAttributes(
887            this: Allocated<Self>,
888            data: &NSData,
889            dict: Option<
890                &mut Option<
891                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
892                >,
893            >,
894        ) -> Option<Retained<Self>>;
895
896        #[unsafe(method(initWithHTML:options:documentAttributes:))]
897        #[unsafe(method_family = init)]
898        unsafe fn initWithHTML_options_documentAttributes(
899            this: Allocated<Self>,
900            data: &NSData,
901            options: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
902            dict: Option<
903                &mut Option<
904                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
905                >,
906            >,
907        ) -> Option<Retained<Self>>;
908
909        #[unsafe(method(initWithRTFDFileWrapper:documentAttributes:))]
910        #[unsafe(method_family = init)]
911        unsafe fn initWithRTFDFileWrapper_documentAttributes(
912            this: Allocated<Self>,
913            wrapper: &NSFileWrapper,
914            dict: Option<
915                &mut Option<
916                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
917                >,
918            >,
919        ) -> Option<Retained<Self>>;
920
921        #[unsafe(method(RTFFromRange:documentAttributes:))]
922        #[unsafe(method_family = none)]
923        unsafe fn RTFFromRange_documentAttributes(
924            &self,
925            range: NSRange,
926            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
927        ) -> Option<Retained<NSData>>;
928
929        #[unsafe(method(RTFDFromRange:documentAttributes:))]
930        #[unsafe(method_family = none)]
931        unsafe fn RTFDFromRange_documentAttributes(
932            &self,
933            range: NSRange,
934            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
935        ) -> Option<Retained<NSData>>;
936
937        #[unsafe(method(RTFDFileWrapperFromRange:documentAttributes:))]
938        #[unsafe(method_family = none)]
939        unsafe fn RTFDFileWrapperFromRange_documentAttributes(
940            &self,
941            range: NSRange,
942            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
943        ) -> Option<Retained<NSFileWrapper>>;
944
945        #[unsafe(method(docFormatFromRange:documentAttributes:))]
946        #[unsafe(method_family = none)]
947        unsafe fn docFormatFromRange_documentAttributes(
948            &self,
949            range: NSRange,
950            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
951        ) -> Option<Retained<NSData>>;
952    );
953}
954
955impl private_NSAttributedStringAppKitDocumentFormats::Sealed for NSAttributedString {}
956unsafe impl NSAttributedStringAppKitDocumentFormats for NSAttributedString {}
957
958mod private_NSAttributedStringAppKitAdditions {
959    pub trait Sealed {}
960}
961
962/// Category on [`NSAttributedString`].
963/// ********************** Misc methods ***********************
964pub unsafe trait NSAttributedStringAppKitAdditions:
965    ClassType + Sized + private_NSAttributedStringAppKitAdditions::Sealed
966{
967    extern_methods!(
968        #[unsafe(method(fontAttributesInRange:))]
969        #[unsafe(method_family = none)]
970        unsafe fn fontAttributesInRange(
971            &self,
972            range: NSRange,
973        ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
974
975        #[unsafe(method(rulerAttributesInRange:))]
976        #[unsafe(method_family = none)]
977        unsafe fn rulerAttributesInRange(
978            &self,
979            range: NSRange,
980        ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
981
982        #[unsafe(method(lineBreakBeforeIndex:withinRange:))]
983        #[unsafe(method_family = none)]
984        unsafe fn lineBreakBeforeIndex_withinRange(
985            &self,
986            location: NSUInteger,
987            a_range: NSRange,
988        ) -> NSUInteger;
989
990        #[unsafe(method(lineBreakByHyphenatingBeforeIndex:withinRange:))]
991        #[unsafe(method_family = none)]
992        unsafe fn lineBreakByHyphenatingBeforeIndex_withinRange(
993            &self,
994            location: NSUInteger,
995            a_range: NSRange,
996        ) -> NSUInteger;
997
998        #[unsafe(method(doubleClickAtIndex:))]
999        #[unsafe(method_family = none)]
1000        unsafe fn doubleClickAtIndex(&self, location: NSUInteger) -> NSRange;
1001
1002        #[unsafe(method(nextWordFromIndex:forward:))]
1003        #[unsafe(method_family = none)]
1004        unsafe fn nextWordFromIndex_forward(
1005            &self,
1006            location: NSUInteger,
1007            is_forward: bool,
1008        ) -> NSUInteger;
1009
1010        #[cfg(feature = "NSTextTable")]
1011        #[unsafe(method(rangeOfTextBlock:atIndex:))]
1012        #[unsafe(method_family = none)]
1013        unsafe fn rangeOfTextBlock_atIndex(
1014            &self,
1015            block: &NSTextBlock,
1016            location: NSUInteger,
1017        ) -> NSRange;
1018
1019        #[cfg(feature = "NSTextTable")]
1020        #[unsafe(method(rangeOfTextTable:atIndex:))]
1021        #[unsafe(method_family = none)]
1022        unsafe fn rangeOfTextTable_atIndex(
1023            &self,
1024            table: &NSTextTable,
1025            location: NSUInteger,
1026        ) -> NSRange;
1027
1028        #[cfg(feature = "NSTextList")]
1029        #[unsafe(method(rangeOfTextList:atIndex:))]
1030        #[unsafe(method_family = none)]
1031        unsafe fn rangeOfTextList_atIndex(
1032            &self,
1033            list: &NSTextList,
1034            location: NSUInteger,
1035        ) -> NSRange;
1036
1037        #[cfg(feature = "NSTextList")]
1038        #[unsafe(method(itemNumberInTextList:atIndex:))]
1039        #[unsafe(method_family = none)]
1040        unsafe fn itemNumberInTextList_atIndex(
1041            &self,
1042            list: &NSTextList,
1043            location: NSUInteger,
1044        ) -> NSInteger;
1045    );
1046}
1047
1048impl private_NSAttributedStringAppKitAdditions::Sealed for NSAttributedString {}
1049unsafe impl NSAttributedStringAppKitAdditions for NSAttributedString {}
1050
1051mod private_NSAttributedStringPasteboardAdditions {
1052    pub trait Sealed {}
1053}
1054
1055/// Category on [`NSAttributedString`].
1056pub unsafe trait NSAttributedStringPasteboardAdditions:
1057    ClassType + Sized + private_NSAttributedStringPasteboardAdditions::Sealed
1058{
1059    extern_methods!(
1060        #[unsafe(method(textTypes))]
1061        #[unsafe(method_family = none)]
1062        unsafe fn textTypes() -> Retained<NSArray<NSString>>;
1063
1064        #[unsafe(method(textUnfilteredTypes))]
1065        #[unsafe(method_family = none)]
1066        unsafe fn textUnfilteredTypes() -> Retained<NSArray<NSString>>;
1067    );
1068}
1069
1070impl private_NSAttributedStringPasteboardAdditions::Sealed for NSAttributedString {}
1071unsafe impl NSAttributedStringPasteboardAdditions for NSAttributedString {}
1072
1073#[cfg(feature = "NSPasteboard")]
1074extern_conformance!(
1075    unsafe impl NSPasteboardReading for NSAttributedString {}
1076);
1077
1078#[cfg(feature = "NSPasteboard")]
1079extern_conformance!(
1080    unsafe impl NSPasteboardWriting for NSAttributedString {}
1081);
1082
1083mod private_NSMutableAttributedStringAppKitAdditions {
1084    pub trait Sealed {}
1085}
1086
1087/// Category on [`NSMutableAttributedString`].
1088pub unsafe trait NSMutableAttributedStringAppKitAdditions:
1089    ClassType + Sized + private_NSMutableAttributedStringAppKitAdditions::Sealed
1090{
1091    extern_methods!(
1092        #[unsafe(method(superscriptRange:))]
1093        #[unsafe(method_family = none)]
1094        unsafe fn superscriptRange(&self, range: NSRange);
1095
1096        #[unsafe(method(subscriptRange:))]
1097        #[unsafe(method_family = none)]
1098        unsafe fn subscriptRange(&self, range: NSRange);
1099
1100        #[unsafe(method(unscriptRange:))]
1101        #[unsafe(method_family = none)]
1102        unsafe fn unscriptRange(&self, range: NSRange);
1103
1104        #[cfg(feature = "NSFontManager")]
1105        #[unsafe(method(applyFontTraits:range:))]
1106        #[unsafe(method_family = none)]
1107        unsafe fn applyFontTraits_range(&self, trait_mask: NSFontTraitMask, range: NSRange);
1108
1109        #[cfg(feature = "NSText")]
1110        #[unsafe(method(setAlignment:range:))]
1111        #[unsafe(method_family = none)]
1112        unsafe fn setAlignment_range(&self, alignment: NSTextAlignment, range: NSRange);
1113
1114        #[cfg(feature = "NSText")]
1115        #[unsafe(method(setBaseWritingDirection:range:))]
1116        #[unsafe(method_family = none)]
1117        unsafe fn setBaseWritingDirection_range(
1118            &self,
1119            writing_direction: NSWritingDirection,
1120            range: NSRange,
1121        );
1122    );
1123}
1124
1125impl private_NSMutableAttributedStringAppKitAdditions::Sealed for NSMutableAttributedString {}
1126unsafe impl NSMutableAttributedStringAppKitAdditions for NSMutableAttributedString {}
1127
1128/// ********************** Deprecated ***********************
1129///
1130/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinepatternsolid?language=objc)
1131pub static NSUnderlinePatternSolid: NSUnderlineStyle =
1132    NSUnderlineStyle(NSUnderlineStyle::PatternSolid.0);
1133
1134/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinepatterndot?language=objc)
1135pub static NSUnderlinePatternDot: NSUnderlineStyle =
1136    NSUnderlineStyle(NSUnderlineStyle::PatternDot.0);
1137
1138/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinepatterndash?language=objc)
1139pub static NSUnderlinePatternDash: NSUnderlineStyle =
1140    NSUnderlineStyle(NSUnderlineStyle::PatternDash.0);
1141
1142/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinepatterndashdot?language=objc)
1143pub static NSUnderlinePatternDashDot: NSUnderlineStyle =
1144    NSUnderlineStyle(NSUnderlineStyle::PatternDashDot.0);
1145
1146/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinepatterndashdotdot?language=objc)
1147pub static NSUnderlinePatternDashDotDot: NSUnderlineStyle =
1148    NSUnderlineStyle(NSUnderlineStyle::PatternDashDotDot.0);
1149
1150/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinebyword?language=objc)
1151pub static NSUnderlineByWord: NSUnderlineStyle = NSUnderlineStyle(NSUnderlineStyle::ByWord.0);
1152
1153extern "C" {
1154    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscharactershapeattributename?language=objc)
1155    pub static NSCharacterShapeAttributeName: &'static NSAttributedStringKey;
1156}
1157
1158extern "C" {
1159    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsusesscreenfontsdocumentattribute?language=objc)
1160    pub static NSUsesScreenFontsDocumentAttribute: &'static NSAttributedStringKey;
1161}
1162
1163extern "C" {
1164    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsobliquenessattributename?language=objc)
1165    pub static NSObliquenessAttributeName: &'static NSAttributedStringKey;
1166}
1167
1168extern "C" {
1169    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsexpansionattributename?language=objc)
1170    pub static NSExpansionAttributeName: &'static NSAttributedStringKey;
1171}
1172
1173extern "C" {
1174    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsverticalglyphformattributename?language=objc)
1175    pub static NSVerticalGlyphFormAttributeName: &'static NSAttributedStringKey;
1176}
1177
1178/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnounderlinestyle?language=objc)
1179#[deprecated = "Use NSUnderlineStyleNone instead"]
1180pub const NSNoUnderlineStyle: c_uint = 0;
1181/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssingleunderlinestyle?language=objc)
1182#[deprecated = "Use NSUnderlineStyleSingle instead"]
1183pub const NSSingleUnderlineStyle: c_uint = 1;
1184
1185extern "C" {
1186    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinestrikethroughmask?language=objc)
1187    pub static NSUnderlineStrikethroughMask: NSUInteger;
1188}
1189
1190extern "C" {
1191    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinebywordmask?language=objc)
1192    pub static NSUnderlineByWordMask: NSUInteger;
1193}
1194
1195mod private_NSAttributedStringNSDeprecatedKitAdditions {
1196    pub trait Sealed {}
1197}
1198
1199/// Category "NSDeprecatedKitAdditions" on [`NSAttributedString`].
1200#[doc(alias = "NSDeprecatedKitAdditions")]
1201pub unsafe trait NSAttributedStringNSDeprecatedKitAdditions:
1202    ClassType + Sized + private_NSAttributedStringNSDeprecatedKitAdditions::Sealed
1203{
1204    extern_methods!(
1205        #[unsafe(method(containsAttachments))]
1206        #[unsafe(method_family = none)]
1207        unsafe fn containsAttachments(&self) -> bool;
1208
1209        #[deprecated]
1210        #[unsafe(method(textFileTypes))]
1211        #[unsafe(method_family = none)]
1212        unsafe fn textFileTypes() -> Retained<NSArray>;
1213
1214        #[deprecated]
1215        #[unsafe(method(textPasteboardTypes))]
1216        #[unsafe(method_family = none)]
1217        unsafe fn textPasteboardTypes() -> Retained<NSArray>;
1218
1219        #[deprecated]
1220        #[unsafe(method(textUnfilteredFileTypes))]
1221        #[unsafe(method_family = none)]
1222        unsafe fn textUnfilteredFileTypes() -> Retained<NSArray>;
1223
1224        #[deprecated]
1225        #[unsafe(method(textUnfilteredPasteboardTypes))]
1226        #[unsafe(method_family = none)]
1227        unsafe fn textUnfilteredPasteboardTypes() -> Retained<NSArray>;
1228
1229        #[deprecated = "Use -initWithURL:options:documentAttributes:error: instead"]
1230        #[unsafe(method(initWithURL:documentAttributes:))]
1231        #[unsafe(method_family = init)]
1232        unsafe fn initWithURL_documentAttributes(
1233            this: Allocated<Self>,
1234            url: &NSURL,
1235            dict: Option<&mut Option<Retained<NSDictionary>>>,
1236        ) -> Option<Retained<Self>>;
1237
1238        #[deprecated = "Use -initWithURL:options:documentAttributes:error: instead"]
1239        #[unsafe(method(initWithPath:documentAttributes:))]
1240        #[unsafe(method_family = init)]
1241        unsafe fn initWithPath_documentAttributes(
1242            this: Allocated<Self>,
1243            path: &NSString,
1244            dict: Option<&mut Option<Retained<NSDictionary>>>,
1245        ) -> Option<Retained<Self>>;
1246
1247        #[deprecated = "Use NSDataDetector instead"]
1248        #[unsafe(method(URLAtIndex:effectiveRange:))]
1249        #[unsafe(method_family = none)]
1250        unsafe fn URLAtIndex_effectiveRange(
1251            &self,
1252            location: NSUInteger,
1253            effective_range: NSRangePointer,
1254        ) -> Option<Retained<NSURL>>;
1255    );
1256}
1257
1258impl private_NSAttributedStringNSDeprecatedKitAdditions::Sealed for NSAttributedString {}
1259unsafe impl NSAttributedStringNSDeprecatedKitAdditions for NSAttributedString {}