objc2-accessibility 0.3.2

Bindings to the Accessibility framework
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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

extern_protocol!(
    /// Chart or graph container elements may adopt this protocol to enable Audio Graph support.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/accessibility/axchart?language=objc)
    pub unsafe trait AXChart: NSObjectProtocol {
        #[unsafe(method(accessibilityChartDescriptor))]
        #[unsafe(method_family = none)]
        unsafe fn accessibilityChartDescriptor(&self) -> Option<Retained<AXChartDescriptor>>;

        /// Setter for [`accessibilityChartDescriptor`][Self::accessibilityChartDescriptor].
        #[unsafe(method(setAccessibilityChartDescriptor:))]
        #[unsafe(method_family = none)]
        unsafe fn setAccessibilityChartDescriptor(
            &self,
            accessibility_chart_descriptor: Option<&AXChartDescriptor>,
        );
    }
);

extern_protocol!(
    /// Describes a data axis for the chart (e.g. X, Y, etc.)
    /// Each AXChart requires at least two AXDataAxis objects
    /// to describe, at minimum, and X and a Y axis.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/accessibility/axdataaxisdescriptor?language=objc)
    pub unsafe trait AXDataAxisDescriptor: NSCopying {
        /// The name or title of this axis.
        #[unsafe(method(title))]
        #[unsafe(method_family = none)]
        unsafe fn title(&self) -> Retained<NSString>;

        /// Setter for [`title`][Self::title].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTitle:))]
        #[unsafe(method_family = none)]
        unsafe fn setTitle(&self, title: &NSString);

        /// An attributed version of the title of this axis.
        /// When set, this will be used instead of `title`.
        #[unsafe(method(attributedTitle))]
        #[unsafe(method_family = none)]
        unsafe fn attributedTitle(&self) -> Retained<NSAttributedString>;

        /// Setter for [`attributedTitle`][Self::attributedTitle].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAttributedTitle:))]
        #[unsafe(method_family = none)]
        unsafe fn setAttributedTitle(&self, attributed_title: &NSAttributedString);
    }
);

/// [Apple's documentation](https://developer.apple.com/documentation/accessibility/axnumericdataaxisdescriptorscale?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AXNumericDataAxisDescriptorScale(pub NSInteger);
impl AXNumericDataAxisDescriptorScale {
    #[doc(alias = "AXScaleTypeLinear")]
    pub const ScaleTypeLinear: Self = Self(0);
    #[doc(alias = "AXScaleTypeLog10")]
    pub const ScaleTypeLog10: Self = Self(1);
    #[doc(alias = "AXScaleTypeLn")]
    pub const ScaleTypeLn: Self = Self(2);
}

unsafe impl Encode for AXNumericDataAxisDescriptorScale {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for AXNumericDataAxisDescriptorScale {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/accessibility/axnumericdataaxisdescriptor?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AXNumericDataAxisDescriptor;
);

extern_conformance!(
    unsafe impl AXDataAxisDescriptor for AXNumericDataAxisDescriptor {}
);

extern_conformance!(
    unsafe impl NSCopying for AXNumericDataAxisDescriptor {}
);

unsafe impl CopyingHelper for AXNumericDataAxisDescriptor {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AXNumericDataAxisDescriptor {}
);

impl AXNumericDataAxisDescriptor {
    extern_methods!(
        /// The scale to use for this axis. This should match the visual representation in the chart.
        /// If not set explicitly, this will default to `linear`.
        #[unsafe(method(scaleType))]
        #[unsafe(method_family = none)]
        pub unsafe fn scaleType(&self) -> AXNumericDataAxisDescriptorScale;

        /// Setter for [`scaleType`][Self::scaleType].
        #[unsafe(method(setScaleType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setScaleType(&self, scale_type: AXNumericDataAxisDescriptorScale);

        /// The minimum displayable value for the axis.
        #[unsafe(method(lowerBound))]
        #[unsafe(method_family = none)]
        pub unsafe fn lowerBound(&self) -> c_double;

        /// Setter for [`lowerBound`][Self::lowerBound].
        #[unsafe(method(setLowerBound:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLowerBound(&self, lower_bound: c_double);

        /// The maximum displayable value for the axis.
        #[unsafe(method(upperBound))]
        #[unsafe(method_family = none)]
        pub unsafe fn upperBound(&self) -> c_double;

        /// Setter for [`upperBound`][Self::upperBound].
        #[unsafe(method(setUpperBound:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUpperBound(&self, upper_bound: c_double);

        #[cfg(feature = "block2")]
        /// Provides a value description to be spoken for a particular data value on this axis.
        /// Use this to format data values to string representations that include units, dates, times, etc.
        #[unsafe(method(valueDescriptionProvider))]
        #[unsafe(method_family = none)]
        pub unsafe fn valueDescriptionProvider(
            &self,
        ) -> NonNull<block2::DynBlock<dyn Fn(c_double) -> NonNull<NSString>>>;

        #[cfg(feature = "block2")]
        /// Setter for [`valueDescriptionProvider`][Self::valueDescriptionProvider].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        ///
        /// # Safety
        ///
        /// `value_description_provider` block's return must be a valid pointer.
        #[unsafe(method(setValueDescriptionProvider:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setValueDescriptionProvider(
            &self,
            value_description_provider: &block2::DynBlock<dyn Fn(c_double) -> NonNull<NSString>>,
        );

        /// The positions of any gridlines along this axis.
        #[unsafe(method(gridlinePositions))]
        #[unsafe(method_family = none)]
        pub unsafe fn gridlinePositions(&self) -> Retained<NSArray<NSNumber>>;

        /// Setter for [`gridlinePositions`][Self::gridlinePositions].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setGridlinePositions:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setGridlinePositions(&self, gridline_positions: &NSArray<NSNumber>);

        #[cfg(feature = "block2")]
        /// # Safety
        ///
        /// `value_description_provider` block's return must be a valid pointer.
        #[unsafe(method(initWithTitle:lowerBound:upperBound:gridlinePositions:valueDescriptionProvider:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithTitle_lowerBound_upperBound_gridlinePositions_valueDescriptionProvider(
            this: Allocated<Self>,
            title: &NSString,
            lowerbound: c_double,
            upper_bound: c_double,
            gridline_positions: Option<&NSArray<NSNumber>>,
            value_description_provider: &block2::DynBlock<dyn Fn(c_double) -> NonNull<NSString>>,
        ) -> Retained<Self>;

        #[cfg(feature = "block2")]
        /// # Safety
        ///
        /// `value_description_provider` block's return must be a valid pointer.
        #[unsafe(method(initWithAttributedTitle:lowerBound:upperBound:gridlinePositions:valueDescriptionProvider:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithAttributedTitle_lowerBound_upperBound_gridlinePositions_valueDescriptionProvider(
            this: Allocated<Self>,
            attributed_title: &NSAttributedString,
            lowerbound: c_double,
            upper_bound: c_double,
            gridline_positions: Option<&NSArray<NSNumber>>,
            value_description_provider: &block2::DynBlock<dyn Fn(c_double) -> NonNull<NSString>>,
        ) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/accessibility/axcategoricaldataaxisdescriptor?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AXCategoricalDataAxisDescriptor;
);

extern_conformance!(
    unsafe impl AXDataAxisDescriptor for AXCategoricalDataAxisDescriptor {}
);

extern_conformance!(
    unsafe impl NSCopying for AXCategoricalDataAxisDescriptor {}
);

unsafe impl CopyingHelper for AXCategoricalDataAxisDescriptor {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AXCategoricalDataAxisDescriptor {}
);

impl AXCategoricalDataAxisDescriptor {
    extern_methods!(
        /// The order of the category values for this axis.
        /// This list should contain every possible category value for this axis, in the order they are displayed visually in the graph or legend.
        /// For example, if your categorical axis represented 'blood type', and the legend contained 'AB, A, B, O' in that order,
        /// you would provide an array containing "AB", "A", "B" and "O" in the same order.
        #[unsafe(method(categoryOrder))]
        #[unsafe(method_family = none)]
        pub unsafe fn categoryOrder(&self) -> Retained<NSArray<NSString>>;

        /// Setter for [`categoryOrder`][Self::categoryOrder].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setCategoryOrder:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCategoryOrder(&self, category_order: &NSArray<NSString>);

        #[unsafe(method(initWithTitle:categoryOrder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithTitle_categoryOrder(
            this: Allocated<Self>,
            title: &NSString,
            category_order: &NSArray<NSString>,
        ) -> Retained<Self>;

        #[unsafe(method(initWithAttributedTitle:categoryOrder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithAttributedTitle_categoryOrder(
            this: Allocated<Self>,
            attributed_title: &NSAttributedString,
            category_order: &NSArray<NSString>,
        ) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Describes a single data value, either numeric or categorical. Only the `number`
    /// property will be used for data points in a numeric axis, and only the `category`
    /// property will be used for data points in a categorical axis.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/accessibility/axdatapointvalue?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AXDataPointValue;
);

extern_conformance!(
    unsafe impl NSCopying for AXDataPointValue {}
);

unsafe impl CopyingHelper for AXDataPointValue {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AXDataPointValue {}
);

impl AXDataPointValue {
    extern_methods!(
        #[unsafe(method(number))]
        #[unsafe(method_family = none)]
        pub unsafe fn number(&self) -> c_double;

        /// Setter for [`number`][Self::number].
        #[unsafe(method(setNumber:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setNumber(&self, number: c_double);

        #[unsafe(method(category))]
        #[unsafe(method_family = none)]
        pub unsafe fn category(&self) -> Retained<NSString>;

        /// Setter for [`category`][Self::category].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setCategory:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCategory(&self, category: &NSString);

        #[unsafe(method(valueWithNumber:))]
        #[unsafe(method_family = none)]
        pub unsafe fn valueWithNumber(number: c_double) -> Retained<Self>;

        #[unsafe(method(valueWithCategory:))]
        #[unsafe(method_family = none)]
        pub unsafe fn valueWithCategory(category: &NSString) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Provides axis values for a single data point within a series.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/accessibility/axdatapoint?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AXDataPoint;
);

extern_conformance!(
    unsafe impl NSCopying for AXDataPoint {}
);

unsafe impl CopyingHelper for AXDataPoint {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AXDataPoint {}
);

impl AXDataPoint {
    extern_methods!(
        /// The x-axis value for this data point.
        /// Should be a Double for a numeric x-axis or a String for a categorical x-axis.
        #[unsafe(method(xValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn xValue(&self) -> Retained<AXDataPointValue>;

        /// Setter for [`xValue`][Self::xValue].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setXValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setXValue(&self, x_value: &AXDataPointValue);

        /// The y-axis value for this data point.
        #[unsafe(method(yValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn yValue(&self) -> Option<Retained<AXDataPointValue>>;

        /// Setter for [`yValue`][Self::yValue].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setYValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setYValue(&self, y_value: Option<&AXDataPointValue>);

        /// Any additional values for additional axes for this data point.
        /// These should be provided in the same order as their corresponding
        /// `AXDataAxisDescriptor` objects in `AXChartDescriptor.additionalAxes`.
        #[unsafe(method(additionalValues))]
        #[unsafe(method_family = none)]
        pub unsafe fn additionalValues(&self) -> Retained<NSArray<AXDataPointValue>>;

        /// Setter for [`additionalValues`][Self::additionalValues].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAdditionalValues:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAdditionalValues(&self, additional_values: &NSArray<AXDataPointValue>);

        /// A name or label for this data point.
        #[unsafe(method(label))]
        #[unsafe(method_family = none)]
        pub unsafe fn label(&self) -> Option<Retained<NSString>>;

        /// Setter for [`label`][Self::label].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLabel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLabel(&self, label: Option<&NSString>);

        /// An attributed version of the name or label for this data point.
        #[unsafe(method(attributedLabel))]
        #[unsafe(method_family = none)]
        pub unsafe fn attributedLabel(&self) -> Option<Retained<NSAttributedString>>;

        /// Setter for [`attributedLabel`][Self::attributedLabel].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAttributedLabel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttributedLabel(&self, attributed_label: Option<&NSAttributedString>);

        #[unsafe(method(initWithX:y:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithX_y(
            this: Allocated<Self>,
            x_value: &AXDataPointValue,
            y_value: Option<&AXDataPointValue>,
        ) -> Retained<Self>;

        #[unsafe(method(initWithX:y:additionalValues:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithX_y_additionalValues(
            this: Allocated<Self>,
            x_value: &AXDataPointValue,
            y_value: Option<&AXDataPointValue>,
            additional_values: Option<&NSArray<AXDataPointValue>>,
        ) -> Retained<Self>;

        #[unsafe(method(initWithX:y:additionalValues:label:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithX_y_additionalValues_label(
            this: Allocated<Self>,
            x_value: &AXDataPointValue,
            y_value: Option<&AXDataPointValue>,
            additional_values: Option<&NSArray<AXDataPointValue>>,
            label: Option<&NSString>,
        ) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// Provides information about a data series. A chart may have one or many data series.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/accessibility/axdataseriesdescriptor?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AXDataSeriesDescriptor;
);

extern_conformance!(
    unsafe impl NSCopying for AXDataSeriesDescriptor {}
);

unsafe impl CopyingHelper for AXDataSeriesDescriptor {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AXDataSeriesDescriptor {}
);

impl AXDataSeriesDescriptor {
    extern_methods!(
        /// The name or title of this data series.
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub unsafe fn name(&self) -> Option<Retained<NSString>>;

        /// Setter for [`name`][Self::name].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setName(&self, name: Option<&NSString>);

        /// An attributed version of the name of this data series.
        /// When set, this will be used instead of `name`.
        #[unsafe(method(attributedName))]
        #[unsafe(method_family = none)]
        pub unsafe fn attributedName(&self) -> Retained<NSAttributedString>;

        /// Setter for [`attributedName`][Self::attributedName].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAttributedName:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttributedName(&self, attributed_name: &NSAttributedString);

        /// Whether or not this data series should be treated as continuous.
        #[unsafe(method(isContinuous))]
        #[unsafe(method_family = none)]
        pub unsafe fn isContinuous(&self) -> bool;

        /// Setter for [`isContinuous`][Self::isContinuous].
        #[unsafe(method(setIsContinuous:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIsContinuous(&self, is_continuous: bool);

        /// The data points that make up the series.
        #[unsafe(method(dataPoints))]
        #[unsafe(method_family = none)]
        pub unsafe fn dataPoints(&self) -> Retained<NSArray<AXDataPoint>>;

        /// Setter for [`dataPoints`][Self::dataPoints].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setDataPoints:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDataPoints(&self, data_points: &NSArray<AXDataPoint>);

        #[unsafe(method(initWithName:isContinuous:dataPoints:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithName_isContinuous_dataPoints(
            this: Allocated<Self>,
            name: &NSString,
            is_continuous: bool,
            data_points: &NSArray<AXDataPoint>,
        ) -> Retained<Self>;

        #[unsafe(method(initWithAttributedName:isContinuous:dataPoints:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithAttributedName_isContinuous_dataPoints(
            this: Allocated<Self>,
            attributed_name: &NSAttributedString,
            is_continuous: bool,
            data_points: &NSArray<AXDataPoint>,
        ) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// Describes the content direction of the chart (i.e. the direction in which the X axis is rendered).
/// For example, a bar chart might be leftToRight, while a pie chart might be radialClockwise.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/accessibility/axchartdescriptorcontentdirection?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct AXChartDescriptorContentDirection(pub NSInteger);
impl AXChartDescriptorContentDirection {
    #[doc(alias = "AXChartContentDirectionLeftToRight")]
    pub const ContentDirectionLeftToRight: Self = Self(0);
    #[doc(alias = "AXChartContentDirectionRightToLeft")]
    pub const ContentDirectionRightToLeft: Self = Self(1);
    #[doc(alias = "AXChartContentDirectionTopToBottom")]
    pub const ContentDirectionTopToBottom: Self = Self(2);
    #[doc(alias = "AXChartContentDirectionBottomToTop")]
    pub const ContentDirectionBottomToTop: Self = Self(3);
    #[doc(alias = "AXChartContentDirectionRadialClockwise")]
    pub const ContentDirectionRadialClockwise: Self = Self(4);
    #[doc(alias = "AXChartContentDirectionRadialCounterClockwise")]
    pub const ContentDirectionRadialCounterClockwise: Self = Self(5);
}

unsafe impl Encode for AXChartDescriptorContentDirection {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for AXChartDescriptorContentDirection {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// The top-level descriptor object for an accessible chart.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/accessibility/axchartdescriptor?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AXChartDescriptor;
);

extern_conformance!(
    unsafe impl NSCopying for AXChartDescriptor {}
);

unsafe impl CopyingHelper for AXChartDescriptor {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for AXChartDescriptor {}
);

impl AXChartDescriptor {
    extern_methods!(
        /// The title of the chart.
        #[unsafe(method(title))]
        #[unsafe(method_family = none)]
        pub unsafe fn title(&self) -> Option<Retained<NSString>>;

        /// Setter for [`title`][Self::title].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTitle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTitle(&self, title: Option<&NSString>);

        /// An attributed version of the title of the chart.
        /// When set, this will be used instead of `title`.
        #[unsafe(method(attributedTitle))]
        #[unsafe(method_family = none)]
        pub unsafe fn attributedTitle(&self) -> Option<Retained<NSAttributedString>>;

        /// Setter for [`attributedTitle`][Self::attributedTitle].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAttributedTitle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAttributedTitle(&self, attributed_title: Option<&NSAttributedString>);

        /// A natural language summary of the key message or features of the chart.
        /// e.g. "The chart shows that fuel efficiency decreases as vehicle weight increases."
        #[unsafe(method(summary))]
        #[unsafe(method_family = none)]
        pub unsafe fn summary(&self) -> Option<Retained<NSString>>;

        /// Setter for [`summary`][Self::summary].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSummary:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSummary(&self, summary: Option<&NSString>);

        /// The direction of the chart's X axis.
        #[unsafe(method(contentDirection))]
        #[unsafe(method_family = none)]
        pub unsafe fn contentDirection(&self) -> AXChartDescriptorContentDirection;

        /// Setter for [`contentDirection`][Self::contentDirection].
        #[unsafe(method(setContentDirection:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setContentDirection(
            &self,
            content_direction: AXChartDescriptorContentDirection,
        );

        #[cfg(feature = "objc2-core-foundation")]
        /// The bounds of the view area for visually rendering data values if applicable, provided in superview coordinates.
        #[unsafe(method(contentFrame))]
        #[unsafe(method_family = none)]
        pub unsafe fn contentFrame(&self) -> CGRect;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`contentFrame`][Self::contentFrame].
        #[unsafe(method(setContentFrame:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setContentFrame(&self, content_frame: CGRect);

        /// A set of data series descriptors describing each series in the chart.
        #[unsafe(method(series))]
        #[unsafe(method_family = none)]
        pub unsafe fn series(&self) -> Retained<NSArray<AXDataSeriesDescriptor>>;

        /// Setter for [`series`][Self::series].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSeries:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSeries(&self, series: &NSArray<AXDataSeriesDescriptor>);

        /// The axis descriptor for the chart's X axis.
        #[unsafe(method(xAxis))]
        #[unsafe(method_family = none)]
        pub unsafe fn xAxis(&self) -> Retained<ProtocolObject<dyn AXDataAxisDescriptor>>;

        /// Setter for [`xAxis`][Self::xAxis].
        #[unsafe(method(setXAxis:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setXAxis(&self, x_axis: &ProtocolObject<dyn AXDataAxisDescriptor>);

        /// The axis descriptor for the chart's Y axis.
        #[unsafe(method(yAxis))]
        #[unsafe(method_family = none)]
        pub unsafe fn yAxis(&self) -> Option<Retained<AXNumericDataAxisDescriptor>>;

        /// Setter for [`yAxis`][Self::yAxis].
        #[unsafe(method(setYAxis:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setYAxis(&self, y_axis: Option<&AXNumericDataAxisDescriptor>);

        /// Descriptors for additional categorical or numerical axes beyond x and y.
        /// For example, in a visual chart, these values might be represented by the size
        /// or color of data points.
        #[unsafe(method(additionalAxes))]
        #[unsafe(method_family = none)]
        pub unsafe fn additionalAxes(
            &self,
        ) -> Option<Retained<NSArray<ProtocolObject<dyn AXDataAxisDescriptor>>>>;

        /// Setter for [`additionalAxes`][Self::additionalAxes].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setAdditionalAxes:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAdditionalAxes(
            &self,
            additional_axes: Option<&NSArray<ProtocolObject<dyn AXDataAxisDescriptor>>>,
        );

        #[unsafe(method(initWithTitle:summary:xAxisDescriptor:yAxisDescriptor:series:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithTitle_summary_xAxisDescriptor_yAxisDescriptor_series(
            this: Allocated<Self>,
            title: Option<&NSString>,
            summary: Option<&NSString>,
            x_axis: &ProtocolObject<dyn AXDataAxisDescriptor>,
            y_axis: Option<&AXNumericDataAxisDescriptor>,
            series: &NSArray<AXDataSeriesDescriptor>,
        ) -> Retained<Self>;

        #[unsafe(method(initWithAttributedTitle:summary:xAxisDescriptor:yAxisDescriptor:series:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithAttributedTitle_summary_xAxisDescriptor_yAxisDescriptor_series(
            this: Allocated<Self>,
            attributed_title: Option<&NSAttributedString>,
            summary: Option<&NSString>,
            x_axis: &ProtocolObject<dyn AXDataAxisDescriptor>,
            y_axis: &AXNumericDataAxisDescriptor,
            series: &NSArray<AXDataSeriesDescriptor>,
        ) -> Retained<Self>;

        #[unsafe(method(initWithTitle:summary:xAxisDescriptor:yAxisDescriptor:additionalAxes:series:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithTitle_summary_xAxisDescriptor_yAxisDescriptor_additionalAxes_series(
            this: Allocated<Self>,
            title: Option<&NSString>,
            summary: Option<&NSString>,
            x_axis: &ProtocolObject<dyn AXDataAxisDescriptor>,
            y_axis: Option<&AXNumericDataAxisDescriptor>,
            additional_axes: Option<&NSArray<ProtocolObject<dyn AXDataAxisDescriptor>>>,
            series: &NSArray<AXDataSeriesDescriptor>,
        ) -> Retained<Self>;

        #[unsafe(method(initWithAttributedTitle:summary:xAxisDescriptor:yAxisDescriptor:additionalAxes:series:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithAttributedTitle_summary_xAxisDescriptor_yAxisDescriptor_additionalAxes_series(
            this: Allocated<Self>,
            attributed_title: Option<&NSAttributedString>,
            summary: Option<&NSString>,
            x_axis: &ProtocolObject<dyn AXDataAxisDescriptor>,
            y_axis: Option<&AXNumericDataAxisDescriptor>,
            additional_axes: Option<&NSArray<ProtocolObject<dyn AXDataAxisDescriptor>>>,
            series: &NSArray<AXDataSeriesDescriptor>,
        ) -> Retained<Self>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/accessibility/axliveaudiograph?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct AXLiveAudioGraph;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for AXLiveAudioGraph {}
);

impl AXLiveAudioGraph {
    extern_methods!(
        /// Begins a live audio graph session.
        #[unsafe(method(start))]
        #[unsafe(method_family = none)]
        pub unsafe fn start();

        /// Sets the pitch of the audio graph's tone. This should be a normalized value in the range [0.0, 1.0], where 0 represents the minimum displayable y-axis value for your series
        /// and 1 represents the maximum displayable y-axis value for your series.
        #[unsafe(method(updateValue:))]
        #[unsafe(method_family = none)]
        pub unsafe fn updateValue(value: c_double);

        /// Ends the live audio graph session.
        #[unsafe(method(stop))]
        #[unsafe(method_family = none)]
        pub unsafe fn stop();
    );
}

/// Methods declared on superclass `NSObject`.
impl AXLiveAudioGraph {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}