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