objc2_app_kit/generated/
NSParagraphStyle.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::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslinebreakmode?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSLineBreakMode(pub NSUInteger);
17impl NSLineBreakMode {
18    #[doc(alias = "NSLineBreakByWordWrapping")]
19    pub const ByWordWrapping: Self = Self(0);
20    #[doc(alias = "NSLineBreakByCharWrapping")]
21    pub const ByCharWrapping: Self = Self(1);
22    #[doc(alias = "NSLineBreakByClipping")]
23    pub const ByClipping: Self = Self(2);
24    #[doc(alias = "NSLineBreakByTruncatingHead")]
25    pub const ByTruncatingHead: Self = Self(3);
26    #[doc(alias = "NSLineBreakByTruncatingTail")]
27    pub const ByTruncatingTail: Self = Self(4);
28    #[doc(alias = "NSLineBreakByTruncatingMiddle")]
29    pub const ByTruncatingMiddle: Self = Self(5);
30}
31
32unsafe impl Encode for NSLineBreakMode {
33    const ENCODING: Encoding = NSUInteger::ENCODING;
34}
35
36unsafe impl RefEncode for NSLineBreakMode {
37    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
38}
39
40/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nslinebreakstrategy?language=objc)
41// NS_OPTIONS
42#[repr(transparent)]
43#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
44pub struct NSLineBreakStrategy(pub NSUInteger);
45bitflags::bitflags! {
46    impl NSLineBreakStrategy: NSUInteger {
47        #[doc(alias = "NSLineBreakStrategyNone")]
48        const None = 0;
49        #[doc(alias = "NSLineBreakStrategyPushOut")]
50        const PushOut = 1<<0;
51        #[doc(alias = "NSLineBreakStrategyHangulWordPriority")]
52        const HangulWordPriority = 1<<1;
53        #[doc(alias = "NSLineBreakStrategyStandard")]
54        const Standard = 0xFFFF;
55    }
56}
57
58unsafe impl Encode for NSLineBreakStrategy {
59    const ENCODING: Encoding = NSUInteger::ENCODING;
60}
61
62unsafe impl RefEncode for NSLineBreakStrategy {
63    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
64}
65
66/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexttaboptionkey?language=objc)
67// NS_TYPED_ENUM
68pub type NSTextTabOptionKey = NSString;
69
70extern "C" {
71    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstabcolumnterminatorsattributename?language=objc)
72    pub static NSTabColumnTerminatorsAttributeName: &'static NSTextTabOptionKey;
73}
74
75extern_class!(
76    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexttab?language=objc)
77    #[unsafe(super(NSObject))]
78    #[derive(Debug, PartialEq, Eq, Hash)]
79    pub struct NSTextTab;
80);
81
82unsafe impl NSCoding for NSTextTab {}
83
84unsafe impl NSCopying for NSTextTab {}
85
86unsafe impl CopyingHelper for NSTextTab {
87    type Result = Self;
88}
89
90unsafe impl NSObjectProtocol for NSTextTab {}
91
92unsafe impl NSSecureCoding for NSTextTab {}
93
94impl NSTextTab {
95    extern_methods!(
96        #[unsafe(method(columnTerminatorsForLocale:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn columnTerminatorsForLocale(
99            a_locale: Option<&NSLocale>,
100        ) -> Retained<NSCharacterSet>;
101
102        #[cfg(feature = "objc2-core-foundation")]
103        #[unsafe(method(location))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn location(&self) -> CGFloat;
106
107        #[unsafe(method(options))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn options(&self) -> Retained<NSDictionary<NSTextTabOptionKey, AnyObject>>;
110    );
111}
112
113/// Methods declared on superclass `NSObject`.
114impl NSTextTab {
115    extern_methods!(
116        #[unsafe(method(init))]
117        #[unsafe(method_family = init)]
118        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
119
120        #[unsafe(method(new))]
121        #[unsafe(method_family = new)]
122        pub unsafe fn new() -> Retained<Self>;
123    );
124}
125
126extern_class!(
127    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsparagraphstyle?language=objc)
128    #[unsafe(super(NSObject))]
129    #[derive(Debug, PartialEq, Eq, Hash)]
130    pub struct NSParagraphStyle;
131);
132
133unsafe impl NSCoding for NSParagraphStyle {}
134
135unsafe impl NSCopying for NSParagraphStyle {}
136
137unsafe impl CopyingHelper for NSParagraphStyle {
138    type Result = Self;
139}
140
141unsafe impl NSMutableCopying for NSParagraphStyle {}
142
143unsafe impl MutableCopyingHelper for NSParagraphStyle {
144    type Result = NSMutableParagraphStyle;
145}
146
147unsafe impl NSObjectProtocol for NSParagraphStyle {}
148
149unsafe impl NSSecureCoding for NSParagraphStyle {}
150
151impl NSParagraphStyle {
152    extern_methods!(
153        #[unsafe(method(defaultParagraphStyle))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn defaultParagraphStyle() -> Retained<NSParagraphStyle>;
156
157        #[cfg(feature = "NSText")]
158        #[unsafe(method(defaultWritingDirectionForLanguage:))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn defaultWritingDirectionForLanguage(
161            language_name: Option<&NSString>,
162        ) -> NSWritingDirection;
163
164        #[cfg(feature = "objc2-core-foundation")]
165        #[unsafe(method(lineSpacing))]
166        #[unsafe(method_family = none)]
167        pub unsafe fn lineSpacing(&self) -> CGFloat;
168
169        #[cfg(feature = "objc2-core-foundation")]
170        #[unsafe(method(paragraphSpacing))]
171        #[unsafe(method_family = none)]
172        pub unsafe fn paragraphSpacing(&self) -> CGFloat;
173
174        #[cfg(feature = "objc2-core-foundation")]
175        #[unsafe(method(headIndent))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn headIndent(&self) -> CGFloat;
178
179        #[cfg(feature = "objc2-core-foundation")]
180        #[unsafe(method(tailIndent))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn tailIndent(&self) -> CGFloat;
183
184        #[cfg(feature = "objc2-core-foundation")]
185        #[unsafe(method(firstLineHeadIndent))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn firstLineHeadIndent(&self) -> CGFloat;
188
189        #[cfg(feature = "objc2-core-foundation")]
190        #[unsafe(method(minimumLineHeight))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn minimumLineHeight(&self) -> CGFloat;
193
194        #[cfg(feature = "objc2-core-foundation")]
195        #[unsafe(method(maximumLineHeight))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn maximumLineHeight(&self) -> CGFloat;
198
199        #[unsafe(method(lineBreakMode))]
200        #[unsafe(method_family = none)]
201        pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode;
202
203        #[cfg(feature = "NSText")]
204        #[unsafe(method(baseWritingDirection))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn baseWritingDirection(&self) -> NSWritingDirection;
207
208        #[cfg(feature = "objc2-core-foundation")]
209        #[unsafe(method(lineHeightMultiple))]
210        #[unsafe(method_family = none)]
211        pub unsafe fn lineHeightMultiple(&self) -> CGFloat;
212
213        #[cfg(feature = "objc2-core-foundation")]
214        #[unsafe(method(paragraphSpacingBefore))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn paragraphSpacingBefore(&self) -> CGFloat;
217
218        #[unsafe(method(hyphenationFactor))]
219        #[unsafe(method_family = none)]
220        pub unsafe fn hyphenationFactor(&self) -> c_float;
221
222        #[unsafe(method(usesDefaultHyphenation))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn usesDefaultHyphenation(&self) -> bool;
225
226        #[unsafe(method(tabStops))]
227        #[unsafe(method_family = none)]
228        pub unsafe fn tabStops(&self) -> Retained<NSArray<NSTextTab>>;
229
230        #[cfg(feature = "objc2-core-foundation")]
231        #[unsafe(method(defaultTabInterval))]
232        #[unsafe(method_family = none)]
233        pub unsafe fn defaultTabInterval(&self) -> CGFloat;
234
235        #[cfg(feature = "NSTextList")]
236        #[unsafe(method(textLists))]
237        #[unsafe(method_family = none)]
238        pub unsafe fn textLists(&self) -> Retained<NSArray<NSTextList>>;
239
240        #[unsafe(method(allowsDefaultTighteningForTruncation))]
241        #[unsafe(method_family = none)]
242        pub unsafe fn allowsDefaultTighteningForTruncation(&self) -> bool;
243
244        #[unsafe(method(lineBreakStrategy))]
245        #[unsafe(method_family = none)]
246        pub unsafe fn lineBreakStrategy(&self) -> NSLineBreakStrategy;
247    );
248}
249
250/// Methods declared on superclass `NSObject`.
251impl NSParagraphStyle {
252    extern_methods!(
253        #[unsafe(method(init))]
254        #[unsafe(method_family = init)]
255        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
256
257        #[unsafe(method(new))]
258        #[unsafe(method_family = new)]
259        pub unsafe fn new() -> Retained<Self>;
260    );
261}
262
263extern_class!(
264    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmutableparagraphstyle?language=objc)
265    #[unsafe(super(NSParagraphStyle, NSObject))]
266    #[derive(Debug, PartialEq, Eq, Hash)]
267    pub struct NSMutableParagraphStyle;
268);
269
270unsafe impl NSCoding for NSMutableParagraphStyle {}
271
272unsafe impl NSCopying for NSMutableParagraphStyle {}
273
274unsafe impl CopyingHelper for NSMutableParagraphStyle {
275    type Result = NSParagraphStyle;
276}
277
278unsafe impl NSMutableCopying for NSMutableParagraphStyle {}
279
280unsafe impl MutableCopyingHelper for NSMutableParagraphStyle {
281    type Result = Self;
282}
283
284unsafe impl NSObjectProtocol for NSMutableParagraphStyle {}
285
286unsafe impl NSSecureCoding for NSMutableParagraphStyle {}
287
288impl NSMutableParagraphStyle {
289    extern_methods!(
290        #[cfg(feature = "objc2-core-foundation")]
291        #[unsafe(method(lineSpacing))]
292        #[unsafe(method_family = none)]
293        pub unsafe fn lineSpacing(&self) -> CGFloat;
294
295        #[cfg(feature = "objc2-core-foundation")]
296        /// Setter for [`lineSpacing`][Self::lineSpacing].
297        #[unsafe(method(setLineSpacing:))]
298        #[unsafe(method_family = none)]
299        pub unsafe fn setLineSpacing(&self, line_spacing: CGFloat);
300
301        #[cfg(feature = "objc2-core-foundation")]
302        #[unsafe(method(paragraphSpacing))]
303        #[unsafe(method_family = none)]
304        pub unsafe fn paragraphSpacing(&self) -> CGFloat;
305
306        #[cfg(feature = "objc2-core-foundation")]
307        /// Setter for [`paragraphSpacing`][Self::paragraphSpacing].
308        #[unsafe(method(setParagraphSpacing:))]
309        #[unsafe(method_family = none)]
310        pub unsafe fn setParagraphSpacing(&self, paragraph_spacing: CGFloat);
311
312        #[cfg(feature = "objc2-core-foundation")]
313        #[unsafe(method(firstLineHeadIndent))]
314        #[unsafe(method_family = none)]
315        pub unsafe fn firstLineHeadIndent(&self) -> CGFloat;
316
317        #[cfg(feature = "objc2-core-foundation")]
318        /// Setter for [`firstLineHeadIndent`][Self::firstLineHeadIndent].
319        #[unsafe(method(setFirstLineHeadIndent:))]
320        #[unsafe(method_family = none)]
321        pub unsafe fn setFirstLineHeadIndent(&self, first_line_head_indent: CGFloat);
322
323        #[cfg(feature = "objc2-core-foundation")]
324        #[unsafe(method(headIndent))]
325        #[unsafe(method_family = none)]
326        pub unsafe fn headIndent(&self) -> CGFloat;
327
328        #[cfg(feature = "objc2-core-foundation")]
329        /// Setter for [`headIndent`][Self::headIndent].
330        #[unsafe(method(setHeadIndent:))]
331        #[unsafe(method_family = none)]
332        pub unsafe fn setHeadIndent(&self, head_indent: CGFloat);
333
334        #[cfg(feature = "objc2-core-foundation")]
335        #[unsafe(method(tailIndent))]
336        #[unsafe(method_family = none)]
337        pub unsafe fn tailIndent(&self) -> CGFloat;
338
339        #[cfg(feature = "objc2-core-foundation")]
340        /// Setter for [`tailIndent`][Self::tailIndent].
341        #[unsafe(method(setTailIndent:))]
342        #[unsafe(method_family = none)]
343        pub unsafe fn setTailIndent(&self, tail_indent: CGFloat);
344
345        #[unsafe(method(lineBreakMode))]
346        #[unsafe(method_family = none)]
347        pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode;
348
349        /// Setter for [`lineBreakMode`][Self::lineBreakMode].
350        #[unsafe(method(setLineBreakMode:))]
351        #[unsafe(method_family = none)]
352        pub unsafe fn setLineBreakMode(&self, line_break_mode: NSLineBreakMode);
353
354        #[cfg(feature = "objc2-core-foundation")]
355        #[unsafe(method(minimumLineHeight))]
356        #[unsafe(method_family = none)]
357        pub unsafe fn minimumLineHeight(&self) -> CGFloat;
358
359        #[cfg(feature = "objc2-core-foundation")]
360        /// Setter for [`minimumLineHeight`][Self::minimumLineHeight].
361        #[unsafe(method(setMinimumLineHeight:))]
362        #[unsafe(method_family = none)]
363        pub unsafe fn setMinimumLineHeight(&self, minimum_line_height: CGFloat);
364
365        #[cfg(feature = "objc2-core-foundation")]
366        #[unsafe(method(maximumLineHeight))]
367        #[unsafe(method_family = none)]
368        pub unsafe fn maximumLineHeight(&self) -> CGFloat;
369
370        #[cfg(feature = "objc2-core-foundation")]
371        /// Setter for [`maximumLineHeight`][Self::maximumLineHeight].
372        #[unsafe(method(setMaximumLineHeight:))]
373        #[unsafe(method_family = none)]
374        pub unsafe fn setMaximumLineHeight(&self, maximum_line_height: CGFloat);
375
376        #[cfg(feature = "NSText")]
377        #[unsafe(method(baseWritingDirection))]
378        #[unsafe(method_family = none)]
379        pub unsafe fn baseWritingDirection(&self) -> NSWritingDirection;
380
381        #[cfg(feature = "NSText")]
382        /// Setter for [`baseWritingDirection`][Self::baseWritingDirection].
383        #[unsafe(method(setBaseWritingDirection:))]
384        #[unsafe(method_family = none)]
385        pub unsafe fn setBaseWritingDirection(&self, base_writing_direction: NSWritingDirection);
386
387        #[cfg(feature = "objc2-core-foundation")]
388        #[unsafe(method(lineHeightMultiple))]
389        #[unsafe(method_family = none)]
390        pub unsafe fn lineHeightMultiple(&self) -> CGFloat;
391
392        #[cfg(feature = "objc2-core-foundation")]
393        /// Setter for [`lineHeightMultiple`][Self::lineHeightMultiple].
394        #[unsafe(method(setLineHeightMultiple:))]
395        #[unsafe(method_family = none)]
396        pub unsafe fn setLineHeightMultiple(&self, line_height_multiple: CGFloat);
397
398        #[cfg(feature = "objc2-core-foundation")]
399        #[unsafe(method(paragraphSpacingBefore))]
400        #[unsafe(method_family = none)]
401        pub unsafe fn paragraphSpacingBefore(&self) -> CGFloat;
402
403        #[cfg(feature = "objc2-core-foundation")]
404        /// Setter for [`paragraphSpacingBefore`][Self::paragraphSpacingBefore].
405        #[unsafe(method(setParagraphSpacingBefore:))]
406        #[unsafe(method_family = none)]
407        pub unsafe fn setParagraphSpacingBefore(&self, paragraph_spacing_before: CGFloat);
408
409        #[unsafe(method(hyphenationFactor))]
410        #[unsafe(method_family = none)]
411        pub unsafe fn hyphenationFactor(&self) -> c_float;
412
413        /// Setter for [`hyphenationFactor`][Self::hyphenationFactor].
414        #[unsafe(method(setHyphenationFactor:))]
415        #[unsafe(method_family = none)]
416        pub unsafe fn setHyphenationFactor(&self, hyphenation_factor: c_float);
417
418        #[unsafe(method(usesDefaultHyphenation))]
419        #[unsafe(method_family = none)]
420        pub unsafe fn usesDefaultHyphenation(&self) -> bool;
421
422        /// Setter for [`usesDefaultHyphenation`][Self::usesDefaultHyphenation].
423        #[unsafe(method(setUsesDefaultHyphenation:))]
424        #[unsafe(method_family = none)]
425        pub unsafe fn setUsesDefaultHyphenation(&self, uses_default_hyphenation: bool);
426
427        #[unsafe(method(tabStops))]
428        #[unsafe(method_family = none)]
429        pub unsafe fn tabStops(&self) -> Retained<NSArray<NSTextTab>>;
430
431        /// Setter for [`tabStops`][Self::tabStops].
432        #[unsafe(method(setTabStops:))]
433        #[unsafe(method_family = none)]
434        pub unsafe fn setTabStops(&self, tab_stops: Option<&NSArray<NSTextTab>>);
435
436        #[cfg(feature = "objc2-core-foundation")]
437        #[unsafe(method(defaultTabInterval))]
438        #[unsafe(method_family = none)]
439        pub unsafe fn defaultTabInterval(&self) -> CGFloat;
440
441        #[cfg(feature = "objc2-core-foundation")]
442        /// Setter for [`defaultTabInterval`][Self::defaultTabInterval].
443        #[unsafe(method(setDefaultTabInterval:))]
444        #[unsafe(method_family = none)]
445        pub unsafe fn setDefaultTabInterval(&self, default_tab_interval: CGFloat);
446
447        #[unsafe(method(allowsDefaultTighteningForTruncation))]
448        #[unsafe(method_family = none)]
449        pub unsafe fn allowsDefaultTighteningForTruncation(&self) -> bool;
450
451        /// Setter for [`allowsDefaultTighteningForTruncation`][Self::allowsDefaultTighteningForTruncation].
452        #[unsafe(method(setAllowsDefaultTighteningForTruncation:))]
453        #[unsafe(method_family = none)]
454        pub unsafe fn setAllowsDefaultTighteningForTruncation(
455            &self,
456            allows_default_tightening_for_truncation: bool,
457        );
458
459        #[unsafe(method(lineBreakStrategy))]
460        #[unsafe(method_family = none)]
461        pub unsafe fn lineBreakStrategy(&self) -> NSLineBreakStrategy;
462
463        /// Setter for [`lineBreakStrategy`][Self::lineBreakStrategy].
464        #[unsafe(method(setLineBreakStrategy:))]
465        #[unsafe(method_family = none)]
466        pub unsafe fn setLineBreakStrategy(&self, line_break_strategy: NSLineBreakStrategy);
467
468        #[cfg(feature = "NSTextList")]
469        #[unsafe(method(textLists))]
470        #[unsafe(method_family = none)]
471        pub unsafe fn textLists(&self) -> Retained<NSArray<NSTextList>>;
472
473        #[cfg(feature = "NSTextList")]
474        /// Setter for [`textLists`][Self::textLists].
475        #[unsafe(method(setTextLists:))]
476        #[unsafe(method_family = none)]
477        pub unsafe fn setTextLists(&self, text_lists: &NSArray<NSTextList>);
478
479        #[unsafe(method(addTabStop:))]
480        #[unsafe(method_family = none)]
481        pub unsafe fn addTabStop(&self, an_object: &NSTextTab);
482
483        #[unsafe(method(removeTabStop:))]
484        #[unsafe(method_family = none)]
485        pub unsafe fn removeTabStop(&self, an_object: &NSTextTab);
486
487        #[unsafe(method(setParagraphStyle:))]
488        #[unsafe(method_family = none)]
489        pub unsafe fn setParagraphStyle(&self, obj: &NSParagraphStyle);
490    );
491}
492
493/// Methods declared on superclass `NSObject`.
494impl NSMutableParagraphStyle {
495    extern_methods!(
496        #[unsafe(method(init))]
497        #[unsafe(method_family = init)]
498        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
499
500        #[unsafe(method(new))]
501        #[unsafe(method_family = new)]
502        pub unsafe fn new() -> Retained<Self>;
503    );
504}
505
506impl NSTextTab {
507    extern_methods!(
508        #[cfg(all(feature = "NSText", feature = "objc2-core-foundation"))]
509        #[unsafe(method(initWithTextAlignment:location:options:))]
510        #[unsafe(method_family = init)]
511        pub unsafe fn initWithTextAlignment_location_options(
512            this: Allocated<Self>,
513            alignment: NSTextAlignment,
514            loc: CGFloat,
515            options: &NSDictionary<NSTextTabOptionKey, AnyObject>,
516        ) -> Retained<Self>;
517
518        #[cfg(feature = "NSText")]
519        #[unsafe(method(alignment))]
520        #[unsafe(method_family = none)]
521        pub unsafe fn alignment(&self) -> NSTextAlignment;
522    );
523}
524
525impl NSParagraphStyle {
526    extern_methods!(
527        #[cfg(feature = "NSText")]
528        #[unsafe(method(alignment))]
529        #[unsafe(method_family = none)]
530        pub unsafe fn alignment(&self) -> NSTextAlignment;
531
532        #[unsafe(method(tighteningFactorForTruncation))]
533        #[unsafe(method_family = none)]
534        pub unsafe fn tighteningFactorForTruncation(&self) -> c_float;
535
536        #[cfg(feature = "NSTextTable")]
537        #[unsafe(method(textBlocks))]
538        #[unsafe(method_family = none)]
539        pub unsafe fn textBlocks(&self) -> Retained<NSArray<NSTextBlock>>;
540
541        #[unsafe(method(headerLevel))]
542        #[unsafe(method_family = none)]
543        pub unsafe fn headerLevel(&self) -> NSInteger;
544    );
545}
546
547impl NSMutableParagraphStyle {
548    extern_methods!(
549        #[cfg(feature = "NSText")]
550        #[unsafe(method(alignment))]
551        #[unsafe(method_family = none)]
552        pub unsafe fn alignment(&self) -> NSTextAlignment;
553
554        #[cfg(feature = "NSText")]
555        /// Setter for [`alignment`][Self::alignment].
556        #[unsafe(method(setAlignment:))]
557        #[unsafe(method_family = none)]
558        pub unsafe fn setAlignment(&self, alignment: NSTextAlignment);
559
560        #[unsafe(method(tighteningFactorForTruncation))]
561        #[unsafe(method_family = none)]
562        pub unsafe fn tighteningFactorForTruncation(&self) -> c_float;
563
564        /// Setter for [`tighteningFactorForTruncation`][Self::tighteningFactorForTruncation].
565        #[unsafe(method(setTighteningFactorForTruncation:))]
566        #[unsafe(method_family = none)]
567        pub unsafe fn setTighteningFactorForTruncation(
568            &self,
569            tightening_factor_for_truncation: c_float,
570        );
571
572        #[cfg(feature = "NSTextTable")]
573        #[unsafe(method(textBlocks))]
574        #[unsafe(method_family = none)]
575        pub unsafe fn textBlocks(&self) -> Retained<NSArray<NSTextBlock>>;
576
577        #[cfg(feature = "NSTextTable")]
578        /// Setter for [`textBlocks`][Self::textBlocks].
579        #[unsafe(method(setTextBlocks:))]
580        #[unsafe(method_family = none)]
581        pub unsafe fn setTextBlocks(&self, text_blocks: &NSArray<NSTextBlock>);
582
583        #[unsafe(method(headerLevel))]
584        #[unsafe(method_family = none)]
585        pub unsafe fn headerLevel(&self) -> NSInteger;
586
587        /// Setter for [`headerLevel`][Self::headerLevel].
588        #[unsafe(method(setHeaderLevel:))]
589        #[unsafe(method_family = none)]
590        pub unsafe fn setHeaderLevel(&self, header_level: NSInteger);
591    );
592}
593
594/// ********************** Deprecated ***********************
595///
596/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nstexttabtype?language=objc)
597// NS_ENUM
598#[repr(transparent)]
599#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
600pub struct NSTextTabType(pub NSUInteger);
601impl NSTextTabType {
602    #[doc(alias = "NSLeftTabStopType")]
603    pub const LeftTabStopType: Self = Self(0);
604    #[doc(alias = "NSRightTabStopType")]
605    pub const RightTabStopType: Self = Self(1);
606    #[doc(alias = "NSCenterTabStopType")]
607    pub const CenterTabStopType: Self = Self(2);
608    #[doc(alias = "NSDecimalTabStopType")]
609    pub const DecimalTabStopType: Self = Self(3);
610}
611
612unsafe impl Encode for NSTextTabType {
613    const ENCODING: Encoding = NSUInteger::ENCODING;
614}
615
616unsafe impl RefEncode for NSTextTabType {
617    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
618}
619
620/// NSTextTabDeprecated.
621impl NSTextTab {
622    extern_methods!(
623        #[cfg(feature = "objc2-core-foundation")]
624        #[unsafe(method(initWithType:location:))]
625        #[unsafe(method_family = init)]
626        pub unsafe fn initWithType_location(
627            this: Allocated<Self>,
628            r#type: NSTextTabType,
629            loc: CGFloat,
630        ) -> Retained<Self>;
631
632        #[unsafe(method(tabStopType))]
633        #[unsafe(method_family = none)]
634        pub unsafe fn tabStopType(&self) -> NSTextTabType;
635    );
636}