objc2_ui_kit/generated/
NSTextContainer.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/nstextcontainer?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct NSTextContainer;
17);
18
19extern_conformance!(
20    unsafe impl NSCoding for NSTextContainer {}
21);
22
23extern_conformance!(
24    unsafe impl NSObjectProtocol for NSTextContainer {}
25);
26
27extern_conformance!(
28    unsafe impl NSSecureCoding for NSTextContainer {}
29);
30
31impl NSTextContainer {
32    extern_methods!(
33        #[cfg(feature = "objc2-core-foundation")]
34        /// ************************** Initialization ***************************
35        #[unsafe(method(initWithSize:))]
36        #[unsafe(method_family = init)]
37        pub unsafe fn initWithSize(this: Allocated<Self>, size: CGSize) -> Retained<Self>;
38
39        #[unsafe(method(initWithCoder:))]
40        #[unsafe(method_family = init)]
41        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
42
43        #[cfg(feature = "NSTextLayoutManager")]
44        #[unsafe(method(textLayoutManager))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn textLayoutManager(&self) -> Option<Retained<NSTextLayoutManager>>;
47
48        #[cfg(feature = "objc2-core-foundation")]
49        /// *********************** Container shape properties ************************
50        #[unsafe(method(size))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn size(&self) -> CGSize;
53
54        #[cfg(feature = "objc2-core-foundation")]
55        /// Setter for [`size`][Self::size].
56        #[unsafe(method(setSize:))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn setSize(&self, size: CGSize);
59
60        #[cfg(feature = "NSParagraphStyle")]
61        #[unsafe(method(lineBreakMode))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn lineBreakMode(&self) -> NSLineBreakMode;
64
65        #[cfg(feature = "NSParagraphStyle")]
66        /// Setter for [`lineBreakMode`][Self::lineBreakMode].
67        #[unsafe(method(setLineBreakMode:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn setLineBreakMode(&self, line_break_mode: NSLineBreakMode);
70
71        #[cfg(feature = "objc2-core-foundation")]
72        /// *********************** Layout constraint properties ************************
73        #[unsafe(method(lineFragmentPadding))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn lineFragmentPadding(&self) -> CGFloat;
76
77        #[cfg(feature = "objc2-core-foundation")]
78        /// Setter for [`lineFragmentPadding`][Self::lineFragmentPadding].
79        #[unsafe(method(setLineFragmentPadding:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn setLineFragmentPadding(&self, line_fragment_padding: CGFloat);
82
83        #[unsafe(method(maximumNumberOfLines))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn maximumNumberOfLines(&self) -> NSUInteger;
86
87        /// Setter for [`maximumNumberOfLines`][Self::maximumNumberOfLines].
88        #[unsafe(method(setMaximumNumberOfLines:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn setMaximumNumberOfLines(&self, maximum_number_of_lines: NSUInteger);
91
92        #[cfg(all(feature = "NSText", feature = "objc2-core-foundation"))]
93        /// ************************** Line fragments ***************************
94        #[unsafe(method(lineFragmentRectForProposedRect:atIndex:writingDirection:remainingRect:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn lineFragmentRectForProposedRect_atIndex_writingDirection_remainingRect(
97            &self,
98            proposed_rect: CGRect,
99            character_index: NSUInteger,
100            base_writing_direction: NSWritingDirection,
101            remaining_rect: *mut CGRect,
102        ) -> CGRect;
103
104        #[unsafe(method(isSimpleRectangularTextContainer))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn isSimpleRectangularTextContainer(&self) -> bool;
107
108        /// ************************** View synchronization ***************************
109        #[unsafe(method(widthTracksTextView))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn widthTracksTextView(&self) -> bool;
112
113        /// Setter for [`widthTracksTextView`][Self::widthTracksTextView].
114        #[unsafe(method(setWidthTracksTextView:))]
115        #[unsafe(method_family = none)]
116        pub unsafe fn setWidthTracksTextView(&self, width_tracks_text_view: bool);
117
118        #[unsafe(method(heightTracksTextView))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn heightTracksTextView(&self) -> bool;
121
122        /// Setter for [`heightTracksTextView`][Self::heightTracksTextView].
123        #[unsafe(method(setHeightTracksTextView:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn setHeightTracksTextView(&self, height_tracks_text_view: bool);
126    );
127}
128
129/// Methods declared on superclass `NSObject`.
130impl NSTextContainer {
131    extern_methods!(
132        #[unsafe(method(init))]
133        #[unsafe(method_family = init)]
134        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
135
136        #[unsafe(method(new))]
137        #[unsafe(method_family = new)]
138        pub unsafe fn new() -> Retained<Self>;
139    );
140}
141
142impl NSTextContainer {
143    extern_methods!(
144        #[cfg(feature = "NSLayoutManager")]
145        #[unsafe(method(layoutManager))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn layoutManager(&self) -> Option<Retained<NSLayoutManager>>;
148
149        #[cfg(feature = "NSLayoutManager")]
150        /// Setter for [`layoutManager`][Self::layoutManager].
151        #[unsafe(method(setLayoutManager:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn setLayoutManager(&self, layout_manager: Option<&NSLayoutManager>);
154
155        #[cfg(feature = "NSLayoutManager")]
156        #[unsafe(method(replaceLayoutManager:))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn replaceLayoutManager(&self, new_layout_manager: &NSLayoutManager);
159
160        #[cfg(feature = "UIBezierPath")]
161        #[unsafe(method(exclusionPaths))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn exclusionPaths(&self) -> Retained<NSArray<UIBezierPath>>;
164
165        #[cfg(feature = "UIBezierPath")]
166        /// Setter for [`exclusionPaths`][Self::exclusionPaths].
167        #[unsafe(method(setExclusionPaths:))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn setExclusionPaths(&self, exclusion_paths: &NSArray<UIBezierPath>);
170    );
171}
172
173#[cfg(feature = "NSLayoutManager")]
174extern_conformance!(
175    unsafe impl NSTextLayoutOrientationProvider for NSTextContainer {}
176);