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"))]
31unsafe impl CAMediaTiming for CATextLayer {}
32
33#[cfg(feature = "CALayer")]
34unsafe impl NSCoding for CATextLayer {}
35
36#[cfg(feature = "CALayer")]
37unsafe impl NSObjectProtocol for CATextLayer {}
38
39#[cfg(feature = "CALayer")]
40unsafe impl NSSecureCoding for CATextLayer {}
41
42#[cfg(feature = "CALayer")]
43impl CATextLayer {
44 extern_methods!(
45 #[unsafe(method(string))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn string(&self) -> Option<Retained<AnyObject>>;
48
49 #[unsafe(method(setString:))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn setString(&self, string: Option<&AnyObject>);
53
54 #[cfg(feature = "objc2-core-foundation")]
55 #[unsafe(method(font))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn font(&self) -> Option<Retained<CFType>>;
58
59 #[cfg(feature = "objc2-core-foundation")]
60 #[unsafe(method(setFont:))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn setFont(&self, font: Option<&CFType>);
64
65 #[cfg(feature = "objc2-core-foundation")]
66 #[unsafe(method(fontSize))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn fontSize(&self) -> CGFloat;
69
70 #[cfg(feature = "objc2-core-foundation")]
71 #[unsafe(method(setFontSize:))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn setFontSize(&self, font_size: CGFloat);
75
76 #[cfg(feature = "objc2-core-graphics")]
77 #[unsafe(method(foregroundColor))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn foregroundColor(&self) -> Option<Retained<CGColor>>;
80
81 #[cfg(feature = "objc2-core-graphics")]
82 #[unsafe(method(setForegroundColor:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn setForegroundColor(&self, foreground_color: Option<&CGColor>);
86
87 #[unsafe(method(isWrapped))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn isWrapped(&self) -> bool;
90
91 #[unsafe(method(setWrapped:))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn setWrapped(&self, wrapped: bool);
95
96 #[unsafe(method(truncationMode))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn truncationMode(&self) -> Retained<CATextLayerTruncationMode>;
99
100 #[unsafe(method(setTruncationMode:))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn setTruncationMode(&self, truncation_mode: &CATextLayerTruncationMode);
104
105 #[unsafe(method(alignmentMode))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn alignmentMode(&self) -> Retained<CATextLayerAlignmentMode>;
108
109 #[unsafe(method(setAlignmentMode:))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn setAlignmentMode(&self, alignment_mode: &CATextLayerAlignmentMode);
113
114 #[unsafe(method(allowsFontSubpixelQuantization))]
115 #[unsafe(method_family = none)]
116 pub unsafe fn allowsFontSubpixelQuantization(&self) -> bool;
117
118 #[unsafe(method(setAllowsFontSubpixelQuantization:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn setAllowsFontSubpixelQuantization(
122 &self,
123 allows_font_subpixel_quantization: bool,
124 );
125 );
126}
127
128#[cfg(feature = "CALayer")]
130impl CATextLayer {
131 extern_methods!(
132 #[unsafe(method(layer))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn layer() -> Retained<Self>;
136
137 #[unsafe(method(init))]
138 #[unsafe(method_family = init)]
139 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
140
141 #[unsafe(method(initWithLayer:))]
142 #[unsafe(method_family = init)]
143 pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
144 );
145}
146
147#[cfg(feature = "CALayer")]
149impl CATextLayer {
150 extern_methods!(
151 #[unsafe(method(new))]
152 #[unsafe(method_family = new)]
153 pub unsafe fn new() -> Retained<Self>;
154 );
155}
156
157extern "C" {
158 pub static kCATruncationNone: &'static CATextLayerTruncationMode;
160}
161
162extern "C" {
163 pub static kCATruncationStart: &'static CATextLayerTruncationMode;
165}
166
167extern "C" {
168 pub static kCATruncationEnd: &'static CATextLayerTruncationMode;
170}
171
172extern "C" {
173 pub static kCATruncationMiddle: &'static CATextLayerTruncationMode;
175}
176
177extern "C" {
178 pub static kCAAlignmentNatural: &'static CATextLayerAlignmentMode;
180}
181
182extern "C" {
183 pub static kCAAlignmentLeft: &'static CATextLayerAlignmentMode;
185}
186
187extern "C" {
188 pub static kCAAlignmentRight: &'static CATextLayerAlignmentMode;
190}
191
192extern "C" {
193 pub static kCAAlignmentCenter: &'static CATextLayerAlignmentMode;
195}
196
197extern "C" {
198 pub static kCAAlignmentJustified: &'static CATextLayerAlignmentMode;
200}