objc2_app_kit/generated/
NSATSTypesetter.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSTypesetter, NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 #[cfg(feature = "NSTypesetter")]
17 pub struct NSATSTypesetter;
18);
19
20#[cfg(feature = "NSTypesetter")]
21extern_conformance!(
22 unsafe impl NSObjectProtocol for NSATSTypesetter {}
23);
24
25#[cfg(feature = "NSTypesetter")]
26impl NSATSTypesetter {
27 extern_methods!(
28 #[unsafe(method(sharedTypesetter))]
29 #[unsafe(method_family = none)]
30 pub fn sharedTypesetter() -> Retained<NSATSTypesetter>;
31 );
32}
33
34#[cfg(feature = "NSTypesetter")]
36impl NSATSTypesetter {
37 extern_methods!(
38 #[unsafe(method(init))]
39 #[unsafe(method_family = init)]
40 pub fn init(this: Allocated<Self>) -> Retained<Self>;
41
42 #[unsafe(method(new))]
43 #[unsafe(method_family = new)]
44 pub fn new() -> Retained<Self>;
45 );
46}
47
48#[cfg(feature = "NSTypesetter")]
49impl DefaultRetained for NSATSTypesetter {
50 #[inline]
51 fn default_retained() -> Retained<Self> {
52 Self::new()
53 }
54}
55
56#[cfg(feature = "NSTypesetter")]
58impl NSATSTypesetter {
59 extern_methods!(
60 #[deprecated]
64 #[unsafe(method(lineFragmentRectForProposedRect:remainingRect:))]
65 #[unsafe(method_family = none)]
66 pub unsafe fn lineFragmentRectForProposedRect_remainingRect(
67 &self,
68 proposed_rect: NSRect,
69 remaining_rect: NSRectPointer,
70 ) -> NSRect;
71 );
72}
73
74#[cfg(feature = "NSTypesetter")]
76impl NSATSTypesetter {
77 extern_methods!(
78 #[unsafe(method(usesFontLeading))]
79 #[unsafe(method_family = none)]
80 pub fn usesFontLeading(&self) -> bool;
81
82 #[unsafe(method(setUsesFontLeading:))]
84 #[unsafe(method_family = none)]
85 pub fn setUsesFontLeading(&self, uses_font_leading: bool);
86
87 #[cfg(feature = "NSLayoutManager")]
88 #[unsafe(method(typesetterBehavior))]
89 #[unsafe(method_family = none)]
90 pub fn typesetterBehavior(&self) -> NSTypesetterBehavior;
91
92 #[cfg(feature = "NSLayoutManager")]
93 #[unsafe(method(setTypesetterBehavior:))]
95 #[unsafe(method_family = none)]
96 pub fn setTypesetterBehavior(&self, typesetter_behavior: NSTypesetterBehavior);
97
98 #[unsafe(method(hyphenationFactor))]
99 #[unsafe(method_family = none)]
100 pub fn hyphenationFactor(&self) -> c_float;
101
102 #[unsafe(method(setHyphenationFactor:))]
104 #[unsafe(method_family = none)]
105 pub fn setHyphenationFactor(&self, hyphenation_factor: c_float);
106
107 #[cfg(feature = "objc2-core-foundation")]
108 #[unsafe(method(lineFragmentPadding))]
109 #[unsafe(method_family = none)]
110 pub fn lineFragmentPadding(&self) -> CGFloat;
111
112 #[cfg(feature = "objc2-core-foundation")]
113 #[unsafe(method(setLineFragmentPadding:))]
115 #[unsafe(method_family = none)]
116 pub fn setLineFragmentPadding(&self, line_fragment_padding: CGFloat);
117
118 #[cfg(feature = "NSFont")]
119 #[unsafe(method(substituteFontForFont:))]
120 #[unsafe(method_family = none)]
121 pub fn substituteFontForFont(&self, original_font: &NSFont) -> Retained<NSFont>;
122
123 #[cfg(all(
124 feature = "NSParagraphStyle",
125 feature = "NSText",
126 feature = "objc2-core-foundation"
127 ))]
128 #[unsafe(method(textTabForGlyphLocation:writingDirection:maxLocation:))]
129 #[unsafe(method_family = none)]
130 pub fn textTabForGlyphLocation_writingDirection_maxLocation(
131 &self,
132 glyph_location: CGFloat,
133 direction: NSWritingDirection,
134 max_location: CGFloat,
135 ) -> Option<Retained<NSTextTab>>;
136
137 #[unsafe(method(bidiProcessingEnabled))]
138 #[unsafe(method_family = none)]
139 pub fn bidiProcessingEnabled(&self) -> bool;
140
141 #[unsafe(method(setBidiProcessingEnabled:))]
143 #[unsafe(method_family = none)]
144 pub fn setBidiProcessingEnabled(&self, bidi_processing_enabled: bool);
145
146 #[unsafe(method(attributedString))]
150 #[unsafe(method_family = none)]
151 pub unsafe fn attributedString(&self) -> Option<Retained<NSAttributedString>>;
152
153 #[unsafe(method(setAttributedString:))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn setAttributedString(&self, attributed_string: Option<&NSAttributedString>);
161
162 #[unsafe(method(setParagraphGlyphRange:separatorGlyphRange:))]
163 #[unsafe(method_family = none)]
164 pub fn setParagraphGlyphRange_separatorGlyphRange(
165 &self,
166 paragraph_range: NSRange,
167 paragraph_separator_range: NSRange,
168 );
169
170 #[unsafe(method(paragraphGlyphRange))]
171 #[unsafe(method_family = none)]
172 pub fn paragraphGlyphRange(&self) -> NSRange;
173
174 #[unsafe(method(paragraphSeparatorGlyphRange))]
175 #[unsafe(method_family = none)]
176 pub fn paragraphSeparatorGlyphRange(&self) -> NSRange;
177
178 #[unsafe(method(layoutParagraphAtPoint:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn layoutParagraphAtPoint(
184 &self,
185 line_fragment_origin: NonNull<NSPoint>,
186 ) -> NSUInteger;
187
188 #[cfg(feature = "objc2-core-foundation")]
189 #[unsafe(method(lineSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:))]
190 #[unsafe(method_family = none)]
191 pub fn lineSpacingAfterGlyphAtIndex_withProposedLineFragmentRect(
192 &self,
193 glyph_index: NSUInteger,
194 rect: NSRect,
195 ) -> CGFloat;
196
197 #[cfg(feature = "objc2-core-foundation")]
198 #[unsafe(method(paragraphSpacingBeforeGlyphAtIndex:withProposedLineFragmentRect:))]
199 #[unsafe(method_family = none)]
200 pub fn paragraphSpacingBeforeGlyphAtIndex_withProposedLineFragmentRect(
201 &self,
202 glyph_index: NSUInteger,
203 rect: NSRect,
204 ) -> CGFloat;
205
206 #[cfg(feature = "objc2-core-foundation")]
207 #[unsafe(method(paragraphSpacingAfterGlyphAtIndex:withProposedLineFragmentRect:))]
208 #[unsafe(method_family = none)]
209 pub fn paragraphSpacingAfterGlyphAtIndex_withProposedLineFragmentRect(
210 &self,
211 glyph_index: NSUInteger,
212 rect: NSRect,
213 ) -> CGFloat;
214
215 #[cfg(feature = "NSLayoutManager")]
216 #[unsafe(method(layoutManager))]
220 #[unsafe(method_family = none)]
221 pub unsafe fn layoutManager(&self) -> Option<Retained<NSLayoutManager>>;
222
223 #[cfg(feature = "NSTextContainer")]
224 #[unsafe(method(currentTextContainer))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn currentTextContainer(&self) -> Option<Retained<NSTextContainer>>;
230
231 #[unsafe(method(setHardInvalidation:forGlyphRange:))]
232 #[unsafe(method_family = none)]
233 pub fn setHardInvalidation_forGlyphRange(&self, flag: bool, glyph_range: NSRange);
234
235 #[unsafe(method(getLineFragmentRect:usedRect:forParagraphSeparatorGlyphRange:atProposedOrigin:))]
240 #[unsafe(method_family = none)]
241 pub unsafe fn getLineFragmentRect_usedRect_forParagraphSeparatorGlyphRange_atProposedOrigin(
242 &self,
243 line_fragment_rect: NonNull<NSRect>,
244 line_fragment_used_rect: NonNull<NSRect>,
245 paragraph_separator_glyph_range: NSRange,
246 line_origin: NSPoint,
247 );
248 );
249}
250
251#[cfg(feature = "NSTypesetter")]
253impl NSATSTypesetter {
254 extern_methods!(
255 #[cfg(feature = "objc2-core-foundation")]
256 #[unsafe(method(willSetLineFragmentRect:forGlyphRange:usedRect:baselineOffset:))]
262 #[unsafe(method_family = none)]
263 pub unsafe fn willSetLineFragmentRect_forGlyphRange_usedRect_baselineOffset(
264 &self,
265 line_rect: NonNull<NSRect>,
266 glyph_range: NSRange,
267 used_rect: NonNull<NSRect>,
268 baseline_offset: NonNull<CGFloat>,
269 );
270
271 #[unsafe(method(shouldBreakLineByWordBeforeCharacterAtIndex:))]
272 #[unsafe(method_family = none)]
273 pub fn shouldBreakLineByWordBeforeCharacterAtIndex(&self, char_index: NSUInteger) -> bool;
274
275 #[unsafe(method(shouldBreakLineByHyphenatingBeforeCharacterAtIndex:))]
276 #[unsafe(method_family = none)]
277 pub fn shouldBreakLineByHyphenatingBeforeCharacterAtIndex(
278 &self,
279 char_index: NSUInteger,
280 ) -> bool;
281
282 #[unsafe(method(hyphenationFactorForGlyphAtIndex:))]
283 #[unsafe(method_family = none)]
284 pub fn hyphenationFactorForGlyphAtIndex(&self, glyph_index: NSUInteger) -> c_float;
285
286 #[unsafe(method(hyphenCharacterForGlyphAtIndex:))]
287 #[unsafe(method_family = none)]
288 pub fn hyphenCharacterForGlyphAtIndex(&self, glyph_index: NSUInteger) -> UTF32Char;
289
290 #[cfg(feature = "NSTextContainer")]
291 #[unsafe(method(boundingBoxForControlGlyphAtIndex:forTextContainer:proposedLineFragment:glyphPosition:characterIndex:))]
292 #[unsafe(method_family = none)]
293 pub fn boundingBoxForControlGlyphAtIndex_forTextContainer_proposedLineFragment_glyphPosition_characterIndex(
294 &self,
295 glyph_index: NSUInteger,
296 text_container: &NSTextContainer,
297 proposed_rect: NSRect,
298 glyph_position: NSPoint,
299 char_index: NSUInteger,
300 ) -> NSRect;
301 );
302}
303
304#[cfg(feature = "NSTypesetter")]
306impl NSATSTypesetter {
307 extern_methods!(
308 #[cfg(all(feature = "NSFont", feature = "NSLayoutManager"))]
309 #[deprecated]
316 #[unsafe(method(getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:))]
317 #[unsafe(method_family = none)]
318 pub unsafe fn getGlyphsInRange_glyphs_characterIndexes_glyphInscriptions_elasticBits(
319 &self,
320 glyphs_range: NSRange,
321 glyph_buffer: *mut NSGlyph,
322 char_index_buffer: *mut NSUInteger,
323 inscribe_buffer: *mut NSGlyphInscription,
324 elastic_buffer: *mut Bool,
325 ) -> NSUInteger;
326 );
327}