objc2_tv_ml_kit/generated/
TVColor.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6#[cfg(feature = "objc2-ui-kit")]
7use objc2_ui_kit::*;
8
9use crate::*;
10
11/// [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvcolortype?language=objc)
12// NS_ENUM
13#[deprecated = "Please use SwiftUI or UIKit"]
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct TVColorType(pub NSInteger);
17impl TVColorType {
18    #[doc(alias = "TVColorTypeNone")]
19    #[deprecated = "Please use SwiftUI or UIKit"]
20    pub const None: Self = Self(0);
21    #[doc(alias = "TVColorTypePlain")]
22    #[deprecated = "Please use SwiftUI or UIKit"]
23    pub const Plain: Self = Self(1);
24    #[doc(alias = "TVColorTypeLinearGradientTopToBottom")]
25    #[deprecated = "Please use SwiftUI or UIKit"]
26    pub const LinearGradientTopToBottom: Self = Self(2);
27    #[doc(alias = "TVColorTypeLinearGradientLeftToRight")]
28    #[deprecated = "Please use SwiftUI or UIKit"]
29    pub const LinearGradientLeftToRight: Self = Self(3);
30}
31
32unsafe impl Encode for TVColorType {
33    const ENCODING: Encoding = NSInteger::ENCODING;
34}
35
36unsafe impl RefEncode for TVColorType {
37    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
38}
39
40extern_class!(
41    /// Defines the color data for styles of type TVViewElementStyleTypeColor.
42    ///
43    /// See also [Apple's documentation](https://developer.apple.com/documentation/tvmlkit/tvcolor?language=objc)
44    #[unsafe(super(NSObject))]
45    #[derive(Debug, PartialEq, Eq, Hash)]
46    #[deprecated = "Please use SwiftUI or UIKit"]
47    pub struct TVColor;
48);
49
50extern_conformance!(
51    unsafe impl NSCopying for TVColor {}
52);
53
54unsafe impl CopyingHelper for TVColor {
55    type Result = Self;
56}
57
58extern_conformance!(
59    unsafe impl NSObjectProtocol for TVColor {}
60);
61
62impl TVColor {
63    extern_methods!(
64        #[deprecated = "Please use SwiftUI or UIKit"]
65        #[unsafe(method(colorType))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn colorType(&self) -> TVColorType;
68
69        #[cfg(feature = "objc2-ui-kit")]
70        #[deprecated = "Please use SwiftUI or UIKit"]
71        #[unsafe(method(color))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn color(&self) -> Option<Retained<UIColor>>;
74
75        #[cfg(feature = "objc2-ui-kit")]
76        #[deprecated = "Please use SwiftUI or UIKit"]
77        #[unsafe(method(gradientColors))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn gradientColors(&self) -> Option<Retained<NSArray<UIColor>>>;
80
81        #[deprecated = "Please use SwiftUI or UIKit"]
82        #[unsafe(method(gradientPoints))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn gradientPoints(&self) -> Option<Retained<NSArray<NSNumber>>>;
85    );
86}
87
88/// Methods declared on superclass `NSObject`.
89impl TVColor {
90    extern_methods!(
91        #[unsafe(method(init))]
92        #[unsafe(method_family = init)]
93        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
94
95        #[unsafe(method(new))]
96        #[unsafe(method_family = new)]
97        pub unsafe fn new() -> Retained<Self>;
98    );
99}