objc2_ui_kit/generated/
UIContentUnavailableTextProperties.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
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicontentunavailabletextproperties?language=objc)
14    #[unsafe(super(NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct UIContentUnavailableTextProperties;
18);
19
20unsafe impl NSCoding for UIContentUnavailableTextProperties {}
21
22unsafe impl NSCopying for UIContentUnavailableTextProperties {}
23
24unsafe impl CopyingHelper for UIContentUnavailableTextProperties {
25    type Result = Self;
26}
27
28unsafe impl NSObjectProtocol for UIContentUnavailableTextProperties {}
29
30unsafe impl NSSecureCoding for UIContentUnavailableTextProperties {}
31
32impl UIContentUnavailableTextProperties {
33    extern_methods!(
34        #[cfg(feature = "UIFont")]
35        /// The font used for the text.
36        #[unsafe(method(font))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn font(&self) -> Retained<UIFont>;
39
40        #[cfg(feature = "UIFont")]
41        /// Setter for [`font`][Self::font].
42        #[unsafe(method(setFont:))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn setFont(&self, font: &UIFont);
45
46        #[cfg(feature = "UIColor")]
47        /// The color of the text.
48        #[unsafe(method(color))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn color(&self) -> Retained<UIColor>;
51
52        #[cfg(feature = "UIColor")]
53        /// Setter for [`color`][Self::color].
54        #[unsafe(method(setColor:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn setColor(&self, color: &UIColor);
57
58        #[cfg(feature = "NSParagraphStyle")]
59        /// The line break mode to use for the text.
60        #[unsafe(method(lineBreakMode))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode;
63
64        #[cfg(feature = "NSParagraphStyle")]
65        /// Setter for [`lineBreakMode`][Self::lineBreakMode].
66        #[unsafe(method(setLineBreakMode:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn setLineBreakMode(&self, line_break_mode: NSLineBreakMode);
69
70        /// The maximum number of lines for the text. 0 indicates the number of lines is unlimited.
71        #[unsafe(method(numberOfLines))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn numberOfLines(&self) -> NSInteger;
74
75        /// Setter for [`numberOfLines`][Self::numberOfLines].
76        #[unsafe(method(setNumberOfLines:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn setNumberOfLines(&self, number_of_lines: NSInteger);
79
80        /// Whether the font size of the text is automatically adjusted when necessary to fit in the available width.
81        #[unsafe(method(adjustsFontSizeToFitWidth))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn adjustsFontSizeToFitWidth(&self) -> bool;
84
85        /// Setter for [`adjustsFontSizeToFitWidth`][Self::adjustsFontSizeToFitWidth].
86        #[unsafe(method(setAdjustsFontSizeToFitWidth:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn setAdjustsFontSizeToFitWidth(&self, adjusts_font_size_to_fit_width: bool);
89
90        #[cfg(feature = "objc2-core-foundation")]
91        /// When `adjustsFontSizeToFitWidth` is enabled, the smallest multiplier for the font size used to make the text fit.
92        #[unsafe(method(minimumScaleFactor))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn minimumScaleFactor(&self) -> CGFloat;
95
96        #[cfg(feature = "objc2-core-foundation")]
97        /// Setter for [`minimumScaleFactor`][Self::minimumScaleFactor].
98        #[unsafe(method(setMinimumScaleFactor:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn setMinimumScaleFactor(&self, minimum_scale_factor: CGFloat);
101
102        /// Whether the text is tightened before truncating.
103        #[unsafe(method(allowsDefaultTighteningForTruncation))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn allowsDefaultTighteningForTruncation(&self) -> bool;
106
107        /// Setter for [`allowsDefaultTighteningForTruncation`][Self::allowsDefaultTighteningForTruncation].
108        #[unsafe(method(setAllowsDefaultTighteningForTruncation:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn setAllowsDefaultTighteningForTruncation(
111            &self,
112            allows_default_tightening_for_truncation: bool,
113        );
114    );
115}
116
117/// Methods declared on superclass `NSObject`.
118impl UIContentUnavailableTextProperties {
119    extern_methods!(
120        #[unsafe(method(init))]
121        #[unsafe(method_family = init)]
122        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
123
124        #[unsafe(method(new))]
125        #[unsafe(method_family = new)]
126        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
127    );
128}