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:
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
259pub type NSAttributedStringDocumentType = NSString;
264
265extern "C" {
266 pub static NSPlainTextDocumentType: &'static NSAttributedStringDocumentType;
268}
269
270extern "C" {
271 pub static NSRTFTextDocumentType: &'static NSAttributedStringDocumentType;
273}
274
275extern "C" {
276 pub static NSRTFDTextDocumentType: &'static NSAttributedStringDocumentType;
278}
279
280extern "C" {
281 pub static NSHTMLTextDocumentType: &'static NSAttributedStringDocumentType;
283}
284
285pub type NSTextLayoutSectionKey = NSString;
288
289extern "C" {
290 pub static NSTextLayoutSectionOrientation: &'static NSTextLayoutSectionKey;
292}
293
294extern "C" {
295 pub static NSTextLayoutSectionRange: &'static NSTextLayoutSectionKey;
297}
298
299#[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
319pub type NSAttributedStringDocumentAttributeKey = NSString;
322
323extern "C" {
324 pub static NSDocumentTypeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
326}
327
328extern "C" {
329 pub static NSCharacterEncodingDocumentAttribute:
331 &'static NSAttributedStringDocumentAttributeKey;
332}
333
334extern "C" {
335 pub static NSDefaultAttributesDocumentAttribute:
337 &'static NSAttributedStringDocumentAttributeKey;
338}
339
340extern "C" {
341 pub static NSPaperSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
343}
344
345extern "C" {
346 pub static NSViewSizeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
348}
349
350extern "C" {
351 pub static NSViewZoomDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
353}
354
355extern "C" {
356 pub static NSViewModeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
358}
359
360extern "C" {
361 pub static NSDefaultFontExcludedDocumentAttribute:
363 &'static NSAttributedStringDocumentAttributeKey;
364}
365
366extern "C" {
367 pub static NSReadOnlyDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
369}
370
371extern "C" {
372 pub static NSBackgroundColorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
374}
375
376extern "C" {
377 pub static NSHyphenationFactorDocumentAttribute:
379 &'static NSAttributedStringDocumentAttributeKey;
380}
381
382extern "C" {
383 pub static NSDefaultTabIntervalDocumentAttribute:
385 &'static NSAttributedStringDocumentAttributeKey;
386}
387
388extern "C" {
389 pub static NSTextLayoutSectionsAttribute: &'static NSAttributedStringDocumentAttributeKey;
391}
392
393extern "C" {
394 pub static NSTextScalingDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
396}
397
398extern "C" {
399 pub static NSSourceTextScalingDocumentAttribute:
401 &'static NSAttributedStringDocumentAttributeKey;
402}
403
404extern "C" {
405 pub static NSCocoaVersionDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
407}
408
409pub type NSAttributedStringDocumentReadingOptionKey = NSString;
412
413extern "C" {
414 pub static NSDocumentTypeDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
416}
417
418extern "C" {
419 pub static NSDefaultAttributesDocumentOption:
421 &'static NSAttributedStringDocumentReadingOptionKey;
422}
423
424extern "C" {
425 pub static NSCharacterEncodingDocumentOption:
427 &'static NSAttributedStringDocumentReadingOptionKey;
428}
429
430extern "C" {
431 pub static NSTargetTextScalingDocumentOption:
433 &'static NSAttributedStringDocumentReadingOptionKey;
434}
435
436extern "C" {
437 pub static NSSourceTextScalingDocumentOption:
439 &'static NSAttributedStringDocumentReadingOptionKey;
440}
441
442extern "C" {
443 pub static NSTextKit1ListMarkerFormatDocumentOption:
445 &'static NSAttributedStringDocumentReadingOptionKey;
446}
447
448mod private_NSAttributedStringDocumentFormats {
449 pub trait Sealed {}
450}
451
452pub unsafe trait NSAttributedStringDocumentFormats:
454 ClassType + Sized + private_NSAttributedStringDocumentFormats::Sealed
455{
456 extern_methods!(
457 #[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 #[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 #[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 #[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
522pub unsafe trait NSMutableAttributedStringDocumentFormats:
524 ClassType + Sized + private_NSMutableAttributedStringDocumentFormats::Sealed
525{
526 extern_methods!(
527 #[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 #[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
570pub 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 pub static NSCursorAttributeName: &'static NSAttributedStringKey;
593}
594
595extern "C" {
596 pub static NSToolTipAttributeName: &'static NSAttributedStringKey;
598}
599
600extern "C" {
601 pub static NSMarkedClauseSegmentAttributeName: &'static NSAttributedStringKey;
603}
604
605extern "C" {
606 pub static NSTextAlternativesAttributeName: &'static NSAttributedStringKey;
608}
609
610extern "C" {
611 pub static NSSpellingStateAttributeName: &'static NSAttributedStringKey;
613}
614
615extern "C" {
616 pub static NSSuperscriptAttributeName: &'static NSAttributedStringKey;
618}
619
620extern "C" {
621 pub static NSGlyphInfoAttributeName: &'static NSAttributedStringKey;
623}
624
625#[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
649pub 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 pub static NSMacSimpleTextDocumentType: &'static NSAttributedStringDocumentType;
676}
677
678extern "C" {
679 pub static NSDocFormatTextDocumentType: &'static NSAttributedStringDocumentType;
681}
682
683extern "C" {
684 pub static NSWordMLTextDocumentType: &'static NSAttributedStringDocumentType;
686}
687
688extern "C" {
689 pub static NSWebArchiveTextDocumentType: &'static NSAttributedStringDocumentType;
691}
692
693extern "C" {
694 pub static NSOfficeOpenXMLTextDocumentType: &'static NSAttributedStringDocumentType;
696}
697
698extern "C" {
699 pub static NSOpenDocumentTextDocumentType: &'static NSAttributedStringDocumentType;
701}
702
703extern "C" {
704 pub static NSConvertedDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
706}
707
708extern "C" {
709 pub static NSFileTypeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
711}
712
713extern "C" {
714 pub static NSTitleDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
716}
717
718extern "C" {
719 pub static NSCompanyDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
721}
722
723extern "C" {
724 pub static NSCopyrightDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
726}
727
728extern "C" {
729 pub static NSSubjectDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
731}
732
733extern "C" {
734 pub static NSAuthorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
736}
737
738extern "C" {
739 pub static NSKeywordsDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
741}
742
743extern "C" {
744 pub static NSCommentDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
746}
747
748extern "C" {
749 pub static NSEditorDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
751}
752
753extern "C" {
754 pub static NSCreationTimeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
756}
757
758extern "C" {
759 pub static NSModificationTimeDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
761}
762
763extern "C" {
764 pub static NSManagerDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
766}
767
768extern "C" {
769 pub static NSCategoryDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
771}
772
773extern "C" {
774 pub static NSAppearanceDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
776}
777
778extern "C" {
779 pub static NSExcludedElementsDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
781}
782
783extern "C" {
784 pub static NSTextEncodingNameDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
786}
787
788extern "C" {
789 pub static NSPrefixSpacesDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
791}
792
793extern "C" {
794 pub static NSLeftMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
796}
797
798extern "C" {
799 pub static NSRightMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
801}
802
803extern "C" {
804 pub static NSTopMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
806}
807
808extern "C" {
809 pub static NSBottomMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
811}
812
813extern "C" {
814 pub static NSTextEncodingNameDocumentOption:
816 &'static NSAttributedStringDocumentReadingOptionKey;
817}
818
819extern "C" {
820 pub static NSBaseURLDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
822}
823
824extern "C" {
825 pub static NSTimeoutDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
827}
828
829extern "C" {
830 pub static NSWebPreferencesDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
832}
833
834extern "C" {
835 pub static NSWebResourceLoadDelegateDocumentOption:
837 &'static NSAttributedStringDocumentReadingOptionKey;
838}
839
840extern "C" {
841 pub static NSTextSizeMultiplierDocumentOption:
843 &'static NSAttributedStringDocumentReadingOptionKey;
844}
845
846extern "C" {
847 pub static NSFileTypeDocumentOption: &'static NSAttributedStringDocumentReadingOptionKey;
849}
850
851mod private_NSAttributedStringAppKitDocumentFormats {
852 pub trait Sealed {}
853}
854
855pub unsafe trait NSAttributedStringAppKitDocumentFormats:
857 ClassType + Sized + private_NSAttributedStringAppKitDocumentFormats::Sealed
858{
859 extern_methods!(
860 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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 #[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
1021pub 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
1099pub 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
1131pub 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
1172pub static NSUnderlinePatternSolid: NSUnderlineStyle =
1176 NSUnderlineStyle(NSUnderlineStyle::PatternSolid.0);
1177
1178pub static NSUnderlinePatternDot: NSUnderlineStyle =
1180 NSUnderlineStyle(NSUnderlineStyle::PatternDot.0);
1181
1182pub static NSUnderlinePatternDash: NSUnderlineStyle =
1184 NSUnderlineStyle(NSUnderlineStyle::PatternDash.0);
1185
1186pub static NSUnderlinePatternDashDot: NSUnderlineStyle =
1188 NSUnderlineStyle(NSUnderlineStyle::PatternDashDot.0);
1189
1190pub static NSUnderlinePatternDashDotDot: NSUnderlineStyle =
1192 NSUnderlineStyle(NSUnderlineStyle::PatternDashDotDot.0);
1193
1194pub static NSUnderlineByWord: NSUnderlineStyle = NSUnderlineStyle(NSUnderlineStyle::ByWord.0);
1196
1197extern "C" {
1198 #[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 #[deprecated]
1206 pub static NSUsesScreenFontsDocumentAttribute: &'static NSAttributedStringKey;
1207}
1208
1209extern "C" {
1210 #[deprecated = "This attribute is not supported with TextKit 2"]
1212 pub static NSObliquenessAttributeName: &'static NSAttributedStringKey;
1213}
1214
1215extern "C" {
1216 #[deprecated = "This attribute is not supported with TextKit 2"]
1218 pub static NSExpansionAttributeName: &'static NSAttributedStringKey;
1219}
1220
1221extern "C" {
1222 #[deprecated = "This attribute is not supported with TextKit 2"]
1224 pub static NSVerticalGlyphFormAttributeName: &'static NSAttributedStringKey;
1225}
1226
1227#[deprecated = "Use NSUnderlineStyleNone instead"]
1229pub const NSNoUnderlineStyle: c_uint = 0;
1230#[deprecated = "Use NSUnderlineStyleSingle instead"]
1232pub const NSSingleUnderlineStyle: c_uint = 1;
1233
1234extern "C" {
1235 #[deprecated = "Use NSStrikethroughStyleAttributeName instead"]
1237 pub static NSUnderlineStrikethroughMask: NSUInteger;
1238}
1239
1240extern "C" {
1241 #[deprecated = "Use NSUnderlineByWord instead"]
1243 pub static NSUnderlineByWordMask: NSUInteger;
1244}
1245
1246mod private_NSAttributedStringNSDeprecatedKitAdditions {
1247 pub trait Sealed {}
1248}
1249
1250#[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 #[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 #[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 #[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 {}