objc2_quartz_core/generated/
CATextLayer.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use 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
14/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catextlayertruncationmode?language=objc)
15// NS_TYPED_ENUM
16pub type CATextLayerTruncationMode = NSString;
17
18/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catextlayeralignmentmode?language=objc)
19// NS_TYPED_ENUM
20pub type CATextLayerAlignmentMode = NSString;
21
22extern_class!(
23    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catextlayer?language=objc)
24    #[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 fn string(&self) -> Option<Retained<AnyObject>>;
56
57        /// Setter for [`string`][Self::string].
58        ///
59        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
60        ///
61        /// # Safety
62        ///
63        /// `string` should be of the correct type.
64        #[unsafe(method(setString:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn setString(&self, string: Option<&AnyObject>);
67
68        #[cfg(feature = "objc2-core-foundation")]
69        #[unsafe(method(font))]
70        #[unsafe(method_family = none)]
71        pub fn font(&self) -> Option<Retained<CFType>>;
72
73        #[cfg(feature = "objc2-core-foundation")]
74        /// Setter for [`font`][Self::font].
75        ///
76        /// # Safety
77        ///
78        /// `font` should be of the correct type.
79        #[unsafe(method(setFont:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn setFont(&self, font: Option<&CFType>);
82
83        #[cfg(feature = "objc2-core-foundation")]
84        #[unsafe(method(fontSize))]
85        #[unsafe(method_family = none)]
86        pub fn fontSize(&self) -> CGFloat;
87
88        #[cfg(feature = "objc2-core-foundation")]
89        /// Setter for [`fontSize`][Self::fontSize].
90        #[unsafe(method(setFontSize:))]
91        #[unsafe(method_family = none)]
92        pub fn setFontSize(&self, font_size: CGFloat);
93
94        #[cfg(feature = "objc2-core-graphics")]
95        #[unsafe(method(foregroundColor))]
96        #[unsafe(method_family = none)]
97        pub fn foregroundColor(&self) -> Option<Retained<CGColor>>;
98
99        #[cfg(feature = "objc2-core-graphics")]
100        /// Setter for [`foregroundColor`][Self::foregroundColor].
101        #[unsafe(method(setForegroundColor:))]
102        #[unsafe(method_family = none)]
103        pub fn setForegroundColor(&self, foreground_color: Option<&CGColor>);
104
105        #[unsafe(method(isWrapped))]
106        #[unsafe(method_family = none)]
107        pub fn isWrapped(&self) -> bool;
108
109        /// Setter for [`isWrapped`][Self::isWrapped].
110        #[unsafe(method(setWrapped:))]
111        #[unsafe(method_family = none)]
112        pub fn setWrapped(&self, wrapped: bool);
113
114        #[unsafe(method(truncationMode))]
115        #[unsafe(method_family = none)]
116        pub fn truncationMode(&self) -> Retained<CATextLayerTruncationMode>;
117
118        /// Setter for [`truncationMode`][Self::truncationMode].
119        ///
120        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
121        #[unsafe(method(setTruncationMode:))]
122        #[unsafe(method_family = none)]
123        pub fn setTruncationMode(&self, truncation_mode: &CATextLayerTruncationMode);
124
125        #[unsafe(method(alignmentMode))]
126        #[unsafe(method_family = none)]
127        pub fn alignmentMode(&self) -> Retained<CATextLayerAlignmentMode>;
128
129        /// Setter for [`alignmentMode`][Self::alignmentMode].
130        ///
131        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
132        #[unsafe(method(setAlignmentMode:))]
133        #[unsafe(method_family = none)]
134        pub fn setAlignmentMode(&self, alignment_mode: &CATextLayerAlignmentMode);
135
136        #[unsafe(method(allowsFontSubpixelQuantization))]
137        #[unsafe(method_family = none)]
138        pub fn allowsFontSubpixelQuantization(&self) -> bool;
139
140        /// Setter for [`allowsFontSubpixelQuantization`][Self::allowsFontSubpixelQuantization].
141        #[unsafe(method(setAllowsFontSubpixelQuantization:))]
142        #[unsafe(method_family = none)]
143        pub fn setAllowsFontSubpixelQuantization(&self, allows_font_subpixel_quantization: bool);
144    );
145}
146
147/// Methods declared on superclass `CALayer`.
148#[cfg(feature = "CALayer")]
149impl CATextLayer {
150    extern_methods!(
151        /// Layer creation and initialization. *
152        #[unsafe(method(layer))]
153        #[unsafe(method_family = none)]
154        pub fn layer() -> Retained<Self>;
155
156        #[unsafe(method(init))]
157        #[unsafe(method_family = init)]
158        pub fn init(this: Allocated<Self>) -> Retained<Self>;
159
160        /// # Safety
161        ///
162        /// `layer` should be of the correct type.
163        #[unsafe(method(initWithLayer:))]
164        #[unsafe(method_family = init)]
165        pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
166    );
167}
168
169/// Methods declared on superclass `NSObject`.
170#[cfg(feature = "CALayer")]
171impl CATextLayer {
172    extern_methods!(
173        #[unsafe(method(new))]
174        #[unsafe(method_family = new)]
175        pub fn new() -> Retained<Self>;
176    );
177}
178
179#[cfg(feature = "CALayer")]
180impl DefaultRetained for CATextLayer {
181    #[inline]
182    fn default_retained() -> Retained<Self> {
183        Self::new()
184    }
185}
186
187extern "C" {
188    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatruncationnone?language=objc)
189    pub static kCATruncationNone: &'static CATextLayerTruncationMode;
190}
191
192extern "C" {
193    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatruncationstart?language=objc)
194    pub static kCATruncationStart: &'static CATextLayerTruncationMode;
195}
196
197extern "C" {
198    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatruncationend?language=objc)
199    pub static kCATruncationEnd: &'static CATextLayerTruncationMode;
200}
201
202extern "C" {
203    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatruncationmiddle?language=objc)
204    pub static kCATruncationMiddle: &'static CATextLayerTruncationMode;
205}
206
207extern "C" {
208    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaalignmentnatural?language=objc)
209    pub static kCAAlignmentNatural: &'static CATextLayerAlignmentMode;
210}
211
212extern "C" {
213    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaalignmentleft?language=objc)
214    pub static kCAAlignmentLeft: &'static CATextLayerAlignmentMode;
215}
216
217extern "C" {
218    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaalignmentright?language=objc)
219    pub static kCAAlignmentRight: &'static CATextLayerAlignmentMode;
220}
221
222extern "C" {
223    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaalignmentcenter?language=objc)
224    pub static kCAAlignmentCenter: &'static CATextLayerAlignmentMode;
225}
226
227extern "C" {
228    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcaalignmentjustified?language=objc)
229    pub static kCAAlignmentJustified: &'static CATextLayerAlignmentMode;
230}