objc2_tv_ml_kit/generated/
TVTextElement.rs1use 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#[deprecated = "Please use SwiftUI or UIKit"]
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct TVTextElementStyle(pub NSInteger);
17impl TVTextElementStyle {
18 #[doc(alias = "TVTextElementStyleNone")]
19 #[deprecated = "Please use SwiftUI or UIKit"]
20 pub const None: Self = Self(0);
21 #[doc(alias = "TVTextElementStyleTitle")]
22 #[deprecated = "Please use SwiftUI or UIKit"]
23 pub const Title: Self = Self(1);
24 #[doc(alias = "TVTextElementStyleSubtitle")]
25 #[deprecated = "Please use SwiftUI or UIKit"]
26 pub const Subtitle: Self = Self(2);
27 #[doc(alias = "TVTextElementStyleDescription")]
28 #[deprecated = "Please use SwiftUI or UIKit"]
29 pub const Description: Self = Self(3);
30 #[doc(alias = "TVTextElementStyleDecoration")]
31 #[deprecated = "Please use SwiftUI or UIKit"]
32 pub const Decoration: Self = Self(4);
33}
34
35unsafe impl Encode for TVTextElementStyle {
36 const ENCODING: Encoding = NSInteger::ENCODING;
37}
38
39unsafe impl RefEncode for TVTextElementStyle {
40 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
41}
42
43extern_class!(
44 #[unsafe(super(TVViewElement, NSObject))]
48 #[derive(Debug, PartialEq, Eq, Hash)]
49 #[cfg(feature = "TVViewElement")]
50 #[deprecated = "Please use SwiftUI or UIKit"]
51 pub struct TVTextElement;
52);
53
54#[cfg(feature = "TVViewElement")]
55extern_conformance!(
56 unsafe impl NSCopying for TVTextElement {}
57);
58
59#[cfg(feature = "TVViewElement")]
60unsafe impl CopyingHelper for TVTextElement {
61 type Result = Self;
62}
63
64#[cfg(feature = "TVViewElement")]
65extern_conformance!(
66 unsafe impl NSObjectProtocol for TVTextElement {}
67);
68
69#[cfg(feature = "TVViewElement")]
70impl TVTextElement {
71 extern_methods!(
72 #[deprecated = "Please use SwiftUI or UIKit"]
73 #[unsafe(method(attributedText))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn attributedText(&self) -> Option<Retained<NSAttributedString>>;
76
77 #[deprecated = "Please use SwiftUI or UIKit"]
78 #[unsafe(method(textStyle))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn textStyle(&self) -> TVTextElementStyle;
81
82 #[cfg(feature = "objc2-ui-kit")]
83 #[deprecated = "Please use SwiftUI or UIKit"]
84 #[unsafe(method(attributedStringWithFont:))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn attributedStringWithFont(
87 &self,
88 font: &UIFont,
89 ) -> Retained<NSAttributedString>;
90
91 #[cfg(feature = "objc2-ui-kit")]
92 #[deprecated = "Please use SwiftUI or UIKit"]
93 #[unsafe(method(attributedStringWithFont:foregroundColor:textAlignment:))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn attributedStringWithFont_foregroundColor_textAlignment(
96 &self,
97 font: &UIFont,
98 foreground_color: Option<&UIColor>,
99 alignment: NSTextAlignment,
100 ) -> Retained<NSAttributedString>;
101 );
102}
103
104#[cfg(feature = "TVViewElement")]
106impl TVTextElement {
107 extern_methods!(
108 #[unsafe(method(init))]
109 #[unsafe(method_family = init)]
110 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
111
112 #[unsafe(method(new))]
113 #[unsafe(method_family = new)]
114 pub unsafe fn new() -> Retained<Self>;
115 );
116}