1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11 pub static NSFontAttributeName: &'static NSAttributedStringKey;
15}
16
17extern "C" {
18 pub static NSParagraphStyleAttributeName: &'static NSAttributedStringKey;
20}
21
22extern "C" {
23 pub static NSForegroundColorAttributeName: &'static NSAttributedStringKey;
25}
26
27extern "C" {
28 pub static NSBackgroundColorAttributeName: &'static NSAttributedStringKey;
30}
31
32extern "C" {
33 pub static NSLigatureAttributeName: &'static NSAttributedStringKey;
35}
36
37extern "C" {
38 pub static NSKernAttributeName: &'static NSAttributedStringKey;
40}
41
42extern "C" {
43 pub static NSTrackingAttributeName: &'static NSAttributedStringKey;
45}
46
47extern "C" {
48 pub static NSStrikethroughStyleAttributeName: &'static NSAttributedStringKey;
50}
51
52extern "C" {
53 pub static NSUnderlineStyleAttributeName: &'static NSAttributedStringKey;
55}
56
57extern "C" {
58 pub static NSStrokeColorAttributeName: &'static NSAttributedStringKey;
60}
61
62extern "C" {
63 pub static NSStrokeWidthAttributeName: &'static NSAttributedStringKey;
65}
66
67extern "C" {
68 pub static NSShadowAttributeName: &'static NSAttributedStringKey;
70}
71
72extern "C" {
73 pub static NSTextEffectAttributeName: &'static NSAttributedStringKey;
75}
76
77extern "C" {
78 pub static NSAttachmentAttributeName: &'static NSAttributedStringKey;
80}
81
82extern "C" {
83 pub static NSLinkAttributeName: &'static NSAttributedStringKey;
85}
86
87extern "C" {
88 pub static NSBaselineOffsetAttributeName: &'static NSAttributedStringKey;
90}
91
92extern "C" {
93 pub static NSUnderlineColorAttributeName: &'static NSAttributedStringKey;
95}
96
97extern "C" {
98 pub static NSStrikethroughColorAttributeName: &'static NSAttributedStringKey;
100}
101
102extern "C" {
103 pub static NSWritingDirectionAttributeName: &'static NSAttributedStringKey;
105}
106
107extern "C" {
108 pub static NSTextHighlightStyleAttributeName: &'static NSAttributedStringKey;
110}
111
112extern "C" {
113 pub static NSTextHighlightColorSchemeAttributeName: &'static NSAttributedStringKey;
115}
116
117extern "C" {
118 pub static NSAdaptiveImageGlyphAttributeName: &'static NSAttributedStringKey;
120}
121
122extern "C" {
123 pub static NSWritingToolsExclusionAttributeName: &'static NSAttributedStringKey;
125}
126
127#[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#[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
187pub type NSTextEffectStyle = NSString;
190
191extern "C" {
192 pub static NSTextEffectLetterpressStyle: &'static NSTextEffectStyle;
194}
195
196pub type NSTextHighlightStyle = NSString;
199
200extern "C" {
201 pub static NSTextHighlightStyleDefault: &'static NSTextHighlightStyle;
203}
204
205pub type NSTextHighlightColorScheme = NSString;
208
209extern "C" {
210 pub static NSTextHighlightColorSchemeDefault: &'static NSTextHighlightColorScheme;
212}
213
214extern "C" {
215 pub static NSTextHighlightColorSchemePurple: &'static NSTextHighlightColorScheme;
217}
218
219extern "C" {
220 pub static NSTextHighlightColorSchemePink: &'static NSTextHighlightColorScheme;
222}
223
224extern "C" {
225 pub static NSTextHighlightColorSchemeOrange: &'static NSTextHighlightColorScheme;
227}
228
229extern "C" {
230 pub static NSTextHighlightColorSchemeMint: &'static NSTextHighlightColorScheme;
232}
233
234extern "C" {
235 pub static NSTextHighlightColorSchemeBlue: &'static NSTextHighlightColorScheme;
237}
238
239mod private_NSAttributedStringAttributeFixing {
240 pub trait Sealed {}
241}
242
243pub 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
258pub type NSAttributedStringDocumentType = NSString;
263
264extern "C" {
265 pub static NSPlainTextDocumentType: &'static NSAttributedStringDocumentType;
267}
268
269extern "C" {
270 pub static NSRTFTextDocumentType: &'static NSAttributedStringDocumentType;
272}
273
274extern "C" {
275 pub static NSRTFDTextDocumentType: &'static NSAttributedStringDocumentType;
277}
278
279extern "C" {
280 pub static NSHTMLTextDocumentType: &'static NSAttributedStringDocumentType;
282}
283
284pub type NSTextLayoutSectionKey = NSString;
287
288extern "C" {
289 pub static NSTextLayoutSectionOrientation: &'static NSTextLayoutSectionKey;
291}
292
293extern "C" {
294 pub static NSTextLayoutSectionRange: &'static NSTextLayoutSectionKey;
296}
297
298#[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
318pub type NSAttributedStringDocumentAttributeKey = NSString;
321
322extern "C" {
323 pub static NSDocumentTypeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
325}
326
327extern "C" {
328 pub static NSCharacterEncodingDocumentAttribute:
330 &'static NSAttributedStringDocumentAttributeKey;
331}
332
333extern "C" {
334 pub static NSDefaultAttributesDocumentAttribute:
336 &'static NSAttributedStringDocumentAttributeKey;
337}
338
339extern "C" {
340 pub static NSPaperSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
342}
343
344extern "C" {
345 pub static NSViewSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
347}
348
349extern "C" {
350 pub static NSViewZoomDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
352}
353
354extern "C" {
355 pub static NSViewModeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
357}
358
359extern "C" {
360 pub static NSDefaultFontExcludedDocumentAttribute:
362 &'static NSAttributedStringDocumentAttributeKey;
363}
364
365extern "C" {
366 pub static NSReadOnlyDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
368}
369
370extern "C" {
371 pub static NSBackgroundColorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
373}
374
375extern "C" {
376 pub static NSHyphenationFactorDocumentAttribute:
378 &'static NSAttributedStringDocumentAttributeKey;
379}
380
381extern "C" {
382 pub static NSDefaultTabIntervalDocumentAttribute:
384 &'static NSAttributedStringDocumentAttributeKey;
385}
386
387extern "C" {
388 pub static NSTextLayoutSectionsAttribute: &'static NSAttributedStringDocumentAttributeKey;
390}
391
392extern "C" {
393 pub static NSTextScalingDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
395}
396
397extern "C" {
398 pub static NSSourceTextScalingDocumentAttribute:
400 &'static NSAttributedStringDocumentAttributeKey;
401}
402
403extern "C" {
404 pub static NSCocoaVersionDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
406}
407
408pub type NSAttributedStringDocumentReadingOptionKey = NSString;
411
412extern "C" {
413 pub static NSDocumentTypeDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
415}
416
417extern "C" {
418 pub static NSDefaultAttributesDocumentOption:
420 &'static NSAttributedStringDocumentReadingOptionKey;
421}
422
423extern "C" {
424 pub static NSCharacterEncodingDocumentOption:
426 &'static NSAttributedStringDocumentReadingOptionKey;
427}
428
429extern "C" {
430 pub static NSTargetTextScalingDocumentOption:
432 &'static NSAttributedStringDocumentReadingOptionKey;
433}
434
435extern "C" {
436 pub static NSSourceTextScalingDocumentOption:
438 &'static NSAttributedStringDocumentReadingOptionKey;
439}
440
441extern "C" {
442 pub static NSTextKit1ListMarkerFormatDocumentOption:
444 &'static NSAttributedStringDocumentReadingOptionKey;
445}
446
447mod private_NSAttributedStringDocumentFormats {
448 pub trait Sealed {}
449}
450
451pub 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
507pub 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
547pub 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 pub static NSCursorAttributeName: &'static NSAttributedStringKey;
569}
570
571extern "C" {
572 pub static NSToolTipAttributeName: &'static NSAttributedStringKey;
574}
575
576extern "C" {
577 pub static NSMarkedClauseSegmentAttributeName: &'static NSAttributedStringKey;
579}
580
581extern "C" {
582 pub static NSTextAlternativesAttributeName: &'static NSAttributedStringKey;
584}
585
586extern "C" {
587 pub static NSSpellingStateAttributeName: &'static NSAttributedStringKey;
589}
590
591extern "C" {
592 pub static NSSuperscriptAttributeName: &'static NSAttributedStringKey;
594}
595
596extern "C" {
597 pub static NSGlyphInfoAttributeName: &'static NSAttributedStringKey;
599}
600
601#[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
625pub 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 pub static NSMacSimpleTextDocumentType: &'static NSAttributedStringDocumentType;
651}
652
653extern "C" {
654 pub static NSDocFormatTextDocumentType: &'static NSAttributedStringDocumentType;
656}
657
658extern "C" {
659 pub static NSWordMLTextDocumentType: &'static NSAttributedStringDocumentType;
661}
662
663extern "C" {
664 pub static NSWebArchiveTextDocumentType: &'static NSAttributedStringDocumentType;
666}
667
668extern "C" {
669 pub static NSOfficeOpenXMLTextDocumentType: &'static NSAttributedStringDocumentType;
671}
672
673extern "C" {
674 pub static NSOpenDocumentTextDocumentType: &'static NSAttributedStringDocumentType;
676}
677
678extern "C" {
679 pub static NSConvertedDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
681}
682
683extern "C" {
684 pub static NSFileTypeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
686}
687
688extern "C" {
689 pub static NSTitleDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
691}
692
693extern "C" {
694 pub static NSCompanyDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
696}
697
698extern "C" {
699 pub static NSCopyrightDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
701}
702
703extern "C" {
704 pub static NSSubjectDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
706}
707
708extern "C" {
709 pub static NSAuthorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
711}
712
713extern "C" {
714 pub static NSKeywordsDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
716}
717
718extern "C" {
719 pub static NSCommentDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
721}
722
723extern "C" {
724 pub static NSEditorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
726}
727
728extern "C" {
729 pub static NSCreationTimeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
731}
732
733extern "C" {
734 pub static NSModificationTimeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
736}
737
738extern "C" {
739 pub static NSManagerDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
741}
742
743extern "C" {
744 pub static NSCategoryDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
746}
747
748extern "C" {
749 pub static NSAppearanceDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
751}
752
753extern "C" {
754 pub static NSExcludedElementsDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
756}
757
758extern "C" {
759 pub static NSTextEncodingNameDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
761}
762
763extern "C" {
764 pub static NSPrefixSpacesDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
766}
767
768extern "C" {
769 pub static NSLeftMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
771}
772
773extern "C" {
774 pub static NSRightMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
776}
777
778extern "C" {
779 pub static NSTopMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
781}
782
783extern "C" {
784 pub static NSBottomMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
786}
787
788extern "C" {
789 pub static NSTextEncodingNameDocumentOption:
791 &'static NSAttributedStringDocumentReadingOptionKey;
792}
793
794extern "C" {
795 pub static NSBaseURLDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
797}
798
799extern "C" {
800 pub static NSTimeoutDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
802}
803
804extern "C" {
805 pub static NSWebPreferencesDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
807}
808
809extern "C" {
810 pub static NSWebResourceLoadDelegateDocumentOption:
812 &'static NSAttributedStringDocumentReadingOptionKey;
813}
814
815extern "C" {
816 pub static NSTextSizeMultiplierDocumentOption:
818 &'static NSAttributedStringDocumentReadingOptionKey;
819}
820
821extern "C" {
822 pub static NSFileTypeDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
824}
825
826mod private_NSAttributedStringAppKitDocumentFormats {
827 pub trait Sealed {}
828}
829
830pub 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
962pub 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
1055pub 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
1087pub 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
1128pub static NSUnderlinePatternSolid: NSUnderlineStyle =
1132 NSUnderlineStyle(NSUnderlineStyle::PatternSolid.0);
1133
1134pub static NSUnderlinePatternDot: NSUnderlineStyle =
1136 NSUnderlineStyle(NSUnderlineStyle::PatternDot.0);
1137
1138pub static NSUnderlinePatternDash: NSUnderlineStyle =
1140 NSUnderlineStyle(NSUnderlineStyle::PatternDash.0);
1141
1142pub static NSUnderlinePatternDashDot: NSUnderlineStyle =
1144 NSUnderlineStyle(NSUnderlineStyle::PatternDashDot.0);
1145
1146pub static NSUnderlinePatternDashDotDot: NSUnderlineStyle =
1148 NSUnderlineStyle(NSUnderlineStyle::PatternDashDotDot.0);
1149
1150pub static NSUnderlineByWord: NSUnderlineStyle = NSUnderlineStyle(NSUnderlineStyle::ByWord.0);
1152
1153extern "C" {
1154 pub static NSCharacterShapeAttributeName: &'static NSAttributedStringKey;
1156}
1157
1158extern "C" {
1159 pub static NSUsesScreenFontsDocumentAttribute: &'static NSAttributedStringKey;
1161}
1162
1163extern "C" {
1164 pub static NSObliquenessAttributeName: &'static NSAttributedStringKey;
1166}
1167
1168extern "C" {
1169 pub static NSExpansionAttributeName: &'static NSAttributedStringKey;
1171}
1172
1173extern "C" {
1174 pub static NSVerticalGlyphFormAttributeName: &'static NSAttributedStringKey;
1176}
1177
1178#[deprecated = "Use NSUnderlineStyleNone instead"]
1180pub const NSNoUnderlineStyle: c_uint = 0;
1181#[deprecated = "Use NSUnderlineStyleSingle instead"]
1183pub const NSSingleUnderlineStyle: c_uint = 1;
1184
1185extern "C" {
1186 pub static NSUnderlineStrikethroughMask: NSUInteger;
1188}
1189
1190extern "C" {
1191 pub static NSUnderlineByWordMask: NSUInteger;
1193}
1194
1195mod private_NSAttributedStringNSDeprecatedKitAdditions {
1196 pub trait Sealed {}
1197}
1198
1199#[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 {}