objc2_quartz_core/generated/
CATextLayer.rs1use 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::*;
10use objc2_foundation::*;
11
12use crate::*;
13
14pub type CATextLayerTruncationMode = NSString;
17
18pub type CATextLayerAlignmentMode = NSString;
21
22extern_class!(
23 #[unsafe(super(CALayer, NSObject))]
25 #[derive(Debug, PartialEq, Eq, Hash)]
26 #[cfg(feature = "CALayer")]
27 pub struct CATextLayer;
28);
29
30#[cfg(all(feature = "CALayer", feature = "CAMediaTiming"))]
31extern_conformance!(
32 unsafe impl CAMediaTiming for CATextLayer {}
33);
34
35#[cfg(feature = "CALayer")]
36extern_conformance!(
37 unsafe impl NSCoding for CATextLayer {}
38);
39
40#[cfg(feature = "CALayer")]
41extern_conformance!(
42 unsafe impl NSObjectProtocol for CATextLayer {}
43);
44
45#[cfg(feature = "CALayer")]
46extern_conformance!(
47 unsafe impl NSSecureCoding for CATextLayer {}
48);
49
50#[cfg(feature = "CALayer")]
51impl CATextLayer {
52 extern_methods!(
53 #[unsafe(method(string))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn string(&self) -> Option<Retained<AnyObject>>;
56
57 #[unsafe(method(setString:))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn setString(&self, string: Option<&AnyObject>);
61
62 #[cfg(feature = "objc2-core-foundation")]
63 #[unsafe(method(font))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn font(&self) -> Option<Retained<CFType>>;
66
67 #[cfg(feature = "objc2-core-foundation")]
68 #[unsafe(method(setFont:))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn setFont(&self, font: Option<&CFType>);
72
73 #[cfg(feature = "objc2-core-foundation")]
74 #[unsafe(method(fontSize))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn fontSize(&self) -> CGFloat;
77
78 #[cfg(feature = "objc2-core-foundation")]
79 #[unsafe(method(setFontSize:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn setFontSize(&self, font_size: CGFloat);
83
84 #[cfg(feature = "objc2-core-graphics")]
85 #[unsafe(method(foregroundColor))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn foregroundColor(&self) -> Option<Retained<CGColor>>;
88
89 #[cfg(feature = "objc2-core-graphics")]
90 #[unsafe(method(setForegroundColor:))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn setForegroundColor(&self, foreground_color: Option<&CGColor>);
94
95 #[unsafe(method(isWrapped))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn isWrapped(&self) -> bool;
98
99 #[unsafe(method(setWrapped:))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn setWrapped(&self, wrapped: bool);
103
104 #[unsafe(method(truncationMode))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn truncationMode(&self) -> Retained<CATextLayerTruncationMode>;
107
108 #[unsafe(method(setTruncationMode:))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn setTruncationMode(&self, truncation_mode: &CATextLayerTruncationMode);
112
113 #[unsafe(method(alignmentMode))]
114 #[unsafe(method_family = none)]
115 pub unsafe fn alignmentMode(&self) -> Retained<CATextLayerAlignmentMode>;
116
117 #[unsafe(method(setAlignmentMode:))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn setAlignmentMode(&self, alignment_mode: &CATextLayerAlignmentMode);
121
122 #[unsafe(method(allowsFontSubpixelQuantization))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn allowsFontSubpixelQuantization(&self) -> bool;
125
126 #[unsafe(method(setAllowsFontSubpixelQuantization:))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn setAllowsFontSubpixelQuantization(
130 &self,
131 allows_font_subpixel_quantization: bool,
132 );
133 );
134}
135
136#[cfg(feature = "CALayer")]
138impl CATextLayer {
139 extern_methods!(
140 #[unsafe(method(layer))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn layer() -> Retained<Self>;
144
145 #[unsafe(method(init))]
146 #[unsafe(method_family = init)]
147 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
148
149 #[unsafe(method(initWithLayer:))]
150 #[unsafe(method_family = init)]
151 pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
152 );
153}
154
155#[cfg(feature = "CALayer")]
157impl CATextLayer {
158 extern_methods!(
159 #[unsafe(method(new))]
160 #[unsafe(method_family = new)]
161 pub unsafe fn new() -> Retained<Self>;
162 );
163}
164
165extern "C" {
166 pub static kCATruncationNone: &'static CATextLayerTruncationMode;
168}
169
170extern "C" {
171 pub static kCATruncationStart: &'static CATextLayerTruncationMode;
173}
174
175extern "C" {
176 pub static kCATruncationEnd: &'static CATextLayerTruncationMode;
178}
179
180extern "C" {
181 pub static kCATruncationMiddle: &'static CATextLayerTruncationMode;
183}
184
185extern "C" {
186 pub static kCAAlignmentNatural: &'static CATextLayerAlignmentMode;
188}
189
190extern "C" {
191 pub static kCAAlignmentLeft: &'static CATextLayerAlignmentMode;
193}
194
195extern "C" {
196 pub static kCAAlignmentRight: &'static CATextLayerAlignmentMode;
198}
199
200extern "C" {
201 pub static kCAAlignmentCenter: &'static CATextLayerAlignmentMode;
203}
204
205extern "C" {
206 pub static kCAAlignmentJustified: &'static CATextLayerAlignmentMode;
208}