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///
245/// ********************** Attribute fixing ***********************
246pub unsafe trait NSAttributedStringAttributeFixing:
247    ClassType + Sized + private_NSAttributedStringAttributeFixing::Sealed
248{
249    extern_methods!(
250        #[unsafe(method(fixAttributesInRange:))]
251        #[unsafe(method_family = none)]
252        fn fixAttributesInRange(&self, range: NSRange);
253    );
254}
255
256impl private_NSAttributedStringAttributeFixing::Sealed for NSMutableAttributedString {}
257unsafe impl NSAttributedStringAttributeFixing for NSMutableAttributedString {}
258
259/// ********************** Document formats ***********************
260///
261/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsattributedstringdocumenttype?language=objc)
262// NS_TYPED_EXTENSIBLE_ENUM
263pub type NSAttributedStringDocumentType = NSString;
264
265extern "C" {
266    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsplaintextdocumenttype?language=objc)
267    pub static NSPlainTextDocumentType: &'static NSAttributedStringDocumentType;
268}
269
270extern "C" {
271    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrtftextdocumenttype?language=objc)
272    pub static NSRTFTextDocumentType: &'static NSAttributedStringDocumentType;
273}
274
275extern "C" {
276    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrtfdtextdocumenttype?language=objc)
277    pub static NSRTFDTextDocumentType: &'static NSAttributedStringDocumentType;
278}
279
280extern "C" {
281    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nshtmltextdocumenttype?language=objc)
282    pub static NSHTMLTextDocumentType: &'static NSAttributedStringDocumentType;
283}
284
285/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextlayoutsectionkey?language=objc)
286// NS_TYPED_ENUM
287pub type NSTextLayoutSectionKey = NSString;
288
289extern "C" {
290    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextlayoutsectionorientation?language=objc)
291    pub static NSTextLayoutSectionOrientation: &'static NSTextLayoutSectionKey;
292}
293
294extern "C" {
295    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextlayoutsectionrange?language=objc)
296    pub static NSTextLayoutSectionRange: &'static NSTextLayoutSectionKey;
297}
298
299/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextscalingtype?language=objc)
300// NS_ENUM
301#[repr(transparent)]
302#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
303pub struct NSTextScalingType(pub NSInteger);
304impl NSTextScalingType {
305    #[doc(alias = "NSTextScalingStandard")]
306    pub const ScalingStandard: Self = Self(0);
307    #[doc(alias = "NSTextScalingiOS")]
308    pub const ScalingiOS: Self = Self(1);
309}
310
311unsafe impl Encode for NSTextScalingType {
312    const ENCODING: Encoding = NSInteger::ENCODING;
313}
314
315unsafe impl RefEncode for NSTextScalingType {
316    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
317}
318
319/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsattributedstringdocumentattributekey?language=objc)
320// NS_TYPED_EXTENSIBLE_ENUM
321pub type NSAttributedStringDocumentAttributeKey = NSString;
322
323extern "C" {
324    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdocumenttypedocumentattribute?language=objc)
325    pub static NSDocumentTypeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
326}
327
328extern "C" {
329    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscharacterencodingdocumentattribute?language=objc)
330    pub static NSCharacterEncodingDocumentAttribute:
331        &'static NSAttributedStringDocumentAttributeKey;
332}
333
334extern "C" {
335    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdefaultattributesdocumentattribute?language=objc)
336    pub static NSDefaultAttributesDocumentAttribute:
337        &'static NSAttributedStringDocumentAttributeKey;
338}
339
340extern "C" {
341    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspapersizedocumentattribute?language=objc)
342    pub static NSPaperSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
343}
344
345extern "C" {
346    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsviewsizedocumentattribute?language=objc)
347    pub static NSViewSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
348}
349
350extern "C" {
351    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsviewzoomdocumentattribute?language=objc)
352    pub static NSViewZoomDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
353}
354
355extern "C" {
356    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsviewmodedocumentattribute?language=objc)
357    pub static NSViewModeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
358}
359
360extern "C" {
361    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdefaultfontexcludeddocumentattribute?language=objc)
362    pub static NSDefaultFontExcludedDocumentAttribute:
363        &'static NSAttributedStringDocumentAttributeKey;
364}
365
366extern "C" {
367    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsreadonlydocumentattribute?language=objc)
368    pub static NSReadOnlyDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
369}
370
371extern "C" {
372    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbackgroundcolordocumentattribute?language=objc)
373    pub static NSBackgroundColorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
374}
375
376extern "C" {
377    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nshyphenationfactordocumentattribute?language=objc)
378    pub static NSHyphenationFactorDocumentAttribute:
379        &'static NSAttributedStringDocumentAttributeKey;
380}
381
382extern "C" {
383    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdefaulttabintervaldocumentattribute?language=objc)
384    pub static NSDefaultTabIntervalDocumentAttribute:
385        &'static NSAttributedStringDocumentAttributeKey;
386}
387
388extern "C" {
389    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextlayoutsectionsattribute?language=objc)
390    pub static NSTextLayoutSectionsAttribute: &'static NSAttributedStringDocumentAttributeKey;
391}
392
393extern "C" {
394    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextscalingdocumentattribute?language=objc)
395    pub static NSTextScalingDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
396}
397
398extern "C" {
399    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssourcetextscalingdocumentattribute?language=objc)
400    pub static NSSourceTextScalingDocumentAttribute:
401        &'static NSAttributedStringDocumentAttributeKey;
402}
403
404extern "C" {
405    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscocoaversiondocumentattribute?language=objc)
406    pub static NSCocoaVersionDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
407}
408
409/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsattributedstringdocumentreadingoptionkey?language=objc)
410// NS_TYPED_EXTENSIBLE_ENUM
411pub type NSAttributedStringDocumentReadingOptionKey = NSString;
412
413extern "C" {
414    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdocumenttypedocumentoption?language=objc)
415    pub static NSDocumentTypeDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
416}
417
418extern "C" {
419    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdefaultattributesdocumentoption?language=objc)
420    pub static NSDefaultAttributesDocumentOption:
421        &'static NSAttributedStringDocumentReadingOptionKey;
422}
423
424extern "C" {
425    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscharacterencodingdocumentoption?language=objc)
426    pub static NSCharacterEncodingDocumentOption:
427        &'static NSAttributedStringDocumentReadingOptionKey;
428}
429
430extern "C" {
431    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstargettextscalingdocumentoption?language=objc)
432    pub static NSTargetTextScalingDocumentOption:
433        &'static NSAttributedStringDocumentReadingOptionKey;
434}
435
436extern "C" {
437    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssourcetextscalingdocumentoption?language=objc)
438    pub static NSSourceTextScalingDocumentOption:
439        &'static NSAttributedStringDocumentReadingOptionKey;
440}
441
442extern "C" {
443    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextkit1listmarkerformatdocumentoption?language=objc)
444    pub static NSTextKit1ListMarkerFormatDocumentOption:
445        &'static NSAttributedStringDocumentReadingOptionKey;
446}
447
448mod private_NSAttributedStringDocumentFormats {
449    pub trait Sealed {}
450}
451
452/// Category on [`NSAttributedString`].
453pub unsafe trait NSAttributedStringDocumentFormats:
454    ClassType + Sized + private_NSAttributedStringDocumentFormats::Sealed
455{
456    extern_methods!(
457        /// # Safety
458        ///
459        /// - `options` generic should be of the correct type.
460        /// - `dict` generic should be of the correct type.
461        #[unsafe(method(initWithURL:options:documentAttributes:error:_))]
462        #[unsafe(method_family = init)]
463        unsafe fn initWithURL_options_documentAttributes_error(
464            this: Allocated<Self>,
465            url: &NSURL,
466            options: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
467            dict: Option<
468                &mut Option<
469                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
470                >,
471            >,
472        ) -> Result<Retained<Self>, Retained<NSError>>;
473
474        /// # Safety
475        ///
476        /// - `options` generic should be of the correct type.
477        /// - `dict` generic should be of the correct type.
478        #[unsafe(method(initWithData:options:documentAttributes:error:_))]
479        #[unsafe(method_family = init)]
480        unsafe fn initWithData_options_documentAttributes_error(
481            this: Allocated<Self>,
482            data: &NSData,
483            options: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
484            dict: Option<
485                &mut Option<
486                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
487                >,
488            >,
489        ) -> Result<Retained<Self>, Retained<NSError>>;
490
491        /// # Safety
492        ///
493        /// `dict` generic should be of the correct type.
494        #[unsafe(method(dataFromRange:documentAttributes:error:_))]
495        #[unsafe(method_family = none)]
496        unsafe fn dataFromRange_documentAttributes_error(
497            &self,
498            range: NSRange,
499            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
500        ) -> Result<Retained<NSData>, Retained<NSError>>;
501
502        /// # Safety
503        ///
504        /// `dict` generic should be of the correct type.
505        #[unsafe(method(fileWrapperFromRange:documentAttributes:error:_))]
506        #[unsafe(method_family = none)]
507        unsafe fn fileWrapperFromRange_documentAttributes_error(
508            &self,
509            range: NSRange,
510            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
511        ) -> Result<Retained<NSFileWrapper>, Retained<NSError>>;
512    );
513}
514
515impl private_NSAttributedStringDocumentFormats::Sealed for NSAttributedString {}
516unsafe impl NSAttributedStringDocumentFormats for NSAttributedString {}
517
518mod private_NSMutableAttributedStringDocumentFormats {
519    pub trait Sealed {}
520}
521
522/// Category on [`NSMutableAttributedString`].
523pub unsafe trait NSMutableAttributedStringDocumentFormats:
524    ClassType + Sized + private_NSMutableAttributedStringDocumentFormats::Sealed
525{
526    extern_methods!(
527        /// # Safety
528        ///
529        /// - `opts` generic should be of the correct type.
530        /// - `dict` generic should be of the correct type.
531        #[unsafe(method(readFromURL:options:documentAttributes:error:_))]
532        #[unsafe(method_family = none)]
533        unsafe fn readFromURL_options_documentAttributes_error(
534            &self,
535            url: &NSURL,
536            opts: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
537            dict: Option<
538                &mut Option<
539                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
540                >,
541            >,
542        ) -> Result<(), Retained<NSError>>;
543
544        /// # Safety
545        ///
546        /// - `opts` generic should be of the correct type.
547        /// - `dict` generic should be of the correct type.
548        #[unsafe(method(readFromData:options:documentAttributes:error:_))]
549        #[unsafe(method_family = none)]
550        unsafe fn readFromData_options_documentAttributes_error(
551            &self,
552            data: &NSData,
553            opts: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
554            dict: Option<
555                &mut Option<
556                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
557                >,
558            >,
559        ) -> Result<(), Retained<NSError>>;
560    );
561}
562
563impl private_NSMutableAttributedStringDocumentFormats::Sealed for NSMutableAttributedString {}
564unsafe impl NSMutableAttributedStringDocumentFormats for NSMutableAttributedString {}
565
566mod private_NSAttributedStringKitAdditions {
567    pub trait Sealed {}
568}
569
570/// Category on [`NSAttributedString`].
571///
572/// ********************** Misc methods ***********************
573pub unsafe trait NSAttributedStringKitAdditions:
574    ClassType + Sized + private_NSAttributedStringKitAdditions::Sealed
575{
576    extern_methods!(
577        #[unsafe(method(containsAttachmentsInRange:))]
578        #[unsafe(method_family = none)]
579        fn containsAttachmentsInRange(&self, range: NSRange) -> bool;
580
581        #[unsafe(method(prefersRTFDInRange:))]
582        #[unsafe(method_family = none)]
583        fn prefersRTFDInRange(&self, range: NSRange) -> bool;
584    );
585}
586
587impl private_NSAttributedStringKitAdditions::Sealed for NSAttributedString {}
588unsafe impl NSAttributedStringKitAdditions for NSAttributedString {}
589
590extern "C" {
591    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscursorattributename?language=objc)
592    pub static NSCursorAttributeName: &'static NSAttributedStringKey;
593}
594
595extern "C" {
596    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstooltipattributename?language=objc)
597    pub static NSToolTipAttributeName: &'static NSAttributedStringKey;
598}
599
600extern "C" {
601    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmarkedclausesegmentattributename?language=objc)
602    pub static NSMarkedClauseSegmentAttributeName: &'static NSAttributedStringKey;
603}
604
605extern "C" {
606    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextalternativesattributename?language=objc)
607    pub static NSTextAlternativesAttributeName: &'static NSAttributedStringKey;
608}
609
610extern "C" {
611    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsspellingstateattributename?language=objc)
612    pub static NSSpellingStateAttributeName: &'static NSAttributedStringKey;
613}
614
615extern "C" {
616    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssuperscriptattributename?language=objc)
617    pub static NSSuperscriptAttributeName: &'static NSAttributedStringKey;
618}
619
620extern "C" {
621    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsglyphinfoattributename?language=objc)
622    pub static NSGlyphInfoAttributeName: &'static NSAttributedStringKey;
623}
624
625/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsspellingstate?language=objc)
626// NS_ENUM
627#[repr(transparent)]
628#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
629pub struct NSSpellingState(pub NSInteger);
630impl NSSpellingState {
631    #[doc(alias = "NSSpellingStateSpellingFlag")]
632    pub const SpellingFlag: Self = Self(1 << 0);
633    #[doc(alias = "NSSpellingStateGrammarFlag")]
634    pub const GrammarFlag: Self = Self(1 << 1);
635}
636
637unsafe impl Encode for NSSpellingState {
638    const ENCODING: Encoding = NSInteger::ENCODING;
639}
640
641unsafe impl RefEncode for NSSpellingState {
642    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
643}
644
645mod private_NSAttributedStringAppKitAttributeFixing {
646    pub trait Sealed {}
647}
648
649/// Category on [`NSMutableAttributedString`].
650///
651/// ********************** Attribute fixing ***********************
652pub unsafe trait NSAttributedStringAppKitAttributeFixing:
653    ClassType + Sized + private_NSAttributedStringAppKitAttributeFixing::Sealed
654{
655    extern_methods!(
656        #[unsafe(method(fixFontAttributeInRange:))]
657        #[unsafe(method_family = none)]
658        fn fixFontAttributeInRange(&self, range: NSRange);
659
660        #[unsafe(method(fixParagraphStyleAttributeInRange:))]
661        #[unsafe(method_family = none)]
662        fn fixParagraphStyleAttributeInRange(&self, range: NSRange);
663
664        #[unsafe(method(fixAttachmentAttributeInRange:))]
665        #[unsafe(method_family = none)]
666        fn fixAttachmentAttributeInRange(&self, range: NSRange);
667    );
668}
669
670impl private_NSAttributedStringAppKitAttributeFixing::Sealed for NSMutableAttributedString {}
671unsafe impl NSAttributedStringAppKitAttributeFixing for NSMutableAttributedString {}
672
673extern "C" {
674    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmacsimpletextdocumenttype?language=objc)
675    pub static NSMacSimpleTextDocumentType: &'static NSAttributedStringDocumentType;
676}
677
678extern "C" {
679    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdocformattextdocumenttype?language=objc)
680    pub static NSDocFormatTextDocumentType: &'static NSAttributedStringDocumentType;
681}
682
683extern "C" {
684    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswordmltextdocumenttype?language=objc)
685    pub static NSWordMLTextDocumentType: &'static NSAttributedStringDocumentType;
686}
687
688extern "C" {
689    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswebarchivetextdocumenttype?language=objc)
690    pub static NSWebArchiveTextDocumentType: &'static NSAttributedStringDocumentType;
691}
692
693extern "C" {
694    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsofficeopenxmltextdocumenttype?language=objc)
695    pub static NSOfficeOpenXMLTextDocumentType: &'static NSAttributedStringDocumentType;
696}
697
698extern "C" {
699    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsopendocumenttextdocumenttype?language=objc)
700    pub static NSOpenDocumentTextDocumentType: &'static NSAttributedStringDocumentType;
701}
702
703extern "C" {
704    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsconverteddocumentattribute?language=objc)
705    pub static NSConvertedDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
706}
707
708extern "C" {
709    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfiletypedocumentattribute?language=objc)
710    pub static NSFileTypeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
711}
712
713extern "C" {
714    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstitledocumentattribute?language=objc)
715    pub static NSTitleDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
716}
717
718extern "C" {
719    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscompanydocumentattribute?language=objc)
720    pub static NSCompanyDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
721}
722
723extern "C" {
724    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscopyrightdocumentattribute?language=objc)
725    pub static NSCopyrightDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
726}
727
728extern "C" {
729    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssubjectdocumentattribute?language=objc)
730    pub static NSSubjectDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
731}
732
733extern "C" {
734    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsauthordocumentattribute?language=objc)
735    pub static NSAuthorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
736}
737
738extern "C" {
739    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nskeywordsdocumentattribute?language=objc)
740    pub static NSKeywordsDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
741}
742
743extern "C" {
744    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscommentdocumentattribute?language=objc)
745    pub static NSCommentDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
746}
747
748extern "C" {
749    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nseditordocumentattribute?language=objc)
750    pub static NSEditorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
751}
752
753extern "C" {
754    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscreationtimedocumentattribute?language=objc)
755    pub static NSCreationTimeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
756}
757
758extern "C" {
759    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmodificationtimedocumentattribute?language=objc)
760    pub static NSModificationTimeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
761}
762
763extern "C" {
764    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmanagerdocumentattribute?language=objc)
765    pub static NSManagerDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
766}
767
768extern "C" {
769    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscategorydocumentattribute?language=objc)
770    pub static NSCategoryDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
771}
772
773extern "C" {
774    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappearancedocumentattribute?language=objc)
775    pub static NSAppearanceDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
776}
777
778extern "C" {
779    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsexcludedelementsdocumentattribute?language=objc)
780    pub static NSExcludedElementsDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
781}
782
783extern "C" {
784    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextencodingnamedocumentattribute?language=objc)
785    pub static NSTextEncodingNameDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
786}
787
788extern "C" {
789    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsprefixspacesdocumentattribute?language=objc)
790    pub static NSPrefixSpacesDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
791}
792
793extern "C" {
794    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsleftmargindocumentattribute?language=objc)
795    pub static NSLeftMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
796}
797
798extern "C" {
799    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsrightmargindocumentattribute?language=objc)
800    pub static NSRightMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
801}
802
803extern "C" {
804    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstopmargindocumentattribute?language=objc)
805    pub static NSTopMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
806}
807
808extern "C" {
809    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbottommargindocumentattribute?language=objc)
810    pub static NSBottomMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
811}
812
813extern "C" {
814    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextencodingnamedocumentoption?language=objc)
815    pub static NSTextEncodingNameDocumentOption:
816        &'static NSAttributedStringDocumentReadingOptionKey;
817}
818
819extern "C" {
820    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbaseurldocumentoption?language=objc)
821    pub static NSBaseURLDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
822}
823
824extern "C" {
825    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstimeoutdocumentoption?language=objc)
826    pub static NSTimeoutDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
827}
828
829extern "C" {
830    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswebpreferencesdocumentoption?language=objc)
831    pub static NSWebPreferencesDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
832}
833
834extern "C" {
835    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nswebresourceloaddelegatedocumentoption?language=objc)
836    pub static NSWebResourceLoadDelegateDocumentOption:
837        &'static NSAttributedStringDocumentReadingOptionKey;
838}
839
840extern "C" {
841    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstextsizemultiplierdocumentoption?language=objc)
842    pub static NSTextSizeMultiplierDocumentOption:
843        &'static NSAttributedStringDocumentReadingOptionKey;
844}
845
846extern "C" {
847    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfiletypedocumentoption?language=objc)
848    pub static NSFileTypeDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
849}
850
851mod private_NSAttributedStringAppKitDocumentFormats {
852    pub trait Sealed {}
853}
854
855/// Category on [`NSAttributedString`].
856pub unsafe trait NSAttributedStringAppKitDocumentFormats:
857    ClassType + Sized + private_NSAttributedStringAppKitDocumentFormats::Sealed
858{
859    extern_methods!(
860        /// # Safety
861        ///
862        /// `dict` generic should be of the correct type.
863        #[unsafe(method(initWithRTF:documentAttributes:))]
864        #[unsafe(method_family = init)]
865        unsafe fn initWithRTF_documentAttributes(
866            this: Allocated<Self>,
867            data: &NSData,
868            dict: Option<
869                &mut Option<
870                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
871                >,
872            >,
873        ) -> Option<Retained<Self>>;
874
875        /// # Safety
876        ///
877        /// `dict` generic should be of the correct type.
878        #[unsafe(method(initWithRTFD:documentAttributes:))]
879        #[unsafe(method_family = init)]
880        unsafe fn initWithRTFD_documentAttributes(
881            this: Allocated<Self>,
882            data: &NSData,
883            dict: Option<
884                &mut Option<
885                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
886                >,
887            >,
888        ) -> Option<Retained<Self>>;
889
890        /// # Safety
891        ///
892        /// `dict` generic should be of the correct type.
893        #[unsafe(method(initWithHTML:documentAttributes:))]
894        #[unsafe(method_family = init)]
895        unsafe fn initWithHTML_documentAttributes(
896            this: Allocated<Self>,
897            data: &NSData,
898            dict: Option<
899                &mut Option<
900                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
901                >,
902            >,
903        ) -> Option<Retained<Self>>;
904
905        /// # Safety
906        ///
907        /// `dict` generic should be of the correct type.
908        #[unsafe(method(initWithHTML:baseURL:documentAttributes:))]
909        #[unsafe(method_family = init)]
910        unsafe fn initWithHTML_baseURL_documentAttributes(
911            this: Allocated<Self>,
912            data: &NSData,
913            base: &NSURL,
914            dict: Option<
915                &mut Option<
916                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
917                >,
918            >,
919        ) -> Option<Retained<Self>>;
920
921        /// # Safety
922        ///
923        /// `dict` generic should be of the correct type.
924        #[unsafe(method(initWithDocFormat:documentAttributes:))]
925        #[unsafe(method_family = init)]
926        unsafe fn initWithDocFormat_documentAttributes(
927            this: Allocated<Self>,
928            data: &NSData,
929            dict: Option<
930                &mut Option<
931                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
932                >,
933            >,
934        ) -> Option<Retained<Self>>;
935
936        /// # Safety
937        ///
938        /// - `options` generic should be of the correct type.
939        /// - `dict` generic should be of the correct type.
940        #[unsafe(method(initWithHTML:options:documentAttributes:))]
941        #[unsafe(method_family = init)]
942        unsafe fn initWithHTML_options_documentAttributes(
943            this: Allocated<Self>,
944            data: &NSData,
945            options: &NSDictionary<NSAttributedStringDocumentReadingOptionKey, AnyObject>,
946            dict: Option<
947                &mut Option<
948                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
949                >,
950            >,
951        ) -> Option<Retained<Self>>;
952
953        /// # Safety
954        ///
955        /// `dict` generic should be of the correct type.
956        #[unsafe(method(initWithRTFDFileWrapper:documentAttributes:))]
957        #[unsafe(method_family = init)]
958        unsafe fn initWithRTFDFileWrapper_documentAttributes(
959            this: Allocated<Self>,
960            wrapper: &NSFileWrapper,
961            dict: Option<
962                &mut Option<
963                    Retained<NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>>,
964                >,
965            >,
966        ) -> Option<Retained<Self>>;
967
968        /// # Safety
969        ///
970        /// `dict` generic should be of the correct type.
971        #[unsafe(method(RTFFromRange:documentAttributes:))]
972        #[unsafe(method_family = none)]
973        unsafe fn RTFFromRange_documentAttributes(
974            &self,
975            range: NSRange,
976            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
977        ) -> Option<Retained<NSData>>;
978
979        /// # Safety
980        ///
981        /// `dict` generic should be of the correct type.
982        #[unsafe(method(RTFDFromRange:documentAttributes:))]
983        #[unsafe(method_family = none)]
984        unsafe fn RTFDFromRange_documentAttributes(
985            &self,
986            range: NSRange,
987            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
988        ) -> Option<Retained<NSData>>;
989
990        /// # Safety
991        ///
992        /// `dict` generic should be of the correct type.
993        #[unsafe(method(RTFDFileWrapperFromRange:documentAttributes:))]
994        #[unsafe(method_family = none)]
995        unsafe fn RTFDFileWrapperFromRange_documentAttributes(
996            &self,
997            range: NSRange,
998            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
999        ) -> Option<Retained<NSFileWrapper>>;
1000
1001        /// # Safety
1002        ///
1003        /// `dict` generic should be of the correct type.
1004        #[unsafe(method(docFormatFromRange:documentAttributes:))]
1005        #[unsafe(method_family = none)]
1006        unsafe fn docFormatFromRange_documentAttributes(
1007            &self,
1008            range: NSRange,
1009            dict: &NSDictionary<NSAttributedStringDocumentAttributeKey, AnyObject>,
1010        ) -> Option<Retained<NSData>>;
1011    );
1012}
1013
1014impl private_NSAttributedStringAppKitDocumentFormats::Sealed for NSAttributedString {}
1015unsafe impl NSAttributedStringAppKitDocumentFormats for NSAttributedString {}
1016
1017mod private_NSAttributedStringAppKitAdditions {
1018    pub trait Sealed {}
1019}
1020
1021/// Category on [`NSAttributedString`].
1022///
1023/// ********************** Misc methods ***********************
1024pub unsafe trait NSAttributedStringAppKitAdditions:
1025    ClassType + Sized + private_NSAttributedStringAppKitAdditions::Sealed
1026{
1027    extern_methods!(
1028        #[unsafe(method(fontAttributesInRange:))]
1029        #[unsafe(method_family = none)]
1030        fn fontAttributesInRange(
1031            &self,
1032            range: NSRange,
1033        ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
1034
1035        #[unsafe(method(rulerAttributesInRange:))]
1036        #[unsafe(method_family = none)]
1037        fn rulerAttributesInRange(
1038            &self,
1039            range: NSRange,
1040        ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
1041
1042        #[unsafe(method(lineBreakBeforeIndex:withinRange:))]
1043        #[unsafe(method_family = none)]
1044        fn lineBreakBeforeIndex_withinRange(
1045            &self,
1046            location: NSUInteger,
1047            a_range: NSRange,
1048        ) -> NSUInteger;
1049
1050        #[unsafe(method(lineBreakByHyphenatingBeforeIndex:withinRange:))]
1051        #[unsafe(method_family = none)]
1052        fn lineBreakByHyphenatingBeforeIndex_withinRange(
1053            &self,
1054            location: NSUInteger,
1055            a_range: NSRange,
1056        ) -> NSUInteger;
1057
1058        #[unsafe(method(doubleClickAtIndex:))]
1059        #[unsafe(method_family = none)]
1060        fn doubleClickAtIndex(&self, location: NSUInteger) -> NSRange;
1061
1062        #[unsafe(method(nextWordFromIndex:forward:))]
1063        #[unsafe(method_family = none)]
1064        fn nextWordFromIndex_forward(&self, location: NSUInteger, is_forward: bool) -> NSUInteger;
1065
1066        #[cfg(feature = "NSTextTable")]
1067        #[unsafe(method(rangeOfTextBlock:atIndex:))]
1068        #[unsafe(method_family = none)]
1069        fn rangeOfTextBlock_atIndex(&self, block: &NSTextBlock, location: NSUInteger) -> NSRange;
1070
1071        #[cfg(feature = "NSTextTable")]
1072        #[unsafe(method(rangeOfTextTable:atIndex:))]
1073        #[unsafe(method_family = none)]
1074        fn rangeOfTextTable_atIndex(&self, table: &NSTextTable, location: NSUInteger) -> NSRange;
1075
1076        #[cfg(feature = "NSTextList")]
1077        #[unsafe(method(rangeOfTextList:atIndex:))]
1078        #[unsafe(method_family = none)]
1079        fn rangeOfTextList_atIndex(&self, list: &NSTextList, location: NSUInteger) -> NSRange;
1080
1081        #[cfg(feature = "NSTextList")]
1082        #[unsafe(method(itemNumberInTextList:atIndex:))]
1083        #[unsafe(method_family = none)]
1084        fn itemNumberInTextList_atIndex(
1085            &self,
1086            list: &NSTextList,
1087            location: NSUInteger,
1088        ) -> NSInteger;
1089    );
1090}
1091
1092impl private_NSAttributedStringAppKitAdditions::Sealed for NSAttributedString {}
1093unsafe impl NSAttributedStringAppKitAdditions for NSAttributedString {}
1094
1095mod private_NSAttributedStringPasteboardAdditions {
1096    pub trait Sealed {}
1097}
1098
1099/// Category on [`NSAttributedString`].
1100pub unsafe trait NSAttributedStringPasteboardAdditions:
1101    ClassType + Sized + private_NSAttributedStringPasteboardAdditions::Sealed
1102{
1103    extern_methods!(
1104        #[unsafe(method(textTypes))]
1105        #[unsafe(method_family = none)]
1106        fn textTypes() -> Retained<NSArray<NSString>>;
1107
1108        #[unsafe(method(textUnfilteredTypes))]
1109        #[unsafe(method_family = none)]
1110        fn textUnfilteredTypes() -> Retained<NSArray<NSString>>;
1111    );
1112}
1113
1114impl private_NSAttributedStringPasteboardAdditions::Sealed for NSAttributedString {}
1115unsafe impl NSAttributedStringPasteboardAdditions for NSAttributedString {}
1116
1117#[cfg(feature = "NSPasteboard")]
1118extern_conformance!(
1119    unsafe impl NSPasteboardReading for NSAttributedString {}
1120);
1121
1122#[cfg(feature = "NSPasteboard")]
1123extern_conformance!(
1124    unsafe impl NSPasteboardWriting for NSAttributedString {}
1125);
1126
1127mod private_NSMutableAttributedStringAppKitAdditions {
1128    pub trait Sealed {}
1129}
1130
1131/// Category on [`NSMutableAttributedString`].
1132pub unsafe trait NSMutableAttributedStringAppKitAdditions:
1133    ClassType + Sized + private_NSMutableAttributedStringAppKitAdditions::Sealed
1134{
1135    extern_methods!(
1136        #[unsafe(method(superscriptRange:))]
1137        #[unsafe(method_family = none)]
1138        fn superscriptRange(&self, range: NSRange);
1139
1140        #[unsafe(method(subscriptRange:))]
1141        #[unsafe(method_family = none)]
1142        fn subscriptRange(&self, range: NSRange);
1143
1144        #[unsafe(method(unscriptRange:))]
1145        #[unsafe(method_family = none)]
1146        fn unscriptRange(&self, range: NSRange);
1147
1148        #[cfg(feature = "NSFontManager")]
1149        #[unsafe(method(applyFontTraits:range:))]
1150        #[unsafe(method_family = none)]
1151        fn applyFontTraits_range(&self, trait_mask: NSFontTraitMask, range: NSRange);
1152
1153        #[cfg(feature = "NSText")]
1154        #[unsafe(method(setAlignment:range:))]
1155        #[unsafe(method_family = none)]
1156        fn setAlignment_range(&self, alignment: NSTextAlignment, range: NSRange);
1157
1158        #[cfg(feature = "NSText")]
1159        #[unsafe(method(setBaseWritingDirection:range:))]
1160        #[unsafe(method_family = none)]
1161        fn setBaseWritingDirection_range(
1162            &self,
1163            writing_direction: NSWritingDirection,
1164            range: NSRange,
1165        );
1166    );
1167}
1168
1169impl private_NSMutableAttributedStringAppKitAdditions::Sealed for NSMutableAttributedString {}
1170unsafe impl NSMutableAttributedStringAppKitAdditions for NSMutableAttributedString {}
1171
1172/// ********************** Deprecated ***********************
1173///
1174/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinepatternsolid?language=objc)
1175pub static NSUnderlinePatternSolid: NSUnderlineStyle =
1176    NSUnderlineStyle(NSUnderlineStyle::PatternSolid.0);
1177
1178/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinepatterndot?language=objc)
1179pub static NSUnderlinePatternDot: NSUnderlineStyle =
1180    NSUnderlineStyle(NSUnderlineStyle::PatternDot.0);
1181
1182/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinepatterndash?language=objc)
1183pub static NSUnderlinePatternDash: NSUnderlineStyle =
1184    NSUnderlineStyle(NSUnderlineStyle::PatternDash.0);
1185
1186/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinepatterndashdot?language=objc)
1187pub static NSUnderlinePatternDashDot: NSUnderlineStyle =
1188    NSUnderlineStyle(NSUnderlineStyle::PatternDashDot.0);
1189
1190/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinepatterndashdotdot?language=objc)
1191pub static NSUnderlinePatternDashDotDot: NSUnderlineStyle =
1192    NSUnderlineStyle(NSUnderlineStyle::PatternDashDotDot.0);
1193
1194/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinebyword?language=objc)
1195pub static NSUnderlineByWord: NSUnderlineStyle = NSUnderlineStyle(NSUnderlineStyle::ByWord.0);
1196
1197extern "C" {
1198    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscharactershapeattributename?language=objc)
1199    #[deprecated = "This attribute is bound to a specific implementation of ATS feature and not generically supported by wide range of fonts. The majority of characters accessed through this API are now encoded in the Unicode standard. Use the CTFont feature API for fine control over character shape choices."]
1200    pub static NSCharacterShapeAttributeName: &'static NSAttributedStringKey;
1201}
1202
1203extern "C" {
1204    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsusesscreenfontsdocumentattribute?language=objc)
1205    #[deprecated]
1206    pub static NSUsesScreenFontsDocumentAttribute: &'static NSAttributedStringKey;
1207}
1208
1209extern "C" {
1210    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsobliquenessattributename?language=objc)
1211    #[deprecated = "This attribute is not supported with TextKit 2"]
1212    pub static NSObliquenessAttributeName: &'static NSAttributedStringKey;
1213}
1214
1215extern "C" {
1216    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsexpansionattributename?language=objc)
1217    #[deprecated = "This attribute is not supported with TextKit 2"]
1218    pub static NSExpansionAttributeName: &'static NSAttributedStringKey;
1219}
1220
1221extern "C" {
1222    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsverticalglyphformattributename?language=objc)
1223    #[deprecated = "This attribute is not supported with TextKit 2"]
1224    pub static NSVerticalGlyphFormAttributeName: &'static NSAttributedStringKey;
1225}
1226
1227/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsnounderlinestyle?language=objc)
1228#[deprecated = "Use NSUnderlineStyleNone instead"]
1229pub const NSNoUnderlineStyle: c_uint = 0;
1230/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssingleunderlinestyle?language=objc)
1231#[deprecated = "Use NSUnderlineStyleSingle instead"]
1232pub const NSSingleUnderlineStyle: c_uint = 1;
1233
1234extern "C" {
1235    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinestrikethroughmask?language=objc)
1236    #[deprecated = "Use NSStrikethroughStyleAttributeName instead"]
1237    pub static NSUnderlineStrikethroughMask: NSUInteger;
1238}
1239
1240extern "C" {
1241    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsunderlinebywordmask?language=objc)
1242    #[deprecated = "Use NSUnderlineByWord instead"]
1243    pub static NSUnderlineByWordMask: NSUInteger;
1244}
1245
1246mod private_NSAttributedStringNSDeprecatedKitAdditions {
1247    pub trait Sealed {}
1248}
1249
1250/// Category "NSDeprecatedKitAdditions" on [`NSAttributedString`].
1251#[doc(alias = "NSDeprecatedKitAdditions")]
1252pub unsafe trait NSAttributedStringNSDeprecatedKitAdditions:
1253    ClassType + Sized + private_NSAttributedStringNSDeprecatedKitAdditions::Sealed
1254{
1255    extern_methods!(
1256        #[unsafe(method(containsAttachments))]
1257        #[unsafe(method_family = none)]
1258        fn containsAttachments(&self) -> bool;
1259
1260        #[deprecated]
1261        #[unsafe(method(textFileTypes))]
1262        #[unsafe(method_family = none)]
1263        fn textFileTypes() -> Retained<NSArray>;
1264
1265        #[deprecated]
1266        #[unsafe(method(textPasteboardTypes))]
1267        #[unsafe(method_family = none)]
1268        fn textPasteboardTypes() -> Retained<NSArray>;
1269
1270        #[deprecated]
1271        #[unsafe(method(textUnfilteredFileTypes))]
1272        #[unsafe(method_family = none)]
1273        fn textUnfilteredFileTypes() -> Retained<NSArray>;
1274
1275        #[deprecated]
1276        #[unsafe(method(textUnfilteredPasteboardTypes))]
1277        #[unsafe(method_family = none)]
1278        fn textUnfilteredPasteboardTypes() -> Retained<NSArray>;
1279
1280        /// # Safety
1281        ///
1282        /// `dict` generic should be of the correct type.
1283        #[deprecated = "Use -initWithURL:options:documentAttributes:error: instead"]
1284        #[unsafe(method(initWithURL:documentAttributes:))]
1285        #[unsafe(method_family = init)]
1286        unsafe fn initWithURL_documentAttributes(
1287            this: Allocated<Self>,
1288            url: &NSURL,
1289            dict: Option<&mut Option<Retained<NSDictionary>>>,
1290        ) -> Option<Retained<Self>>;
1291
1292        /// # Safety
1293        ///
1294        /// `dict` generic should be of the correct type.
1295        #[deprecated = "Use -initWithURL:options:documentAttributes:error: instead"]
1296        #[unsafe(method(initWithPath:documentAttributes:))]
1297        #[unsafe(method_family = init)]
1298        unsafe fn initWithPath_documentAttributes(
1299            this: Allocated<Self>,
1300            path: &NSString,
1301            dict: Option<&mut Option<Retained<NSDictionary>>>,
1302        ) -> Option<Retained<Self>>;
1303
1304        /// # Safety
1305        ///
1306        /// `effective_range` must be a valid pointer.
1307        #[deprecated = "Use NSDataDetector instead"]
1308        #[unsafe(method(URLAtIndex:effectiveRange:))]
1309        #[unsafe(method_family = none)]
1310        unsafe fn URLAtIndex_effectiveRange(
1311            &self,
1312            location: NSUInteger,
1313            effective_range: NSRangePointer,
1314        ) -> Option<Retained<NSURL>>;
1315    );
1316}
1317
1318impl private_NSAttributedStringNSDeprecatedKitAdditions::Sealed for NSAttributedString {}
1319unsafe impl NSAttributedStringNSDeprecatedKitAdditions for NSAttributedString {}