icrate 0.1.2

Bindings to Apple's frameworks
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::Foundation::*;

typed_extensible_enum!(
    pub type NSAttributedStringKey = NSString;
);

typed_extensible_enum!(
    pub type NSAttributedStringFormattingContextKey = NSString;
);

extern_static!(NSInflectionConceptsKey: &'static NSAttributedStringFormattingContextKey);

extern_class!(
    #[derive(PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSAttributedString")]
    pub struct NSAttributedString;

    #[cfg(feature = "Foundation_NSAttributedString")]
    unsafe impl ClassType for NSAttributedString {
        type Super = NSObject;
        type Mutability = ImmutableWithMutableSubclass<NSMutableAttributedString>;
    }
);

#[cfg(feature = "Foundation_NSAttributedString")]
unsafe impl NSCoding for NSAttributedString {}

#[cfg(feature = "Foundation_NSAttributedString")]
unsafe impl NSCopying for NSAttributedString {}

#[cfg(feature = "Foundation_NSAttributedString")]
unsafe impl NSMutableCopying for NSAttributedString {}

#[cfg(feature = "Foundation_NSAttributedString")]
unsafe impl NSObjectProtocol for NSAttributedString {}

#[cfg(feature = "Foundation_NSAttributedString")]
unsafe impl NSSecureCoding for NSAttributedString {}

extern_methods!(
    #[cfg(feature = "Foundation_NSAttributedString")]
    unsafe impl NSAttributedString {
        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other string)]
        pub fn string(&self) -> Id<NSString>;

        #[cfg(feature = "Foundation_NSDictionary")]
        #[method_id(@__retain_semantics Other attributesAtIndex:effectiveRange:)]
        pub unsafe fn attributesAtIndex_effectiveRange(
            &self,
            location: NSUInteger,
            range: NSRangePointer,
        ) -> Id<NSDictionary<NSAttributedStringKey, AnyObject>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSAttributedString")]
    unsafe impl NSAttributedString {
        #[method_id(@__retain_semantics Init init)]
        pub fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub fn new() -> Id<Self>;
    }
);

#[cfg(feature = "Foundation_NSAttributedString")]
impl DefaultId for NSAttributedString {
    #[inline]
    fn default_id() -> Id<Self> {
        Self::new()
    }
}

ns_options!(
    #[underlying(NSUInteger)]
    pub enum NSAttributedStringEnumerationOptions {
        NSAttributedStringEnumerationReverse = 1 << 1,
        NSAttributedStringEnumerationLongestEffectiveRangeNotRequired = 1 << 20,
    }
);

extern_methods!(
    /// NSExtendedAttributedString
    #[cfg(feature = "Foundation_NSAttributedString")]
    unsafe impl NSAttributedString {
        #[method(length)]
        pub fn length(&self) -> NSUInteger;

        #[method_id(@__retain_semantics Other attribute:atIndex:effectiveRange:)]
        pub unsafe fn attribute_atIndex_effectiveRange(
            &self,
            attr_name: &NSAttributedStringKey,
            location: NSUInteger,
            range: NSRangePointer,
        ) -> Option<Id<AnyObject>>;

        #[method_id(@__retain_semantics Other attributedSubstringFromRange:)]
        pub unsafe fn attributedSubstringFromRange(&self, range: NSRange)
            -> Id<NSAttributedString>;

        #[cfg(feature = "Foundation_NSDictionary")]
        #[method_id(@__retain_semantics Other attributesAtIndex:longestEffectiveRange:inRange:)]
        pub unsafe fn attributesAtIndex_longestEffectiveRange_inRange(
            &self,
            location: NSUInteger,
            range: NSRangePointer,
            range_limit: NSRange,
        ) -> Id<NSDictionary<NSAttributedStringKey, AnyObject>>;

        #[method_id(@__retain_semantics Other attribute:atIndex:longestEffectiveRange:inRange:)]
        pub unsafe fn attribute_atIndex_longestEffectiveRange_inRange(
            &self,
            attr_name: &NSAttributedStringKey,
            location: NSUInteger,
            range: NSRangePointer,
            range_limit: NSRange,
        ) -> Option<Id<AnyObject>>;

        #[method(isEqualToAttributedString:)]
        pub unsafe fn isEqualToAttributedString(&self, other: &NSAttributedString) -> bool;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Init initWithString:)]
        pub fn initWithString(this: Allocated<Self>, str: &NSString) -> Id<Self>;

        #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Init initWithString:attributes:)]
        pub unsafe fn initWithString_attributes(
            this: Allocated<Self>,
            str: &NSString,
            attrs: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
        ) -> Id<Self>;

        #[method_id(@__retain_semantics Init initWithAttributedString:)]
        pub fn initWithAttributedString(
            this: Allocated<Self>,
            attr_str: &NSAttributedString,
        ) -> Id<Self>;

        #[cfg(feature = "Foundation_NSDictionary")]
        #[method(enumerateAttributesInRange:options:usingBlock:)]
        pub unsafe fn enumerateAttributesInRange_options_usingBlock(
            &self,
            enumeration_range: NSRange,
            opts: NSAttributedStringEnumerationOptions,
            block: &Block<
                (
                    NonNull<NSDictionary<NSAttributedStringKey, AnyObject>>,
                    NSRange,
                    NonNull<Bool>,
                ),
                (),
            >,
        );

        #[method(enumerateAttribute:inRange:options:usingBlock:)]
        pub unsafe fn enumerateAttribute_inRange_options_usingBlock(
            &self,
            attr_name: &NSAttributedStringKey,
            enumeration_range: NSRange,
            opts: NSAttributedStringEnumerationOptions,
            block: &Block<(*mut AnyObject, NSRange, NonNull<Bool>), ()>,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSAttributedString`
    ///
    /// NSExtendedAttributedString
    #[cfg(feature = "Foundation_NSMutableAttributedString")]
    unsafe impl NSMutableAttributedString {
        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Init initWithString:)]
        pub fn initWithString(this: Allocated<Self>, str: &NSString) -> Id<Self>;

        #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Init initWithString:attributes:)]
        pub unsafe fn initWithString_attributes(
            this: Allocated<Self>,
            str: &NSString,
            attrs: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
        ) -> Id<Self>;

        #[method_id(@__retain_semantics Init initWithAttributedString:)]
        pub fn initWithAttributedString(
            this: Allocated<Self>,
            attr_str: &NSAttributedString,
        ) -> Id<Self>;
    }
);

extern_class!(
    #[derive(PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSAttributedString")]
    pub struct NSMutableAttributedString;

    #[cfg(feature = "Foundation_NSAttributedString")]
    unsafe impl ClassType for NSMutableAttributedString {
        #[inherits(NSObject)]
        type Super = NSAttributedString;
        type Mutability = MutableWithImmutableSuperclass<NSAttributedString>;
    }
);

#[cfg(feature = "Foundation_NSMutableAttributedString")]
unsafe impl NSCoding for NSMutableAttributedString {}

#[cfg(feature = "Foundation_NSMutableAttributedString")]
unsafe impl NSCopying for NSMutableAttributedString {}

#[cfg(feature = "Foundation_NSMutableAttributedString")]
unsafe impl NSMutableCopying for NSMutableAttributedString {}

#[cfg(feature = "Foundation_NSMutableAttributedString")]
unsafe impl NSObjectProtocol for NSMutableAttributedString {}

#[cfg(feature = "Foundation_NSMutableAttributedString")]
unsafe impl NSSecureCoding for NSMutableAttributedString {}

extern_methods!(
    #[cfg(feature = "Foundation_NSMutableAttributedString")]
    unsafe impl NSMutableAttributedString {
        #[cfg(feature = "Foundation_NSString")]
        #[method(replaceCharactersInRange:withString:)]
        pub unsafe fn replaceCharactersInRange_withString(
            &mut self,
            range: NSRange,
            str: &NSString,
        );

        #[cfg(feature = "Foundation_NSDictionary")]
        #[method(setAttributes:range:)]
        pub unsafe fn setAttributes_range(
            &mut self,
            attrs: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
            range: NSRange,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSMutableAttributedString")]
    unsafe impl NSMutableAttributedString {
        #[method_id(@__retain_semantics Init init)]
        pub fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub fn new() -> Id<Self>;
    }
);

#[cfg(feature = "Foundation_NSMutableAttributedString")]
impl DefaultId for NSMutableAttributedString {
    #[inline]
    fn default_id() -> Id<Self> {
        Self::new()
    }
}

extern_methods!(
    /// NSExtendedMutableAttributedString
    #[cfg(feature = "Foundation_NSMutableAttributedString")]
    unsafe impl NSMutableAttributedString {
        #[cfg(feature = "Foundation_NSMutableString")]
        #[method_id(@__retain_semantics Other mutableString)]
        pub unsafe fn mutableString(&self) -> Id<NSMutableString>;

        #[method(addAttribute:value:range:)]
        pub unsafe fn addAttribute_value_range(
            &mut self,
            name: &NSAttributedStringKey,
            value: &AnyObject,
            range: NSRange,
        );

        #[cfg(feature = "Foundation_NSDictionary")]
        #[method(addAttributes:range:)]
        pub unsafe fn addAttributes_range(
            &mut self,
            attrs: &NSDictionary<NSAttributedStringKey, AnyObject>,
            range: NSRange,
        );

        #[method(removeAttribute:range:)]
        pub unsafe fn removeAttribute_range(
            &mut self,
            name: &NSAttributedStringKey,
            range: NSRange,
        );

        #[cfg(feature = "Foundation_NSAttributedString")]
        #[method(replaceCharactersInRange:withAttributedString:)]
        pub unsafe fn replaceCharactersInRange_withAttributedString(
            &mut self,
            range: NSRange,
            attr_string: &NSAttributedString,
        );

        #[cfg(feature = "Foundation_NSAttributedString")]
        #[method(insertAttributedString:atIndex:)]
        pub unsafe fn insertAttributedString_atIndex(
            &mut self,
            attr_string: &NSAttributedString,
            loc: NSUInteger,
        );

        #[cfg(feature = "Foundation_NSAttributedString")]
        #[method(appendAttributedString:)]
        pub unsafe fn appendAttributedString(&mut self, attr_string: &NSAttributedString);

        #[method(deleteCharactersInRange:)]
        pub unsafe fn deleteCharactersInRange(&mut self, range: NSRange);

        #[cfg(feature = "Foundation_NSAttributedString")]
        #[method(setAttributedString:)]
        pub fn setAttributedString(&mut self, attr_string: &NSAttributedString);

        #[method(beginEditing)]
        pub unsafe fn beginEditing(&mut self);

        #[method(endEditing)]
        pub unsafe fn endEditing(&mut self);
    }
);

ns_options!(
    #[underlying(NSUInteger)]
    pub enum NSInlinePresentationIntent {
        NSInlinePresentationIntentEmphasized = 1 << 0,
        NSInlinePresentationIntentStronglyEmphasized = 1 << 1,
        NSInlinePresentationIntentCode = 1 << 2,
        NSInlinePresentationIntentStrikethrough = 1 << 5,
        NSInlinePresentationIntentSoftBreak = 1 << 6,
        NSInlinePresentationIntentLineBreak = 1 << 7,
        NSInlinePresentationIntentInlineHTML = 1 << 8,
        NSInlinePresentationIntentBlockHTML = 1 << 9,
    }
);

extern_static!(NSInlinePresentationIntentAttributeName: &'static NSAttributedStringKey);

extern_static!(NSAlternateDescriptionAttributeName: &'static NSAttributedStringKey);

extern_static!(NSImageURLAttributeName: &'static NSAttributedStringKey);

extern_static!(NSLanguageIdentifierAttributeName: &'static NSAttributedStringKey);

extern_static!(NSMarkdownSourcePositionAttributeName: &'static NSAttributedStringKey);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum NSAttributedStringMarkdownParsingFailurePolicy {
        NSAttributedStringMarkdownParsingFailureReturnError = 0,
        NSAttributedStringMarkdownParsingFailureReturnPartiallyParsedIfPossible = 1,
    }
);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum NSAttributedStringMarkdownInterpretedSyntax {
        NSAttributedStringMarkdownInterpretedSyntaxFull = 0,
        NSAttributedStringMarkdownInterpretedSyntaxInlineOnly = 1,
        NSAttributedStringMarkdownInterpretedSyntaxInlineOnlyPreservingWhitespace = 2,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSAttributedStringMarkdownSourcePosition")]
    pub struct NSAttributedStringMarkdownSourcePosition;

    #[cfg(feature = "Foundation_NSAttributedStringMarkdownSourcePosition")]
    unsafe impl ClassType for NSAttributedStringMarkdownSourcePosition {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Foundation_NSAttributedStringMarkdownSourcePosition")]
unsafe impl NSCoding for NSAttributedStringMarkdownSourcePosition {}

#[cfg(feature = "Foundation_NSAttributedStringMarkdownSourcePosition")]
unsafe impl NSCopying for NSAttributedStringMarkdownSourcePosition {}

#[cfg(feature = "Foundation_NSAttributedStringMarkdownSourcePosition")]
unsafe impl NSObjectProtocol for NSAttributedStringMarkdownSourcePosition {}

#[cfg(feature = "Foundation_NSAttributedStringMarkdownSourcePosition")]
unsafe impl NSSecureCoding for NSAttributedStringMarkdownSourcePosition {}

extern_methods!(
    #[cfg(feature = "Foundation_NSAttributedStringMarkdownSourcePosition")]
    unsafe impl NSAttributedStringMarkdownSourcePosition {
        #[method(startLine)]
        pub unsafe fn startLine(&self) -> NSInteger;

        #[method(startColumn)]
        pub unsafe fn startColumn(&self) -> NSInteger;

        #[method(endLine)]
        pub unsafe fn endLine(&self) -> NSInteger;

        #[method(endColumn)]
        pub unsafe fn endColumn(&self) -> NSInteger;

        #[method_id(@__retain_semantics Init initWithStartLine:startColumn:endLine:endColumn:)]
        pub unsafe fn initWithStartLine_startColumn_endLine_endColumn(
            this: Allocated<Self>,
            start_line: NSInteger,
            start_column: NSInteger,
            end_line: NSInteger,
            end_column: NSInteger,
        ) -> Id<Self>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(rangeInString:)]
        pub unsafe fn rangeInString(&self, string: &NSString) -> NSRange;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSAttributedStringMarkdownSourcePosition")]
    unsafe impl NSAttributedStringMarkdownSourcePosition {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSAttributedStringMarkdownParsingOptions")]
    pub struct NSAttributedStringMarkdownParsingOptions;

    #[cfg(feature = "Foundation_NSAttributedStringMarkdownParsingOptions")]
    unsafe impl ClassType for NSAttributedStringMarkdownParsingOptions {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Foundation_NSAttributedStringMarkdownParsingOptions")]
unsafe impl NSCopying for NSAttributedStringMarkdownParsingOptions {}

#[cfg(feature = "Foundation_NSAttributedStringMarkdownParsingOptions")]
unsafe impl NSObjectProtocol for NSAttributedStringMarkdownParsingOptions {}

extern_methods!(
    #[cfg(feature = "Foundation_NSAttributedStringMarkdownParsingOptions")]
    unsafe impl NSAttributedStringMarkdownParsingOptions {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method(allowsExtendedAttributes)]
        pub unsafe fn allowsExtendedAttributes(&self) -> bool;

        #[method(setAllowsExtendedAttributes:)]
        pub unsafe fn setAllowsExtendedAttributes(&self, allows_extended_attributes: bool);

        #[method(interpretedSyntax)]
        pub unsafe fn interpretedSyntax(&self) -> NSAttributedStringMarkdownInterpretedSyntax;

        #[method(setInterpretedSyntax:)]
        pub unsafe fn setInterpretedSyntax(
            &self,
            interpreted_syntax: NSAttributedStringMarkdownInterpretedSyntax,
        );

        #[method(failurePolicy)]
        pub unsafe fn failurePolicy(&self) -> NSAttributedStringMarkdownParsingFailurePolicy;

        #[method(setFailurePolicy:)]
        pub unsafe fn setFailurePolicy(
            &self,
            failure_policy: NSAttributedStringMarkdownParsingFailurePolicy,
        );

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other languageCode)]
        pub unsafe fn languageCode(&self) -> Option<Id<NSString>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(setLanguageCode:)]
        pub unsafe fn setLanguageCode(&self, language_code: Option<&NSString>);

        #[method(appliesSourcePositionAttributes)]
        pub unsafe fn appliesSourcePositionAttributes(&self) -> bool;

        #[method(setAppliesSourcePositionAttributes:)]
        pub unsafe fn setAppliesSourcePositionAttributes(
            &self,
            applies_source_position_attributes: bool,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSAttributedStringMarkdownParsingOptions")]
    unsafe impl NSAttributedStringMarkdownParsingOptions {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_methods!(
    /// NSAttributedStringCreateFromMarkdown
    #[cfg(feature = "Foundation_NSAttributedString")]
    unsafe impl NSAttributedString {
        #[cfg(all(
            feature = "Foundation_NSAttributedStringMarkdownParsingOptions",
            feature = "Foundation_NSError",
            feature = "Foundation_NSURL"
        ))]
        #[method_id(@__retain_semantics Init initWithContentsOfMarkdownFileAtURL:options:baseURL:error:_)]
        pub unsafe fn initWithContentsOfMarkdownFileAtURL_options_baseURL_error(
            this: Allocated<Self>,
            markdown_file: &NSURL,
            options: Option<&NSAttributedStringMarkdownParsingOptions>,
            base_url: Option<&NSURL>,
        ) -> Result<Id<Self>, Id<NSError>>;

        #[cfg(all(
            feature = "Foundation_NSAttributedStringMarkdownParsingOptions",
            feature = "Foundation_NSData",
            feature = "Foundation_NSError",
            feature = "Foundation_NSURL"
        ))]
        #[method_id(@__retain_semantics Init initWithMarkdown:options:baseURL:error:_)]
        pub unsafe fn initWithMarkdown_options_baseURL_error(
            this: Allocated<Self>,
            markdown: &NSData,
            options: Option<&NSAttributedStringMarkdownParsingOptions>,
            base_url: Option<&NSURL>,
        ) -> Result<Id<Self>, Id<NSError>>;

        #[cfg(all(
            feature = "Foundation_NSAttributedStringMarkdownParsingOptions",
            feature = "Foundation_NSError",
            feature = "Foundation_NSString",
            feature = "Foundation_NSURL"
        ))]
        #[method_id(@__retain_semantics Init initWithMarkdownString:options:baseURL:error:_)]
        pub unsafe fn initWithMarkdownString_options_baseURL_error(
            this: Allocated<Self>,
            markdown_string: &NSString,
            options: Option<&NSAttributedStringMarkdownParsingOptions>,
            base_url: Option<&NSURL>,
        ) -> Result<Id<Self>, Id<NSError>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSAttributedString`
    ///
    /// NSAttributedStringCreateFromMarkdown
    #[cfg(feature = "Foundation_NSMutableAttributedString")]
    unsafe impl NSMutableAttributedString {
        #[cfg(all(
            feature = "Foundation_NSAttributedStringMarkdownParsingOptions",
            feature = "Foundation_NSError",
            feature = "Foundation_NSURL"
        ))]
        #[method_id(@__retain_semantics Init initWithContentsOfMarkdownFileAtURL:options:baseURL:error:_)]
        pub unsafe fn initWithContentsOfMarkdownFileAtURL_options_baseURL_error(
            this: Allocated<Self>,
            markdown_file: &NSURL,
            options: Option<&NSAttributedStringMarkdownParsingOptions>,
            base_url: Option<&NSURL>,
        ) -> Result<Id<Self>, Id<NSError>>;

        #[cfg(all(
            feature = "Foundation_NSAttributedStringMarkdownParsingOptions",
            feature = "Foundation_NSData",
            feature = "Foundation_NSError",
            feature = "Foundation_NSURL"
        ))]
        #[method_id(@__retain_semantics Init initWithMarkdown:options:baseURL:error:_)]
        pub unsafe fn initWithMarkdown_options_baseURL_error(
            this: Allocated<Self>,
            markdown: &NSData,
            options: Option<&NSAttributedStringMarkdownParsingOptions>,
            base_url: Option<&NSURL>,
        ) -> Result<Id<Self>, Id<NSError>>;

        #[cfg(all(
            feature = "Foundation_NSAttributedStringMarkdownParsingOptions",
            feature = "Foundation_NSError",
            feature = "Foundation_NSString",
            feature = "Foundation_NSURL"
        ))]
        #[method_id(@__retain_semantics Init initWithMarkdownString:options:baseURL:error:_)]
        pub unsafe fn initWithMarkdownString_options_baseURL_error(
            this: Allocated<Self>,
            markdown_string: &NSString,
            options: Option<&NSAttributedStringMarkdownParsingOptions>,
            base_url: Option<&NSURL>,
        ) -> Result<Id<Self>, Id<NSError>>;
    }
);

ns_options!(
    #[underlying(NSUInteger)]
    pub enum NSAttributedStringFormattingOptions {
        NSAttributedStringFormattingInsertArgumentAttributesWithoutMerging = 1 << 0,
        NSAttributedStringFormattingApplyReplacementIndexAttribute = 1 << 1,
    }
);

extern_methods!(
    /// NSAttributedStringFormatting
    #[cfg(feature = "Foundation_NSAttributedString")]
    unsafe impl NSAttributedString {}
);

extern_methods!(
    /// NSMutableAttributedStringFormatting
    #[cfg(feature = "Foundation_NSMutableAttributedString")]
    unsafe impl NSMutableAttributedString {}
);

extern_static!(NSReplacementIndexAttributeName: &'static NSAttributedStringKey);

extern_methods!(
    /// NSMorphology
    #[cfg(feature = "Foundation_NSAttributedString")]
    unsafe impl NSAttributedString {
        #[method_id(@__retain_semantics Other attributedStringByInflectingString)]
        pub unsafe fn attributedStringByInflectingString(&self) -> Id<NSAttributedString>;
    }
);

extern_static!(NSMorphologyAttributeName: &'static NSAttributedStringKey);

extern_static!(NSInflectionRuleAttributeName: &'static NSAttributedStringKey);

extern_static!(NSInflectionAgreementArgumentAttributeName: &'static NSAttributedStringKey);

extern_static!(NSInflectionAgreementConceptAttributeName: &'static NSAttributedStringKey);

extern_static!(NSInflectionReferentConceptAttributeName: &'static NSAttributedStringKey);

extern_static!(NSInflectionAlternativeAttributeName: &'static NSAttributedStringKey);

extern_static!(NSPresentationIntentAttributeName: &'static NSAttributedStringKey);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum NSPresentationIntentKind {
        NSPresentationIntentKindParagraph = 0,
        NSPresentationIntentKindHeader = 1,
        NSPresentationIntentKindOrderedList = 2,
        NSPresentationIntentKindUnorderedList = 3,
        NSPresentationIntentKindListItem = 4,
        NSPresentationIntentKindCodeBlock = 5,
        NSPresentationIntentKindBlockQuote = 6,
        NSPresentationIntentKindThematicBreak = 7,
        NSPresentationIntentKindTable = 8,
        NSPresentationIntentKindTableHeaderRow = 9,
        NSPresentationIntentKindTableRow = 10,
        NSPresentationIntentKindTableCell = 11,
    }
);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum NSPresentationIntentTableColumnAlignment {
        NSPresentationIntentTableColumnAlignmentLeft = 0,
        NSPresentationIntentTableColumnAlignmentCenter = 1,
        NSPresentationIntentTableColumnAlignmentRight = 2,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSPresentationIntent")]
    pub struct NSPresentationIntent;

    #[cfg(feature = "Foundation_NSPresentationIntent")]
    unsafe impl ClassType for NSPresentationIntent {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Foundation_NSPresentationIntent")]
unsafe impl NSCoding for NSPresentationIntent {}

#[cfg(feature = "Foundation_NSPresentationIntent")]
unsafe impl NSCopying for NSPresentationIntent {}

#[cfg(feature = "Foundation_NSPresentationIntent")]
unsafe impl NSObjectProtocol for NSPresentationIntent {}

#[cfg(feature = "Foundation_NSPresentationIntent")]
unsafe impl NSSecureCoding for NSPresentationIntent {}

extern_methods!(
    #[cfg(feature = "Foundation_NSPresentationIntent")]
    unsafe impl NSPresentationIntent {
        #[method(intentKind)]
        pub unsafe fn intentKind(&self) -> NSPresentationIntentKind;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics Other parentIntent)]
        pub unsafe fn parentIntent(&self) -> Option<Id<NSPresentationIntent>>;

        #[method_id(@__retain_semantics Other paragraphIntentWithIdentity:nestedInsideIntent:)]
        pub unsafe fn paragraphIntentWithIdentity_nestedInsideIntent(
            identity: NSInteger,
            parent: Option<&NSPresentationIntent>,
        ) -> Id<NSPresentationIntent>;

        #[method_id(@__retain_semantics Other headerIntentWithIdentity:level:nestedInsideIntent:)]
        pub unsafe fn headerIntentWithIdentity_level_nestedInsideIntent(
            identity: NSInteger,
            level: NSInteger,
            parent: Option<&NSPresentationIntent>,
        ) -> Id<NSPresentationIntent>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other codeBlockIntentWithIdentity:languageHint:nestedInsideIntent:)]
        pub unsafe fn codeBlockIntentWithIdentity_languageHint_nestedInsideIntent(
            identity: NSInteger,
            language_hint: Option<&NSString>,
            parent: Option<&NSPresentationIntent>,
        ) -> Id<NSPresentationIntent>;

        #[method_id(@__retain_semantics Other thematicBreakIntentWithIdentity:nestedInsideIntent:)]
        pub unsafe fn thematicBreakIntentWithIdentity_nestedInsideIntent(
            identity: NSInteger,
            parent: Option<&NSPresentationIntent>,
        ) -> Id<NSPresentationIntent>;

        #[method_id(@__retain_semantics Other orderedListIntentWithIdentity:nestedInsideIntent:)]
        pub unsafe fn orderedListIntentWithIdentity_nestedInsideIntent(
            identity: NSInteger,
            parent: Option<&NSPresentationIntent>,
        ) -> Id<NSPresentationIntent>;

        #[method_id(@__retain_semantics Other unorderedListIntentWithIdentity:nestedInsideIntent:)]
        pub unsafe fn unorderedListIntentWithIdentity_nestedInsideIntent(
            identity: NSInteger,
            parent: Option<&NSPresentationIntent>,
        ) -> Id<NSPresentationIntent>;

        #[method_id(@__retain_semantics Other listItemIntentWithIdentity:ordinal:nestedInsideIntent:)]
        pub unsafe fn listItemIntentWithIdentity_ordinal_nestedInsideIntent(
            identity: NSInteger,
            ordinal: NSInteger,
            parent: Option<&NSPresentationIntent>,
        ) -> Id<NSPresentationIntent>;

        #[method_id(@__retain_semantics Other blockQuoteIntentWithIdentity:nestedInsideIntent:)]
        pub unsafe fn blockQuoteIntentWithIdentity_nestedInsideIntent(
            identity: NSInteger,
            parent: Option<&NSPresentationIntent>,
        ) -> Id<NSPresentationIntent>;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSNumber"))]
        #[method_id(@__retain_semantics Other tableIntentWithIdentity:columnCount:alignments:nestedInsideIntent:)]
        pub unsafe fn tableIntentWithIdentity_columnCount_alignments_nestedInsideIntent(
            identity: NSInteger,
            column_count: NSInteger,
            alignments: &NSArray<NSNumber>,
            parent: Option<&NSPresentationIntent>,
        ) -> Id<NSPresentationIntent>;

        #[method_id(@__retain_semantics Other tableHeaderRowIntentWithIdentity:nestedInsideIntent:)]
        pub unsafe fn tableHeaderRowIntentWithIdentity_nestedInsideIntent(
            identity: NSInteger,
            parent: Option<&NSPresentationIntent>,
        ) -> Id<NSPresentationIntent>;

        #[method_id(@__retain_semantics Other tableRowIntentWithIdentity:row:nestedInsideIntent:)]
        pub unsafe fn tableRowIntentWithIdentity_row_nestedInsideIntent(
            identity: NSInteger,
            row: NSInteger,
            parent: Option<&NSPresentationIntent>,
        ) -> Id<NSPresentationIntent>;

        #[method_id(@__retain_semantics Other tableCellIntentWithIdentity:column:nestedInsideIntent:)]
        pub unsafe fn tableCellIntentWithIdentity_column_nestedInsideIntent(
            identity: NSInteger,
            column: NSInteger,
            parent: Option<&NSPresentationIntent>,
        ) -> Id<NSPresentationIntent>;

        #[method(identity)]
        pub unsafe fn identity(&self) -> NSInteger;

        #[method(ordinal)]
        pub unsafe fn ordinal(&self) -> NSInteger;

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSNumber"))]
        #[method_id(@__retain_semantics Other columnAlignments)]
        pub unsafe fn columnAlignments(&self) -> Option<Id<NSArray<NSNumber>>>;

        #[method(columnCount)]
        pub unsafe fn columnCount(&self) -> NSInteger;

        #[method(headerLevel)]
        pub unsafe fn headerLevel(&self) -> NSInteger;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other languageHint)]
        pub unsafe fn languageHint(&self) -> Option<Id<NSString>>;

        #[method(column)]
        pub unsafe fn column(&self) -> NSInteger;

        #[method(row)]
        pub unsafe fn row(&self) -> NSInteger;

        #[method(indentationLevel)]
        pub unsafe fn indentationLevel(&self) -> NSInteger;

        #[method(isEquivalentToPresentationIntent:)]
        pub unsafe fn isEquivalentToPresentationIntent(&self, other: &NSPresentationIntent)
            -> bool;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSPresentationIntent")]
    unsafe impl NSPresentationIntent {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);