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:
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 NSPaperMarginDocumentAttribute: &'static NSAttributedStringDocumentAttributeKey;
569}
570
571extern "C" {
572 pub static NSObliquenessAttributeName: &'static NSAttributedStringKey;
576}
577
578extern "C" {
579 pub static NSExpansionAttributeName: &'static NSAttributedStringKey;
581}
582
583extern "C" {
584 pub static NSVerticalGlyphFormAttributeName: &'static NSAttributedStringKey;
586}
587
588pub static NSUnderlinePatternSolid: NSUnderlineStyle =
590 NSUnderlineStyle(NSUnderlineStyle::PatternSolid.0);
591
592pub static NSUnderlinePatternDot: NSUnderlineStyle =
594 NSUnderlineStyle(NSUnderlineStyle::PatternDot.0);
595
596pub static NSUnderlinePatternDash: NSUnderlineStyle =
598 NSUnderlineStyle(NSUnderlineStyle::PatternDash.0);
599
600pub static NSUnderlinePatternDashDot: NSUnderlineStyle =
602 NSUnderlineStyle(NSUnderlineStyle::PatternDashDot.0);
603
604pub static NSUnderlinePatternDashDotDot: NSUnderlineStyle =
606 NSUnderlineStyle(NSUnderlineStyle::PatternDashDotDot.0);
607
608pub static NSUnderlineByWord: NSUnderlineStyle = NSUnderlineStyle(NSUnderlineStyle::ByWord.0);
610
611#[deprecated]
614#[repr(transparent)]
615#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
616pub struct NSTextWritingDirection(pub NSInteger);
617impl NSTextWritingDirection {
618 #[doc(alias = "NSTextWritingDirectionEmbedding")]
619 #[deprecated]
620 pub const Embedding: Self = Self(0 << 1);
621 #[doc(alias = "NSTextWritingDirectionOverride")]
622 #[deprecated]
623 pub const Override: Self = Self(1 << 1);
624}
625
626unsafe impl Encode for NSTextWritingDirection {
627 const ENCODING: Encoding = NSInteger::ENCODING;
628}
629
630unsafe impl RefEncode for NSTextWritingDirection {
631 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
632}