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
132#[cfg(feature = "objc2-core-foundation")]
133impl AVCaptionDimension {
134 #[doc(alias = "AVCaptionDimensionMake")]
136 #[cfg(feature = "objc2-core-foundation")]
137 #[inline]
138 pub unsafe fn new(value: CGFloat, units: AVCaptionUnitsType) -> AVCaptionDimension {
139 extern "C-unwind" {
140 fn AVCaptionDimensionMake(
141 value: CGFloat,
142 units: AVCaptionUnitsType,
143 ) -> AVCaptionDimension;
144 }
145 unsafe { AVCaptionDimensionMake(value, units) }
146 }
147}
148
149#[cfg(feature = "objc2-core-foundation")]
150impl AVCaptionPoint {
151 #[doc(alias = "AVCaptionPointMake")]
153 #[cfg(feature = "objc2-core-foundation")]
154 #[inline]
155 pub unsafe fn new(x: AVCaptionDimension, y: AVCaptionDimension) -> AVCaptionPoint {
156 extern "C-unwind" {
157 fn AVCaptionPointMake(x: AVCaptionDimension, y: AVCaptionDimension) -> AVCaptionPoint;
158 }
159 unsafe { AVCaptionPointMake(x, y) }
160 }
161}
162
163#[cfg(feature = "objc2-core-foundation")]
164impl AVCaptionSize {
165 #[doc(alias = "AVCaptionSizeMake")]
167 #[cfg(feature = "objc2-core-foundation")]
168 #[inline]
169 pub unsafe fn new(width: AVCaptionDimension, height: AVCaptionDimension) -> AVCaptionSize {
170 extern "C-unwind" {
171 fn AVCaptionSizeMake(
172 width: AVCaptionDimension,
173 height: AVCaptionDimension,
174 ) -> AVCaptionSize;
175 }
176 unsafe { AVCaptionSizeMake(width, height) }
177 }
178}
179
180#[repr(transparent)]
199#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
200pub struct AVCaptionRegionDisplayAlignment(pub NSInteger);
201impl AVCaptionRegionDisplayAlignment {
202 #[doc(alias = "AVCaptionRegionDisplayAlignmentBefore")]
203 pub const Before: Self = Self(0);
204 #[doc(alias = "AVCaptionRegionDisplayAlignmentCenter")]
205 pub const Center: Self = Self(1);
206 #[doc(alias = "AVCaptionRegionDisplayAlignmentAfter")]
207 pub const After: Self = Self(2);
208}
209
210unsafe impl Encode for AVCaptionRegionDisplayAlignment {
211 const ENCODING: Encoding = NSInteger::ENCODING;
212}
213
214unsafe impl RefEncode for AVCaptionRegionDisplayAlignment {
215 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
216}
217
218#[repr(transparent)]
223#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
224pub struct AVCaptionRegionWritingMode(pub NSInteger);
225impl AVCaptionRegionWritingMode {
226 #[doc(alias = "AVCaptionRegionWritingModeLeftToRightAndTopToBottom")]
227 pub const LeftToRightAndTopToBottom: Self = Self(0);
228 #[doc(alias = "AVCaptionRegionWritingModeTopToBottomAndRightToLeft")]
229 pub const TopToBottomAndRightToLeft: Self = Self(2);
230}
231
232unsafe impl Encode for AVCaptionRegionWritingMode {
233 const ENCODING: Encoding = NSInteger::ENCODING;
234}
235
236unsafe impl RefEncode for AVCaptionRegionWritingMode {
237 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
238}
239
240#[repr(transparent)]
245#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
246pub struct AVCaptionRegionScroll(pub NSInteger);
247impl AVCaptionRegionScroll {
248 #[doc(alias = "AVCaptionRegionScrollNone")]
249 pub const None: Self = Self(0);
250 #[doc(alias = "AVCaptionRegionScrollRollUp")]
251 pub const RollUp: Self = Self(1);
252}
253
254unsafe impl Encode for AVCaptionRegionScroll {
255 const ENCODING: Encoding = NSInteger::ENCODING;
256}
257
258unsafe impl RefEncode for AVCaptionRegionScroll {
259 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
260}
261
262extern_class!(
263 #[unsafe(super(NSObject))]
269 #[derive(Debug, PartialEq, Eq, Hash)]
270 pub struct AVCaptionRegion;
271);
272
273extern_conformance!(
274 unsafe impl NSCoding for AVCaptionRegion {}
275);
276
277extern_conformance!(
278 unsafe impl NSCopying for AVCaptionRegion {}
279);
280
281unsafe impl CopyingHelper for AVCaptionRegion {
282 type Result = Self;
283}
284
285extern_conformance!(
286 unsafe impl NSMutableCopying for AVCaptionRegion {}
287);
288
289unsafe impl MutableCopyingHelper for AVCaptionRegion {
290 type Result = AVMutableCaptionRegion;
291}
292
293extern_conformance!(
294 unsafe impl NSObjectProtocol for AVCaptionRegion {}
295);
296
297extern_conformance!(
298 unsafe impl NSSecureCoding for AVCaptionRegion {}
299);
300
301impl AVCaptionRegion {
302 extern_methods!(
303 #[unsafe(method(appleITTTopRegion))]
307 #[unsafe(method_family = none)]
308 pub unsafe fn appleITTTopRegion() -> Retained<AVCaptionRegion>;
309
310 #[unsafe(method(appleITTBottomRegion))]
314 #[unsafe(method_family = none)]
315 pub unsafe fn appleITTBottomRegion() -> Retained<AVCaptionRegion>;
316
317 #[unsafe(method(appleITTLeftRegion))]
321 #[unsafe(method_family = none)]
322 pub unsafe fn appleITTLeftRegion() -> Retained<AVCaptionRegion>;
323
324 #[unsafe(method(appleITTRightRegion))]
328 #[unsafe(method_family = none)]
329 pub unsafe fn appleITTRightRegion() -> Retained<AVCaptionRegion>;
330
331 #[unsafe(method(subRipTextBottomRegion))]
335 #[unsafe(method_family = none)]
336 pub unsafe fn subRipTextBottomRegion() -> Retained<AVCaptionRegion>;
337
338 #[unsafe(method(identifier))]
347 #[unsafe(method_family = none)]
348 pub unsafe fn identifier(&self) -> Option<Retained<NSString>>;
349
350 #[cfg(feature = "objc2-core-foundation")]
351 #[unsafe(method(origin))]
355 #[unsafe(method_family = none)]
356 pub unsafe fn origin(&self) -> AVCaptionPoint;
357
358 #[cfg(feature = "objc2-core-foundation")]
359 #[unsafe(method(size))]
366 #[unsafe(method_family = none)]
367 pub unsafe fn size(&self) -> AVCaptionSize;
368
369 #[unsafe(method(scroll))]
373 #[unsafe(method_family = none)]
374 pub unsafe fn scroll(&self) -> AVCaptionRegionScroll;
375
376 #[unsafe(method(displayAlignment))]
378 #[unsafe(method_family = none)]
379 pub unsafe fn displayAlignment(&self) -> AVCaptionRegionDisplayAlignment;
380
381 #[unsafe(method(writingMode))]
383 #[unsafe(method_family = none)]
384 pub unsafe fn writingMode(&self) -> AVCaptionRegionWritingMode;
385
386 #[unsafe(method(encodeWithCoder:))]
394 #[unsafe(method_family = none)]
395 pub unsafe fn encodeWithCoder(&self, encoder: &NSCoder);
396
397 #[unsafe(method(isEqual:))]
405 #[unsafe(method_family = none)]
406 pub unsafe fn isEqual(&self, object: &AnyObject) -> bool;
407
408 #[unsafe(method(mutableCopyWithZone:))]
416 #[unsafe(method_family = mutableCopy)]
417 pub unsafe fn mutableCopyWithZone(&self, zone: *mut NSZone) -> Retained<AnyObject>;
418 );
419}
420
421impl AVCaptionRegion {
423 extern_methods!(
424 #[unsafe(method(init))]
425 #[unsafe(method_family = init)]
426 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
427
428 #[unsafe(method(new))]
429 #[unsafe(method_family = new)]
430 pub unsafe fn new() -> Retained<Self>;
431 );
432}
433
434extern_class!(
435 #[unsafe(super(AVCaptionRegion, NSObject))]
439 #[derive(Debug, PartialEq, Eq, Hash)]
440 pub struct AVMutableCaptionRegion;
441);
442
443extern_conformance!(
444 unsafe impl NSCoding for AVMutableCaptionRegion {}
445);
446
447extern_conformance!(
448 unsafe impl NSCopying for AVMutableCaptionRegion {}
449);
450
451unsafe impl CopyingHelper for AVMutableCaptionRegion {
452 type Result = AVCaptionRegion;
453}
454
455extern_conformance!(
456 unsafe impl NSMutableCopying for AVMutableCaptionRegion {}
457);
458
459unsafe impl MutableCopyingHelper for AVMutableCaptionRegion {
460 type Result = Self;
461}
462
463extern_conformance!(
464 unsafe impl NSObjectProtocol for AVMutableCaptionRegion {}
465);
466
467extern_conformance!(
468 unsafe impl NSSecureCoding for AVMutableCaptionRegion {}
469);
470
471impl AVMutableCaptionRegion {
472 extern_methods!(
473 #[unsafe(method(init))]
475 #[unsafe(method_family = init)]
476 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
477
478 #[unsafe(method(initWithIdentifier:))]
480 #[unsafe(method_family = init)]
481 pub unsafe fn initWithIdentifier(
482 this: Allocated<Self>,
483 identifier: &NSString,
484 ) -> Retained<Self>;
485
486 #[cfg(feature = "objc2-core-foundation")]
487 #[unsafe(method(origin))]
489 #[unsafe(method_family = none)]
490 pub unsafe fn origin(&self) -> AVCaptionPoint;
491
492 #[cfg(feature = "objc2-core-foundation")]
493 #[unsafe(method(setOrigin:))]
495 #[unsafe(method_family = none)]
496 pub unsafe fn setOrigin(&self, origin: AVCaptionPoint);
497
498 #[cfg(feature = "objc2-core-foundation")]
499 #[unsafe(method(size))]
501 #[unsafe(method_family = none)]
502 pub unsafe fn size(&self) -> AVCaptionSize;
503
504 #[cfg(feature = "objc2-core-foundation")]
505 #[unsafe(method(setSize:))]
507 #[unsafe(method_family = none)]
508 pub unsafe fn setSize(&self, size: AVCaptionSize);
509
510 #[unsafe(method(scroll))]
512 #[unsafe(method_family = none)]
513 pub unsafe fn scroll(&self) -> AVCaptionRegionScroll;
514
515 #[unsafe(method(setScroll:))]
517 #[unsafe(method_family = none)]
518 pub unsafe fn setScroll(&self, scroll: AVCaptionRegionScroll);
519
520 #[unsafe(method(displayAlignment))]
522 #[unsafe(method_family = none)]
523 pub unsafe fn displayAlignment(&self) -> AVCaptionRegionDisplayAlignment;
524
525 #[unsafe(method(setDisplayAlignment:))]
527 #[unsafe(method_family = none)]
528 pub unsafe fn setDisplayAlignment(
529 &self,
530 display_alignment: AVCaptionRegionDisplayAlignment,
531 );
532
533 #[unsafe(method(writingMode))]
535 #[unsafe(method_family = none)]
536 pub unsafe fn writingMode(&self) -> AVCaptionRegionWritingMode;
537
538 #[unsafe(method(setWritingMode:))]
540 #[unsafe(method_family = none)]
541 pub unsafe fn setWritingMode(&self, writing_mode: AVCaptionRegionWritingMode);
542 );
543}
544
545impl AVMutableCaptionRegion {
547 extern_methods!(
548 #[unsafe(method(new))]
549 #[unsafe(method_family = new)]
550 pub unsafe fn new() -> Retained<Self>;
551 );
552}
553
554#[repr(transparent)]
559#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
560pub struct AVCaptionAnimation(pub NSInteger);
561impl AVCaptionAnimation {
562 #[doc(alias = "AVCaptionAnimationNone")]
563 pub const None: Self = Self(0);
564 #[doc(alias = "AVCaptionAnimationCharacterReveal")]
565 pub const CharacterReveal: Self = Self(1);
566}
567
568unsafe impl Encode for AVCaptionAnimation {
569 const ENCODING: Encoding = NSInteger::ENCODING;
570}
571
572unsafe impl RefEncode for AVCaptionAnimation {
573 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
574}
575
576extern_class!(
577 #[unsafe(super(NSObject))]
583 #[derive(Debug, PartialEq, Eq, Hash)]
584 pub struct AVCaption;
585);
586
587extern_conformance!(
588 unsafe impl NSCoding for AVCaption {}
589);
590
591extern_conformance!(
592 unsafe impl NSCopying for AVCaption {}
593);
594
595unsafe impl CopyingHelper for AVCaption {
596 type Result = Self;
597}
598
599extern_conformance!(
600 unsafe impl NSMutableCopying for AVCaption {}
601);
602
603unsafe impl MutableCopyingHelper for AVCaption {
604 type Result = AVMutableCaption;
605}
606
607extern_conformance!(
608 unsafe impl NSObjectProtocol for AVCaption {}
609);
610
611extern_conformance!(
612 unsafe impl NSSecureCoding for AVCaption {}
613);
614
615impl AVCaption {
616 extern_methods!(
617 #[unsafe(method(init))]
618 #[unsafe(method_family = init)]
619 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
620
621 #[unsafe(method(new))]
622 #[unsafe(method_family = new)]
623 pub unsafe fn new() -> Retained<Self>;
624
625 #[cfg(feature = "objc2-core-media")]
626 #[unsafe(method(initWithText:timeRange:))]
634 #[unsafe(method_family = init)]
635 pub unsafe fn initWithText_timeRange(
636 this: Allocated<Self>,
637 text: &NSString,
638 time_range: CMTimeRange,
639 ) -> Retained<Self>;
640
641 #[unsafe(method(text))]
669 #[unsafe(method_family = none)]
670 pub unsafe fn text(&self) -> Retained<NSString>;
671
672 #[cfg(feature = "objc2-core-media")]
673 #[unsafe(method(timeRange))]
680 #[unsafe(method_family = none)]
681 pub unsafe fn timeRange(&self) -> CMTimeRange;
682 );
683}
684
685extern_class!(
686 #[unsafe(super(AVCaption, NSObject))]
690 #[derive(Debug, PartialEq, Eq, Hash)]
691 pub struct AVMutableCaption;
692);
693
694extern_conformance!(
695 unsafe impl NSCoding for AVMutableCaption {}
696);
697
698extern_conformance!(
699 unsafe impl NSCopying for AVMutableCaption {}
700);
701
702unsafe impl CopyingHelper for AVMutableCaption {
703 type Result = AVCaption;
704}
705
706extern_conformance!(
707 unsafe impl NSMutableCopying for AVMutableCaption {}
708);
709
710unsafe impl MutableCopyingHelper for AVMutableCaption {
711 type Result = Self;
712}
713
714extern_conformance!(
715 unsafe impl NSObjectProtocol for AVMutableCaption {}
716);
717
718extern_conformance!(
719 unsafe impl NSSecureCoding for AVMutableCaption {}
720);
721
722impl AVMutableCaption {
723 extern_methods!(
724 #[unsafe(method(text))]
728 #[unsafe(method_family = none)]
729 pub unsafe fn text(&self) -> Retained<NSString>;
730
731 #[unsafe(method(setText:))]
735 #[unsafe(method_family = none)]
736 pub unsafe fn setText(&self, text: &NSString);
737
738 #[cfg(feature = "objc2-core-media")]
739 #[unsafe(method(timeRange))]
741 #[unsafe(method_family = none)]
742 pub unsafe fn timeRange(&self) -> CMTimeRange;
743
744 #[cfg(feature = "objc2-core-media")]
745 #[unsafe(method(setTimeRange:))]
747 #[unsafe(method_family = none)]
748 pub unsafe fn setTimeRange(&self, time_range: CMTimeRange);
749 );
750}
751
752impl AVMutableCaption {
754 extern_methods!(
755 #[unsafe(method(init))]
756 #[unsafe(method_family = init)]
757 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
758
759 #[unsafe(method(new))]
760 #[unsafe(method_family = new)]
761 pub unsafe fn new() -> Retained<Self>;
762
763 #[cfg(feature = "objc2-core-media")]
764 #[unsafe(method(initWithText:timeRange:))]
772 #[unsafe(method_family = init)]
773 pub unsafe fn initWithText_timeRange(
774 this: Allocated<Self>,
775 text: &NSString,
776 time_range: CMTimeRange,
777 ) -> Retained<Self>;
778 );
779}
780
781#[repr(transparent)]
786#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
787pub struct AVCaptionFontWeight(pub NSInteger);
788impl AVCaptionFontWeight {
789 #[doc(alias = "AVCaptionFontWeightUnknown")]
790 pub const Unknown: Self = Self(0);
791 #[doc(alias = "AVCaptionFontWeightNormal")]
792 pub const Normal: Self = Self(1);
793 #[doc(alias = "AVCaptionFontWeightBold")]
794 pub const Bold: Self = Self(2);
795}
796
797unsafe impl Encode for AVCaptionFontWeight {
798 const ENCODING: Encoding = NSInteger::ENCODING;
799}
800
801unsafe impl RefEncode for AVCaptionFontWeight {
802 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
803}
804
805#[repr(transparent)]
810#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
811pub struct AVCaptionFontStyle(pub NSInteger);
812impl AVCaptionFontStyle {
813 #[doc(alias = "AVCaptionFontStyleUnknown")]
814 pub const Unknown: Self = Self(0);
815 #[doc(alias = "AVCaptionFontStyleNormal")]
816 pub const Normal: Self = Self(1);
817 #[doc(alias = "AVCaptionFontStyleItalic")]
818 pub const Italic: Self = Self(2);
819}
820
821unsafe impl Encode for AVCaptionFontStyle {
822 const ENCODING: Encoding = NSInteger::ENCODING;
823}
824
825unsafe impl RefEncode for AVCaptionFontStyle {
826 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
827}
828
829#[repr(transparent)]
834#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
835pub struct AVCaptionDecoration(pub NSUInteger);
836bitflags::bitflags! {
837 impl AVCaptionDecoration: NSUInteger {
838 #[doc(alias = "AVCaptionDecorationNone")]
839 const None = 0;
840 #[doc(alias = "AVCaptionDecorationUnderline")]
841 const Underline = 1<<0;
842 #[doc(alias = "AVCaptionDecorationLineThrough")]
843 const LineThrough = 1<<1;
844 #[doc(alias = "AVCaptionDecorationOverline")]
845 const Overline = 1<<2;
846 }
847}
848
849unsafe impl Encode for AVCaptionDecoration {
850 const ENCODING: Encoding = NSUInteger::ENCODING;
851}
852
853unsafe impl RefEncode for AVCaptionDecoration {
854 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
855}
856
857#[repr(transparent)]
885#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
886pub struct AVCaptionTextCombine(pub NSInteger);
887impl AVCaptionTextCombine {
888 #[doc(alias = "AVCaptionTextCombineAll")]
889 pub const All: Self = Self(-1);
890 #[doc(alias = "AVCaptionTextCombineNone")]
891 pub const None: Self = Self(0);
892 #[doc(alias = "AVCaptionTextCombineOneDigit")]
893 pub const OneDigit: Self = Self(1);
894 #[doc(alias = "AVCaptionTextCombineTwoDigits")]
895 pub const TwoDigits: Self = Self(2);
896 #[doc(alias = "AVCaptionTextCombineThreeDigits")]
897 pub const ThreeDigits: Self = Self(3);
898 #[doc(alias = "AVCaptionTextCombineFourDigits")]
899 pub const FourDigits: Self = Self(4);
900}
901
902unsafe impl Encode for AVCaptionTextCombine {
903 const ENCODING: Encoding = NSInteger::ENCODING;
904}
905
906unsafe impl RefEncode for AVCaptionTextCombine {
907 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
908}
909
910#[repr(transparent)]
925#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
926pub struct AVCaptionTextAlignment(pub NSInteger);
927impl AVCaptionTextAlignment {
928 #[doc(alias = "AVCaptionTextAlignmentStart")]
929 pub const Start: Self = Self(0);
930 #[doc(alias = "AVCaptionTextAlignmentEnd")]
931 pub const End: Self = Self(1);
932 #[doc(alias = "AVCaptionTextAlignmentCenter")]
933 pub const Center: Self = Self(2);
934 #[doc(alias = "AVCaptionTextAlignmentLeft")]
935 pub const Left: Self = Self(3);
936 #[doc(alias = "AVCaptionTextAlignmentRight")]
937 pub const Right: Self = Self(4);
938}
939
940unsafe impl Encode for AVCaptionTextAlignment {
941 const ENCODING: Encoding = NSInteger::ENCODING;
942}
943
944unsafe impl RefEncode for AVCaptionTextAlignment {
945 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
946}
947
948impl AVCaption {
950 extern_methods!(
951 #[cfg(feature = "objc2-core-graphics")]
952 #[unsafe(method(textColorAtIndex:range:))]
970 #[unsafe(method_family = copy)]
972 pub unsafe fn textColorAtIndex_range(
973 &self,
974 index: NSInteger,
975 out_range: *mut NSRange,
976 ) -> Option<Retained<CGColor>>;
977
978 #[cfg(feature = "objc2-core-graphics")]
979 #[unsafe(method(backgroundColorAtIndex:range:))]
999 #[unsafe(method_family = copy)]
1001 pub unsafe fn backgroundColorAtIndex_range(
1002 &self,
1003 index: NSInteger,
1004 out_range: *mut NSRange,
1005 ) -> Option<Retained<CGColor>>;
1006
1007 #[unsafe(method(fontWeightAtIndex:range:))]
1019 #[unsafe(method_family = none)]
1020 pub unsafe fn fontWeightAtIndex_range(
1021 &self,
1022 index: NSInteger,
1023 out_range: *mut NSRange,
1024 ) -> AVCaptionFontWeight;
1025
1026 #[unsafe(method(fontStyleAtIndex:range:))]
1036 #[unsafe(method_family = none)]
1037 pub unsafe fn fontStyleAtIndex_range(
1038 &self,
1039 index: NSInteger,
1040 out_range: *mut NSRange,
1041 ) -> AVCaptionFontStyle;
1042
1043 #[unsafe(method(decorationAtIndex:range:))]
1053 #[unsafe(method_family = none)]
1054 pub unsafe fn decorationAtIndex_range(
1055 &self,
1056 index: NSInteger,
1057 out_range: *mut NSRange,
1058 ) -> AVCaptionDecoration;
1059
1060 #[unsafe(method(textCombineAtIndex:range:))]
1070 #[unsafe(method_family = none)]
1071 pub unsafe fn textCombineAtIndex_range(
1072 &self,
1073 index: NSInteger,
1074 out_range: *mut NSRange,
1075 ) -> AVCaptionTextCombine;
1076
1077 #[unsafe(method(rubyAtIndex:range:))]
1089 #[unsafe(method_family = none)]
1090 pub unsafe fn rubyAtIndex_range(
1091 &self,
1092 index: NSInteger,
1093 out_range: *mut NSRange,
1094 ) -> Option<Retained<AVCaptionRuby>>;
1095 );
1096}
1097
1098impl AVCaption {
1100 extern_methods!(
1101 #[unsafe(method(region))]
1105 #[unsafe(method_family = none)]
1106 pub unsafe fn region(&self) -> Option<Retained<AVCaptionRegion>>;
1107
1108 #[unsafe(method(textAlignment))]
1112 #[unsafe(method_family = none)]
1113 pub unsafe fn textAlignment(&self) -> AVCaptionTextAlignment;
1114 );
1115}
1116
1117impl AVCaption {
1119 extern_methods!(
1120 #[unsafe(method(animation))]
1121 #[unsafe(method_family = none)]
1122 pub unsafe fn animation(&self) -> AVCaptionAnimation;
1123 );
1124}
1125
1126impl AVMutableCaption {
1128 extern_methods!(
1129 #[cfg(feature = "objc2-core-graphics")]
1130 #[unsafe(method(setTextColor:inRange:))]
1134 #[unsafe(method_family = none)]
1135 pub unsafe fn setTextColor_inRange(&self, color: &CGColor, range: NSRange);
1136
1137 #[cfg(feature = "objc2-core-graphics")]
1138 #[unsafe(method(setBackgroundColor:inRange:))]
1142 #[unsafe(method_family = none)]
1143 pub unsafe fn setBackgroundColor_inRange(&self, color: &CGColor, range: NSRange);
1144
1145 #[unsafe(method(setFontWeight:inRange:))]
1149 #[unsafe(method_family = none)]
1150 pub unsafe fn setFontWeight_inRange(
1151 &self,
1152 font_weight: AVCaptionFontWeight,
1153 range: NSRange,
1154 );
1155
1156 #[unsafe(method(setFontStyle:inRange:))]
1160 #[unsafe(method_family = none)]
1161 pub unsafe fn setFontStyle_inRange(&self, font_style: AVCaptionFontStyle, range: NSRange);
1162
1163 #[unsafe(method(setDecoration:inRange:))]
1167 #[unsafe(method_family = none)]
1168 pub unsafe fn setDecoration_inRange(&self, decoration: AVCaptionDecoration, range: NSRange);
1169
1170 #[unsafe(method(setTextCombine:inRange:))]
1174 #[unsafe(method_family = none)]
1175 pub unsafe fn setTextCombine_inRange(
1176 &self,
1177 text_combine: AVCaptionTextCombine,
1178 range: NSRange,
1179 );
1180
1181 #[unsafe(method(setRuby:inRange:))]
1185 #[unsafe(method_family = none)]
1186 pub unsafe fn setRuby_inRange(&self, ruby: &AVCaptionRuby, range: NSRange);
1187
1188 #[unsafe(method(removeTextColorInRange:))]
1192 #[unsafe(method_family = none)]
1193 pub unsafe fn removeTextColorInRange(&self, range: NSRange);
1194
1195 #[unsafe(method(removeBackgroundColorInRange:))]
1199 #[unsafe(method_family = none)]
1200 pub unsafe fn removeBackgroundColorInRange(&self, range: NSRange);
1201
1202 #[unsafe(method(removeFontWeightInRange:))]
1206 #[unsafe(method_family = none)]
1207 pub unsafe fn removeFontWeightInRange(&self, range: NSRange);
1208
1209 #[unsafe(method(removeFontStyleInRange:))]
1213 #[unsafe(method_family = none)]
1214 pub unsafe fn removeFontStyleInRange(&self, range: NSRange);
1215
1216 #[unsafe(method(removeDecorationInRange:))]
1220 #[unsafe(method_family = none)]
1221 pub unsafe fn removeDecorationInRange(&self, range: NSRange);
1222
1223 #[unsafe(method(removeTextCombineInRange:))]
1227 #[unsafe(method_family = none)]
1228 pub unsafe fn removeTextCombineInRange(&self, range: NSRange);
1229
1230 #[unsafe(method(removeRubyInRange:))]
1234 #[unsafe(method_family = none)]
1235 pub unsafe fn removeRubyInRange(&self, range: NSRange);
1236 );
1237}
1238
1239impl AVMutableCaption {
1241 extern_methods!(
1242 #[unsafe(method(region))]
1247 #[unsafe(method_family = none)]
1248 pub unsafe fn region(&self) -> Retained<AVCaptionRegion>;
1249
1250 #[unsafe(method(setRegion:))]
1254 #[unsafe(method_family = none)]
1255 pub unsafe fn setRegion(&self, region: &AVCaptionRegion);
1256
1257 #[unsafe(method(textAlignment))]
1259 #[unsafe(method_family = none)]
1260 pub unsafe fn textAlignment(&self) -> AVCaptionTextAlignment;
1261
1262 #[unsafe(method(setTextAlignment:))]
1264 #[unsafe(method_family = none)]
1265 pub unsafe fn setTextAlignment(&self, text_alignment: AVCaptionTextAlignment);
1266 );
1267}
1268
1269impl AVMutableCaption {
1271 extern_methods!(
1272 #[unsafe(method(animation))]
1273 #[unsafe(method_family = none)]
1274 pub unsafe fn animation(&self) -> AVCaptionAnimation;
1275
1276 #[unsafe(method(setAnimation:))]
1278 #[unsafe(method_family = none)]
1279 pub unsafe fn setAnimation(&self, animation: AVCaptionAnimation);
1280 );
1281}
1282
1283#[repr(transparent)]
1292#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1293pub struct AVCaptionRubyPosition(pub NSInteger);
1294impl AVCaptionRubyPosition {
1295 #[doc(alias = "AVCaptionRubyPositionBefore")]
1296 pub const Before: Self = Self(0);
1297 #[doc(alias = "AVCaptionRubyPositionAfter")]
1298 pub const After: Self = Self(1);
1299}
1300
1301unsafe impl Encode for AVCaptionRubyPosition {
1302 const ENCODING: Encoding = NSInteger::ENCODING;
1303}
1304
1305unsafe impl RefEncode for AVCaptionRubyPosition {
1306 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1307}
1308
1309#[repr(transparent)]
1338#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
1339pub struct AVCaptionRubyAlignment(pub NSInteger);
1340impl AVCaptionRubyAlignment {
1341 #[doc(alias = "AVCaptionRubyAlignmentStart")]
1342 pub const Start: Self = Self(0);
1343 #[doc(alias = "AVCaptionRubyAlignmentCenter")]
1344 pub const Center: Self = Self(1);
1345 #[doc(alias = "AVCaptionRubyAlignmentDistributeSpaceBetween")]
1346 pub const DistributeSpaceBetween: Self = Self(2);
1347 #[doc(alias = "AVCaptionRubyAlignmentDistributeSpaceAround")]
1348 pub const DistributeSpaceAround: Self = Self(3);
1349}
1350
1351unsafe impl Encode for AVCaptionRubyAlignment {
1352 const ENCODING: Encoding = NSInteger::ENCODING;
1353}
1354
1355unsafe impl RefEncode for AVCaptionRubyAlignment {
1356 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
1357}
1358
1359extern_class!(
1360 #[unsafe(super(NSObject))]
1364 #[derive(Debug, PartialEq, Eq, Hash)]
1365 pub struct AVCaptionRuby;
1366);
1367
1368unsafe impl Send for AVCaptionRuby {}
1369
1370unsafe impl Sync for AVCaptionRuby {}
1371
1372extern_conformance!(
1373 unsafe impl NSCoding for AVCaptionRuby {}
1374);
1375
1376extern_conformance!(
1377 unsafe impl NSCopying for AVCaptionRuby {}
1378);
1379
1380unsafe impl CopyingHelper for AVCaptionRuby {
1381 type Result = Self;
1382}
1383
1384extern_conformance!(
1385 unsafe impl NSObjectProtocol for AVCaptionRuby {}
1386);
1387
1388extern_conformance!(
1389 unsafe impl NSSecureCoding for AVCaptionRuby {}
1390);
1391
1392impl AVCaptionRuby {
1393 extern_methods!(
1394 #[unsafe(method(init))]
1395 #[unsafe(method_family = init)]
1396 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1397
1398 #[unsafe(method(new))]
1399 #[unsafe(method_family = new)]
1400 pub unsafe fn new() -> Retained<Self>;
1401
1402 #[unsafe(method(initWithText:))]
1403 #[unsafe(method_family = init)]
1404 pub unsafe fn initWithText(this: Allocated<Self>, text: &NSString) -> Retained<Self>;
1405
1406 #[unsafe(method(initWithText:position:alignment:))]
1407 #[unsafe(method_family = init)]
1408 pub unsafe fn initWithText_position_alignment(
1409 this: Allocated<Self>,
1410 text: &NSString,
1411 position: AVCaptionRubyPosition,
1412 alignment: AVCaptionRubyAlignment,
1413 ) -> Retained<Self>;
1414
1415 #[unsafe(method(text))]
1423 #[unsafe(method_family = none)]
1424 pub unsafe fn text(&self) -> Retained<NSString>;
1425
1426 #[unsafe(method(position))]
1434 #[unsafe(method_family = none)]
1435 pub unsafe fn position(&self) -> AVCaptionRubyPosition;
1436
1437 #[unsafe(method(alignment))]
1445 #[unsafe(method_family = none)]
1446 pub unsafe fn alignment(&self) -> AVCaptionRubyAlignment;
1447 );
1448}
1449
1450extern "C-unwind" {
1451 #[cfg(feature = "objc2-core-foundation")]
1452 #[deprecated = "renamed to `AVCaptionDimension::new`"]
1453 pub fn AVCaptionDimensionMake(value: CGFloat, units: AVCaptionUnitsType) -> AVCaptionDimension;
1454}
1455
1456extern "C-unwind" {
1457 #[cfg(feature = "objc2-core-foundation")]
1458 #[deprecated = "renamed to `AVCaptionPoint::new`"]
1459 pub fn AVCaptionPointMake(x: AVCaptionDimension, y: AVCaptionDimension) -> AVCaptionPoint;
1460}
1461
1462extern "C-unwind" {
1463 #[cfg(feature = "objc2-core-foundation")]
1464 #[deprecated = "renamed to `AVCaptionSize::new`"]
1465 pub fn AVCaptionSizeMake(
1466 width: AVCaptionDimension,
1467 height: AVCaptionDimension,
1468 ) -> AVCaptionSize;
1469}