objc2_ui_kit/generated/
NSAttributedString.rs1use 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 NSPaperMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
593}
594
595extern "C" {
596 #[deprecated = "This attribute is not supported with TextKit 2"]
600 pub static NSObliquenessAttributeName: &'static NSAttributedStringKey;
601}
602
603extern "C" {
604 #[deprecated = "This attribute is not supported with TextKit 2"]
606 pub static NSExpansionAttributeName: &'static NSAttributedStringKey;
607}
608
609extern "C" {
610 #[deprecated = "This attribute is not supported with TextKit 2"]
612 pub static NSVerticalGlyphFormAttributeName: &'static NSAttributedStringKey;
613}
614
615#[deprecated]
617pub static NSUnderlinePatternSolid: NSUnderlineStyle =
618 NSUnderlineStyle(NSUnderlineStyle::PatternSolid.0);
619
620#[deprecated]
622pub static NSUnderlinePatternDot: NSUnderlineStyle =
623 NSUnderlineStyle(NSUnderlineStyle::PatternDot.0);
624
625#[deprecated]
627pub static NSUnderlinePatternDash: NSUnderlineStyle =
628 NSUnderlineStyle(NSUnderlineStyle::PatternDash.0);
629
630#[deprecated]
632pub static NSUnderlinePatternDashDot: NSUnderlineStyle =
633 NSUnderlineStyle(NSUnderlineStyle::PatternDashDot.0);
634
635#[deprecated]
637pub static NSUnderlinePatternDashDotDot: NSUnderlineStyle =
638 NSUnderlineStyle(NSUnderlineStyle::PatternDashDotDot.0);
639
640#[deprecated]
642pub static NSUnderlineByWord: NSUnderlineStyle = NSUnderlineStyle(NSUnderlineStyle::ByWord.0);
643
644#[deprecated]
647#[repr(transparent)]
648#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
649pub struct NSTextWritingDirection(pub NSInteger);
650impl NSTextWritingDirection {
651 #[doc(alias = "NSTextWritingDirectionEmbedding")]
652 #[deprecated]
653 pub const Embedding: Self = Self(0 << 1);
654 #[doc(alias = "NSTextWritingDirectionOverride")]
655 #[deprecated]
656 pub const Override: Self = Self(1 << 1);
657}
658
659unsafe impl Encode for NSTextWritingDirection {
660 const ENCODING: Encoding = NSInteger::ENCODING;
661}
662
663unsafe impl RefEncode for NSTextWritingDirection {
664 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
665}