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