1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9use objc2_core_graphics::*;
10#[cfg(feature = "objc2-core-media")]
11use objc2_core_media::*;
12use objc2_foundation::*;
13
14use crate::*;
15
16#[repr(transparent)]
29#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
30pub struct AVCaptionUnitsType(pub NSInteger);
31impl AVCaptionUnitsType {
32 #[doc(alias = "AVCaptionUnitsTypeUnspecified")]
33 pub const Unspecified: Self = Self(0);
34 #[doc(alias = "AVCaptionUnitsTypeCells")]
35 pub const Cells: Self = Self(1);
36 #[doc(alias = "AVCaptionUnitsTypePercent")]
37 pub const Percent: Self = Self(2);
38}
39
40unsafe impl Encode for AVCaptionUnitsType {
41 const ENCODING: Encoding = NSInteger::ENCODING;
42}
43
44unsafe impl RefEncode for AVCaptionUnitsType {
45 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
46}
47
48#[cfg(feature = "objc2-core-foundation")]
54#[repr(C)]
55#[derive(Clone, Copy, Debug, PartialEq)]
56pub struct AVCaptionDimension {
57 pub value: CGFloat,
58 pub units: AVCaptionUnitsType,
59}
60
61#[cfg(feature = "objc2-core-foundation")]
62unsafe impl Encode for AVCaptionDimension {
63 const ENCODING: Encoding = Encoding::Struct(
64 "AVCaptionDimension",
65 &[<CGFloat>::ENCODING, <AVCaptionUnitsType>::ENCODING],
66 );
67}
68
69#[cfg(feature = "objc2-core-foundation")]
70unsafe impl RefEncode for AVCaptionDimension {
71 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
72}
73
74#[cfg(feature = "objc2-core-foundation")]
80#[repr(C)]
81#[derive(Clone, Copy, Debug, PartialEq)]
82pub struct AVCaptionPoint {
83 pub x: AVCaptionDimension,
84 pub y: AVCaptionDimension,
85}
86
87#[cfg(feature = "objc2-core-foundation")]
88unsafe impl Encode for AVCaptionPoint {
89 const ENCODING: Encoding = Encoding::Struct(
90 "AVCaptionPoint",
91 &[
92 <AVCaptionDimension>::ENCODING,
93 <AVCaptionDimension>::ENCODING,
94 ],
95 );
96}
97
98#[cfg(feature = "objc2-core-foundation")]
99unsafe impl RefEncode for AVCaptionPoint {
100 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
101}
102
103#[cfg(feature = "objc2-core-foundation")]
109#[repr(C)]
110#[derive(Clone, Copy, Debug, PartialEq)]
111pub struct AVCaptionSize {
112 pub width: AVCaptionDimension,
113 pub height: AVCaptionDimension,
114}
115
116#[cfg(feature = "objc2-core-foundation")]
117unsafe impl Encode for AVCaptionSize {
118 const ENCODING: Encoding = Encoding::Struct(
119 "AVCaptionSize",
120 &[
121 <AVCaptionDimension>::ENCODING,
122 <AVCaptionDimension>::ENCODING,
123 ],
124 );
125}
126
127#[cfg(feature = "objc2-core-foundation")]
128unsafe impl RefEncode for AVCaptionSize {
129 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
130}
131
132extern "C-unwind" {
133 #[cfg(feature = "objc2-core-foundation")]
135 pub fn AVCaptionDimensionMake(value: CGFloat, units: AVCaptionUnitsType) -> AVCaptionDimension;
136}
137
138extern "C-unwind" {
139 #[cfg(feature = "objc2-core-foundation")]
141 pub fn AVCaptionPointMake(x: AVCaptionDimension, y: AVCaptionDimension) -> AVCaptionPoint;
142}
143
144extern "C-unwind" {
145 #[cfg(feature = "objc2-core-foundation")]
147 pub fn AVCaptionSizeMake(
148 width: AVCaptionDimension,
149 height: AVCaptionDimension,
150 ) -> AVCaptionSize;
151}
152
153#[repr(transparent)]
172#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
173pub struct AVCaptionRegionDisplayAlignment(pub NSInteger);
174impl AVCaptionRegionDisplayAlignment {
175 #[doc(alias = "AVCaptionRegionDisplayAlignmentBefore")]
176 pub const Before: Self = Self(0);
177 #[doc(alias = "AVCaptionRegionDisplayAlignmentCenter")]
178 pub const Center: Self = Self(1);
179 #[doc(alias = "AVCaptionRegionDisplayAlignmentAfter")]
180 pub const After: Self = Self(2);
181}
182
183unsafe impl Encode for AVCaptionRegionDisplayAlignment {
184 const ENCODING: Encoding = NSInteger::ENCODING;
185}
186
187unsafe impl RefEncode for AVCaptionRegionDisplayAlignment {
188 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
189}
190
191#[repr(transparent)]
196#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
197pub struct AVCaptionRegionWritingMode(pub NSInteger);
198impl AVCaptionRegionWritingMode {
199 #[doc(alias = "AVCaptionRegionWritingModeLeftToRightAndTopToBottom")]
200 pub const LeftToRightAndTopToBottom: Self = Self(0);
201 #[doc(alias = "AVCaptionRegionWritingModeTopToBottomAndRightToLeft")]
202 pub const TopToBottomAndRightToLeft: Self = Self(2);
203}
204
205unsafe impl Encode for AVCaptionRegionWritingMode {
206 const ENCODING: Encoding = NSInteger::ENCODING;
207}
208
209unsafe impl RefEncode for AVCaptionRegionWritingMode {
210 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
211}
212
213#[repr(transparent)]
218#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
219pub struct AVCaptionRegionScroll(pub NSInteger);
220impl AVCaptionRegionScroll {
221 #[doc(alias = "AVCaptionRegionScrollNone")]
222 pub const None: Self = Self(0);
223 #[doc(alias = "AVCaptionRegionScrollRollUp")]
224 pub const RollUp: Self = Self(1);
225}
226
227unsafe impl Encode for AVCaptionRegionScroll {
228 const ENCODING: Encoding = NSInteger::ENCODING;
229}
230
231unsafe impl RefEncode for AVCaptionRegionScroll {
232 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
233}
234
235extern_class!(
236 #[unsafe(super(NSObject))]
242 #[derive(Debug, PartialEq, Eq, Hash)]
243 pub struct AVCaptionRegion;
244);
245
246unsafe impl NSCoding for AVCaptionRegion {}
247
248unsafe impl NSCopying for AVCaptionRegion {}
249
250unsafe impl CopyingHelper for AVCaptionRegion {
251 type Result = Self;
252}
253
254unsafe impl NSMutableCopying for AVCaptionRegion {}
255
256unsafe impl MutableCopyingHelper for AVCaptionRegion {
257 type Result = AVMutableCaptionRegion;
258}
259
260unsafe impl NSObjectProtocol for AVCaptionRegion {}
261
262unsafe impl NSSecureCoding for AVCaptionRegion {}
263
264impl AVCaptionRegion {
265 extern_methods!(
266 #[unsafe(method(appleITTTopRegion))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn appleITTTopRegion() -> Retained<AVCaptionRegion>;
272
273 #[unsafe(method(appleITTBottomRegion))]
277 #[unsafe(method_family = none)]
278 pub unsafe fn appleITTBottomRegion() -> Retained<AVCaptionRegion>;
279
280 #[unsafe(method(appleITTLeftRegion))]
284 #[unsafe(method_family = none)]
285 pub unsafe fn appleITTLeftRegion() -> Retained<AVCaptionRegion>;
286
287 #[unsafe(method(appleITTRightRegion))]
291 #[unsafe(method_family = none)]
292 pub unsafe fn appleITTRightRegion() -> Retained<AVCaptionRegion>;
293
294 #[unsafe(method(subRipTextBottomRegion))]
298 #[unsafe(method_family = none)]
299 pub unsafe fn subRipTextBottomRegion() -> Retained<AVCaptionRegion>;
300
301 #[unsafe(method(identifier))]
310 #[unsafe(method_family = none)]
311 pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;
312
313 #[cfg(feature = "objc2-core-foundation")]
314 #[unsafe(method(origin))]
318 #[unsafe(method_family = none)]
319 pub unsafe fn origin(&self) -> AVCaptionPoint;
320
321 #[cfg(feature = "objc2-core-foundation")]
322 #[unsafe(method(size))]
329 #[unsafe(method_family = none)]
330 pub unsafe fn size(&self) -> AVCaptionSize;
331
332 #[unsafe(method(scroll))]
336 #[unsafe(method_family = none)]
337 pub unsafe fn scroll(&self) -> AVCaptionRegionScroll;
338
339 #[unsafe(method(displayAlignment))]
341 #[unsafe(method_family = none)]
342 pub unsafe fn displayAlignment(&self) -> AVCaptionRegionDisplayAlignment;
343
344 #[unsafe(method(writingMode))]
346 #[unsafe(method_family = none)]
347 pub unsafe fn writingMode(&self) -> AVCaptionRegionWritingMode;
348
349 #[unsafe(method(encodeWithCoder:))]
353 #[unsafe(method_family = none)]
354 pub unsafe fn encodeWithCoder(&self, encoder: &NSCoder);
355
356 #[unsafe(method(isEqual:))]
360 #[unsafe(method_family = none)]
361 pub unsafe fn isEqual(&self, object: &AnyObject) -> bool;
362
363 #[unsafe(method(mutableCopyWithZone:))]
367 #[unsafe(method_family = mutableCopy)]
368 pub unsafe fn mutableCopyWithZone(&self, zone: *mut NSZone) -> Retained<AnyObject>;
369 );
370}
371
372impl AVCaptionRegion {
374 extern_methods!(
375 #[unsafe(method(init))]
376 #[unsafe(method_family = init)]
377 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
378
379 #[unsafe(method(new))]
380 #[unsafe(method_family = new)]
381 pub unsafe fn new() -> Retained<Self>;
382 );
383}
384
385extern_class!(
386 #[unsafe(super(AVCaptionRegion, NSObject))]
390 #[derive(Debug, PartialEq, Eq, Hash)]
391 pub struct AVMutableCaptionRegion;
392);
393
394unsafe impl NSCoding for AVMutableCaptionRegion {}
395
396unsafe impl NSCopying for AVMutableCaptionRegion {}
397
398unsafe impl CopyingHelper for AVMutableCaptionRegion {
399 type Result = AVCaptionRegion;
400}
401
402unsafe impl NSMutableCopying for AVMutableCaptionRegion {}
403
404unsafe impl MutableCopyingHelper for AVMutableCaptionRegion {
405 type Result = Self;
406}
407
408unsafe impl NSObjectProtocol for AVMutableCaptionRegion {}
409
410unsafe impl NSSecureCoding for AVMutableCaptionRegion {}
411
412impl AVMutableCaptionRegion {
413 extern_methods!(
414 #[unsafe(method(init))]
416 #[unsafe(method_family = init)]
417 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
418
419 #[unsafe(method(initWithIdentifier:))]
421 #[unsafe(method_family = init)]
422 pub unsafe fn initWithIdentifier(
423 this: Allocated<Self>,
424 identifier: &NSString,
425 ) -> Retained<Self>;
426
427 #[cfg(feature = "objc2-core-foundation")]
428 #[unsafe(method(origin))]
430 #[unsafe(method_family = none)]
431 pub unsafe fn origin(&self) -> AVCaptionPoint;
432
433 #[cfg(feature = "objc2-core-foundation")]
434 #[unsafe(method(setOrigin:))]
436 #[unsafe(method_family = none)]
437 pub unsafe fn setOrigin(&self, origin: AVCaptionPoint);
438
439 #[cfg(feature = "objc2-core-foundation")]
440 #[unsafe(method(size))]
442 #[unsafe(method_family = none)]
443 pub unsafe fn size(&self) -> AVCaptionSize;
444
445 #[cfg(feature = "objc2-core-foundation")]
446 #[unsafe(method(setSize:))]
448 #[unsafe(method_family = none)]
449 pub unsafe fn setSize(&self, size: AVCaptionSize);
450
451 #[unsafe(method(scroll))]
453 #[unsafe(method_family = none)]
454 pub unsafe fn scroll(&self) -> AVCaptionRegionScroll;
455
456 #[unsafe(method(setScroll:))]
458 #[unsafe(method_family = none)]
459 pub unsafe fn setScroll(&self, scroll: AVCaptionRegionScroll);
460
461 #[unsafe(method(displayAlignment))]
463 #[unsafe(method_family = none)]
464 pub unsafe fn displayAlignment(&self) -> AVCaptionRegionDisplayAlignment;
465
466 #[unsafe(method(setDisplayAlignment:))]
468 #[unsafe(method_family = none)]
469 pub unsafe fn setDisplayAlignment(
470 &self,
471 display_alignment: AVCaptionRegionDisplayAlignment,
472 );
473
474 #[unsafe(method(writingMode))]
476 #[unsafe(method_family = none)]
477 pub unsafe fn writingMode(&self) -> AVCaptionRegionWritingMode;
478
479 #[unsafe(method(setWritingMode:))]
481 #[unsafe(method_family = none)]
482 pub unsafe fn setWritingMode(&self, writing_mode: AVCaptionRegionWritingMode);
483 );
484}
485
486impl AVMutableCaptionRegion {
488 extern_methods!(
489 #[unsafe(method(new))]
490 #[unsafe(method_family = new)]
491 pub unsafe fn new() -> Retained<Self>;
492 );
493}
494
495#[repr(transparent)]
500#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
501pub struct AVCaptionAnimation(pub NSInteger);
502impl AVCaptionAnimation {
503 #[doc(alias = "AVCaptionAnimationNone")]
504 pub const None: Self = Self(0);
505 #[doc(alias = "AVCaptionAnimationCharacterReveal")]
506 pub const CharacterReveal: Self = Self(1);
507}
508
509unsafe impl Encode for AVCaptionAnimation {
510 const ENCODING: Encoding = NSInteger::ENCODING;
511}
512
513unsafe impl RefEncode for AVCaptionAnimation {
514 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
515}
516
517extern_class!(
518 #[unsafe(super(NSObject))]
524 #[derive(Debug, PartialEq, Eq, Hash)]
525 pub struct AVCaption;
526);
527
528unsafe impl NSCoding for AVCaption {}
529
530unsafe impl NSCopying for AVCaption {}
531
532unsafe impl CopyingHelper for AVCaption {
533 type Result = Self;
534}
535
536unsafe impl NSMutableCopying for AVCaption {}
537
538unsafe impl MutableCopyingHelper for AVCaption {
539 type Result = AVMutableCaption;
540}
541
542unsafe impl NSObjectProtocol for AVCaption {}
543
544unsafe impl NSSecureCoding for AVCaption {}
545
546impl AVCaption {
547 extern_methods!(
548 #[unsafe(method(init))]
549 #[unsafe(method_family = init)]
550 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
551
552 #[unsafe(method(new))]
553 #[unsafe(method_family = new)]
554 pub unsafe fn new() -> Retained<Self>;
555
556 #[cfg(feature = "objc2-core-media")]
557 #[unsafe(method(initWithText:timeRange:))]
565 #[unsafe(method_family = init)]
566 pub unsafe fn initWithText_timeRange(
567 this: Allocated<Self>,
568 text: &NSString,
569 time_range: CMTimeRange,
570 ) -> Retained<Self>;
571
572 #[unsafe(method(text))]
600 #[unsafe(method_family = none)]
601 pub unsafe fn text(&self) -> Retained<NSString>;
602
603 #[cfg(feature = "objc2-core-media")]
604 #[unsafe(method(timeRange))]
611 #[unsafe(method_family = none)]
612 pub unsafe fn timeRange(&self) -> CMTimeRange;
613 );
614}
615
616extern_class!(
617 #[unsafe(super(AVCaption, NSObject))]
621 #[derive(Debug, PartialEq, Eq, Hash)]
622 pub struct AVMutableCaption;
623);
624
625unsafe impl NSCoding for AVMutableCaption {}
626
627unsafe impl NSCopying for AVMutableCaption {}
628
629unsafe impl CopyingHelper for AVMutableCaption {
630 type Result = AVCaption;
631}
632
633unsafe impl NSMutableCopying for AVMutableCaption {}
634
635unsafe impl MutableCopyingHelper for AVMutableCaption {
636 type Result = Self;
637}
638
639unsafe impl NSObjectProtocol for AVMutableCaption {}
640
641unsafe impl NSSecureCoding for AVMutableCaption {}
642
643impl AVMutableCaption {
644 extern_methods!(
645 #[unsafe(method(text))]
649 #[unsafe(method_family = none)]
650 pub unsafe fn text(&self) -> Retained<NSString>;
651
652 #[unsafe(method(setText:))]
654 #[unsafe(method_family = none)]
655 pub unsafe fn setText(&self, text: &NSString);
656
657 #[cfg(feature = "objc2-core-media")]
658 #[unsafe(method(timeRange))]
660 #[unsafe(method_family = none)]
661 pub unsafe fn timeRange(&self) -> CMTimeRange;
662
663 #[cfg(feature = "objc2-core-media")]
664 #[unsafe(method(setTimeRange:))]
666 #[unsafe(method_family = none)]
667 pub unsafe fn setTimeRange(&self, time_range: CMTimeRange);
668 );
669}
670
671impl AVMutableCaption {
673 extern_methods!(
674 #[unsafe(method(init))]
675 #[unsafe(method_family = init)]
676 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
677
678 #[unsafe(method(new))]
679 #[unsafe(method_family = new)]
680 pub unsafe fn new() -> Retained<Self>;
681
682 #[cfg(feature = "objc2-core-media")]
683 #[unsafe(method(initWithText:timeRange:))]
691 #[unsafe(method_family = init)]
692 pub unsafe fn initWithText_timeRange(
693 this: Allocated<Self>,
694 text: &NSString,
695 time_range: CMTimeRange,
696 ) -> Retained<Self>;
697 );
698}
699
700#[repr(transparent)]
705#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
706pub struct AVCaptionFontWeight(pub NSInteger);
707impl AVCaptionFontWeight {
708 #[doc(alias = "AVCaptionFontWeightUnknown")]
709 pub const Unknown: Self = Self(0);
710 #[doc(alias = "AVCaptionFontWeightNormal")]
711 pub const Normal: Self = Self(1);
712 #[doc(alias = "AVCaptionFontWeightBold")]
713 pub const Bold: Self = Self(2);
714}
715
716unsafe impl Encode for AVCaptionFontWeight {
717 const ENCODING: Encoding = NSInteger::ENCODING;
718}
719
720unsafe impl RefEncode for AVCaptionFontWeight {
721 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
722}
723
724#[repr(transparent)]
729#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
730pub struct AVCaptionFontStyle(pub NSInteger);
731impl AVCaptionFontStyle {
732 #[doc(alias = "AVCaptionFontStyleUnknown")]
733 pub const Unknown: Self = Self(0);
734 #[doc(alias = "AVCaptionFontStyleNormal")]
735 pub const Normal: Self = Self(1);
736 #[doc(alias = "AVCaptionFontStyleItalic")]
737 pub const Italic: Self = Self(2);
738}
739
740unsafe impl Encode for AVCaptionFontStyle {
741 const ENCODING: Encoding = NSInteger::ENCODING;
742}
743
744unsafe impl RefEncode for AVCaptionFontStyle {
745 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
746}
747
748#[repr(transparent)]
753#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
754pub struct AVCaptionDecoration(pub NSUInteger);
755bitflags::bitflags! {
756 impl AVCaptionDecoration: NSUInteger {
757 #[doc(alias = "AVCaptionDecorationNone")]
758 const None = 0;
759 #[doc(alias = "AVCaptionDecorationUnderline")]
760 const Underline = 1<<0;
761 #[doc(alias = "AVCaptionDecorationLineThrough")]
762 const LineThrough = 1<<1;
763 #[doc(alias = "AVCaptionDecorationOverline")]
764 const Overline = 1<<2;
765 }
766}
767
768unsafe impl Encode for AVCaptionDecoration {
769 const ENCODING: Encoding = NSUInteger::ENCODING;
770}
771
772unsafe impl RefEncode for AVCaptionDecoration {
773 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
774}
775
776#[repr(transparent)]
804#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
805pub struct AVCaptionTextCombine(pub NSInteger);
806impl AVCaptionTextCombine {
807 #[doc(alias = "AVCaptionTextCombineAll")]
808 pub const All: Self = Self(-1);
809 #[doc(alias = "AVCaptionTextCombineNone")]
810 pub const None: Self = Self(0);
811 #[doc(alias = "AVCaptionTextCombineOneDigit")]
812 pub const OneDigit: Self = Self(1);
813 #[doc(alias = "AVCaptionTextCombineTwoDigits")]
814 pub const TwoDigits: Self = Self(2);
815 #[doc(alias = "AVCaptionTextCombineThreeDigits")]
816 pub const ThreeDigits: Self = Self(3);
817 #[doc(alias = "AVCaptionTextCombineFourDigits")]
818 pub const FourDigits: Self = Self(4);
819}
820
821unsafe impl Encode for AVCaptionTextCombine {
822 const ENCODING: Encoding = NSInteger::ENCODING;
823}
824
825unsafe impl RefEncode for AVCaptionTextCombine {
826 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
827}
828
829#[repr(transparent)]
844#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
845pub struct AVCaptionTextAlignment(pub NSInteger);
846impl AVCaptionTextAlignment {
847 #[doc(alias = "AVCaptionTextAlignmentStart")]
848 pub const Start: Self = Self(0);
849 #[doc(alias = "AVCaptionTextAlignmentEnd")]
850 pub const End: Self = Self(1);
851 #[doc(alias = "AVCaptionTextAlignmentCenter")]
852 pub const Center: Self = Self(2);
853 #[doc(alias = "AVCaptionTextAlignmentLeft")]
854 pub const Left: Self = Self(3);
855 #[doc(alias = "AVCaptionTextAlignmentRight")]
856 pub const Right: Self = Self(4);
857}
858
859unsafe impl Encode for AVCaptionTextAlignment {
860 const ENCODING: Encoding = NSInteger::ENCODING;
861}
862
863unsafe impl RefEncode for AVCaptionTextAlignment {
864 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
865}
866
867impl AVCaption {
869 extern_methods!(
870 #[cfg(feature = "objc2-core-graphics")]
871 #[unsafe(method(textColorAtIndex:range:))]
885 #[unsafe(method_family = copy)]
887 pub unsafe fn textColorAtIndex_range(
888 &self,
889 index: NSInteger,
890 out_range: *mut NSRange,
891 ) -> Option<Retained<CGColor>>;
892
893 #[cfg(feature = "objc2-core-graphics")]
894 #[unsafe(method(backgroundColorAtIndex:range:))]
910 #[unsafe(method_family = copy)]
912 pub unsafe fn backgroundColorAtIndex_range(
913 &self,
914 index: NSInteger,
915 out_range: *mut NSRange,
916 ) -> Option<Retained<CGColor>>;
917
918 #[unsafe(method(fontWeightAtIndex:range:))]
926 #[unsafe(method_family = none)]
927 pub unsafe fn fontWeightAtIndex_range(
928 &self,
929 index: NSInteger,
930 out_range: *mut NSRange,
931 ) -> AVCaptionFontWeight;
932
933 #[unsafe(method(fontStyleAtIndex:range:))]
939 #[unsafe(method_family = none)]
940 pub unsafe fn fontStyleAtIndex_range(
941 &self,
942 index: NSInteger,
943 out_range: *mut NSRange,
944 ) -> AVCaptionFontStyle;
945
946 #[unsafe(method(decorationAtIndex:range:))]
952 #[unsafe(method_family = none)]
953 pub unsafe fn decorationAtIndex_range(
954 &self,
955 index: NSInteger,
956 out_range: *mut NSRange,
957 ) -> AVCaptionDecoration;
958
959 #[unsafe(method(textCombineAtIndex:range:))]
965 #[unsafe(method_family = none)]
966 pub unsafe fn textCombineAtIndex_range(
967 &self,
968 index: NSInteger,
969 out_range: *mut NSRange,
970 ) -> AVCaptionTextCombine;
971
972 #[unsafe(method(rubyAtIndex:range:))]
980 #[unsafe(method_family = none)]
981 pub unsafe fn rubyAtIndex_range(
982 &self,
983 index: NSInteger,
984 out_range: *mut NSRange,
985 ) -> Option<Retained<AVCaptionRuby>>;
986 );
987}
988
989impl AVCaption {
991 extern_methods!(
992 #[unsafe(method(region))]
996 #[unsafe(method_family = none)]
997 pub unsafe fn region(&self) -> Option<Retained<AVCaptionRegion>>;
998
999 #[unsafe(method(textAlignment))]
1003 #[unsafe(method_family = none)]
1004 pub unsafe fn textAlignment(&self) -> AVCaptionTextAlignment;
1005 );
1006}
1007
1008impl AVCaption {
1010 extern_methods!(
1011 #[unsafe(method(animation))]
1012 #[unsafe(method_family = none)]
1013 pub unsafe fn animation(&self) -> AVCaptionAnimation;
1014 );
1015}
1016
1017impl AVMutableCaption {
1019 extern_methods!(
1020 #[cfg(feature = "objc2-core-graphics")]
1021 #[unsafe(method(setTextColor:inRange:))]
1025 #[unsafe(method_family = none)]
1026 pub unsafe fn setTextColor_inRange(&self, color: &CGColor, range: NSRange);
1027
1028 #[cfg(feature = "objc2-core-graphics")]
1029 #[unsafe(method(setBackgroundColor:inRange:))]
1033 #[unsafe(method_family = none)]
1034 pub unsafe fn setBackgroundColor_inRange(&self, color: &CGColor, range: NSRange);
1035
1036 #[unsafe(method(setFontWeight:inRange:))]
1040 #[unsafe(method_family = none)]
1041 pub unsafe fn setFontWeight_inRange(
1042 &self,
1043 font_weight: AVCaptionFontWeight,
1044 range: NSRange,
1045 );
1046
1047 #[unsafe(method(setFontStyle:inRange:))]
1051 #[unsafe(method_family = none)]
1052 pub unsafe fn setFontStyle_inRange(&self, font_style: AVCaptionFontStyle, range: NSRange);
1053
1054 #[unsafe(method(setDecoration:inRange:))]
1058 #[unsafe(method_family = none)]
1059 pub unsafe fn setDecoration_inRange(&self, decoration: AVCaptionDecoration, range: NSRange);
1060
1061 #[unsafe(method(setTextCombine:inRange:))]
1065 #[unsafe(method_family = none)]
1066 pub unsafe fn setTextCombine_inRange(
1067 &self,
1068 text_combine: AVCaptionTextCombine,
1069 range: NSRange,
1070 );
1071
1072 #[unsafe(method(setRuby:inRange:))]
1076 #[unsafe(method_family = none)]
1077 pub unsafe fn setRuby_inRange(&self, ruby: &AVCaptionRuby, range: NSRange);
1078
1079 #[unsafe(method(removeTextColorInRange:))]
1083 #[unsafe(method_family = none)]
1084 pub unsafe fn removeTextColorInRange(&self, range: NSRange);
1085
1086 #[unsafe(method(removeBackgroundColorInRange:))]
1090 #[unsafe(method_family = none)]
1091 pub unsafe fn removeBackgroundColorInRange(&self, range: NSRange);
1092
1093 #[unsafe(method(removeFontWeightInRange:))]
1097 #[unsafe(method_family = none)]
1098 pub unsafe fn removeFontWeightInRange(&self, range: NSRange);
1099
1100 #[unsafe(method(removeFontStyleInRange:))]
1104 #[unsafe(method_family = none)]
1105 pub unsafe fn removeFontStyleInRange(&self, range: NSRange);
1106
1107 #[unsafe(method(removeDecorationInRange:))]
1111 #[unsafe(method_family = none)]
1112 pub unsafe fn removeDecorationInRange(&self, range: NSRange);
1113
1114 #[unsafe(method(removeTextCombineInRange:))]
1118 #[unsafe(method_family = none)]
1119 pub unsafe fn removeTextCombineInRange(&self, range: NSRange);
1120
1121 #[unsafe(method(removeRubyInRange:))]
1125 #[unsafe(method_family = none)]
1126 pub unsafe fn removeRubyInRange(&self, range: NSRange);
1127 );
1128}
1129
1130impl AVMutableCaption {
1132 extern_methods!(
1133 #[unsafe(method(region))]
1138 #[unsafe(method_family = none)]
1139 pub unsafe fn region(&self) -> Retained<AVCaptionRegion>;
1140
1141 #[unsafe(method(setRegion:))]
1143 #[unsafe(method_family = none)]
1144 pub unsafe fn setRegion(&self, region: &AVCaptionRegion);
1145
1146 #[unsafe(method(textAlignment))]
1148 #[unsafe(method_family = none)]
1149 pub unsafe fn textAlignment(&self) -> AVCaptionTextAlignment;
1150
1151 #[unsafe(method(setTextAlignment:))]
1153 #[unsafe(method_family = none)]
1154 pub unsafe fn setTextAlignment(&self, text_alignment: AVCaptionTextAlignment);
1155 );
1156}
1157
1158impl AVMutableCaption {
1160 extern_methods!(
1161 #[unsafe(method(animation))]
1162 #[unsafe(method_family = none)]
1163 pub unsafe fn animation(&self) -> AVCaptionAnimation;
1164
1165 #[unsafe(method(setAnimation:))]
1167 #[unsafe(method_family = none)]
1168 pub unsafe fn setAnimation(&self, animation: AVCaptionAnimation);
1169 );
1170}
1171
1172#[repr(transparent)]
1181#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1182pub struct AVCaptionRubyPosition(pub NSInteger);
1183impl AVCaptionRubyPosition {
1184 #[doc(alias = "AVCaptionRubyPositionBefore")]
1185 pub const Before: Self = Self(0);
1186 #[doc(alias = "AVCaptionRubyPositionAfter")]
1187 pub const After: Self = Self(1);
1188}
1189
1190unsafe impl Encode for AVCaptionRubyPosition {
1191 const ENCODING: Encoding = NSInteger::ENCODING;
1192}
1193
1194unsafe impl RefEncode for AVCaptionRubyPosition {
1195 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1196}
1197
1198#[repr(transparent)]
1227#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1228pub struct AVCaptionRubyAlignment(pub NSInteger);
1229impl AVCaptionRubyAlignment {
1230 #[doc(alias = "AVCaptionRubyAlignmentStart")]
1231 pub const Start: Self = Self(0);
1232 #[doc(alias = "AVCaptionRubyAlignmentCenter")]
1233 pub const Center: Self = Self(1);
1234 #[doc(alias = "AVCaptionRubyAlignmentDistributeSpaceBetween")]
1235 pub const DistributeSpaceBetween: Self = Self(2);
1236 #[doc(alias = "AVCaptionRubyAlignmentDistributeSpaceAround")]
1237 pub const DistributeSpaceAround: Self = Self(3);
1238}
1239
1240unsafe impl Encode for AVCaptionRubyAlignment {
1241 const ENCODING: Encoding = NSInteger::ENCODING;
1242}
1243
1244unsafe impl RefEncode for AVCaptionRubyAlignment {
1245 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1246}
1247
1248extern_class!(
1249 #[unsafe(super(NSObject))]
1253 #[derive(Debug, PartialEq, Eq, Hash)]
1254 pub struct AVCaptionRuby;
1255);
1256
1257unsafe impl Send for AVCaptionRuby {}
1258
1259unsafe impl Sync for AVCaptionRuby {}
1260
1261unsafe impl NSCoding for AVCaptionRuby {}
1262
1263unsafe impl NSCopying for AVCaptionRuby {}
1264
1265unsafe impl CopyingHelper for AVCaptionRuby {
1266 type Result = Self;
1267}
1268
1269unsafe impl NSObjectProtocol for AVCaptionRuby {}
1270
1271unsafe impl NSSecureCoding for AVCaptionRuby {}
1272
1273impl AVCaptionRuby {
1274 extern_methods!(
1275 #[unsafe(method(init))]
1276 #[unsafe(method_family = init)]
1277 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1278
1279 #[unsafe(method(new))]
1280 #[unsafe(method_family = new)]
1281 pub unsafe fn new() -> Retained<Self>;
1282
1283 #[unsafe(method(initWithText:))]
1284 #[unsafe(method_family = init)]
1285 pub unsafe fn initWithText(this: Allocated<Self>, text: &NSString) -> Retained<Self>;
1286
1287 #[unsafe(method(initWithText:position:alignment:))]
1288 #[unsafe(method_family = init)]
1289 pub unsafe fn initWithText_position_alignment(
1290 this: Allocated<Self>,
1291 text: &NSString,
1292 position: AVCaptionRubyPosition,
1293 alignment: AVCaptionRubyAlignment,
1294 ) -> Retained<Self>;
1295
1296 #[unsafe(method(text))]
1298 #[unsafe(method_family = none)]
1299 pub unsafe fn text(&self) -> Retained<NSString>;
1300
1301 #[unsafe(method(position))]
1303 #[unsafe(method_family = none)]
1304 pub unsafe fn position(&self) -> AVCaptionRubyPosition;
1305
1306 #[unsafe(method(alignment))]
1308 #[unsafe(method_family = none)]
1309 pub unsafe fn alignment(&self) -> AVCaptionRubyAlignment;
1310 );
1311}