objc2_ui_kit/generated/
UIToolbar.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#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15extern_class!(
16 #[unsafe(super(UIView, UIResponder, NSObject))]
18 #[thread_kind = MainThreadOnly]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
21 pub struct UIToolbar;
22);
23
24#[cfg(all(
25 feature = "UIResponder",
26 feature = "UIView",
27 feature = "objc2-quartz-core"
28))]
29#[cfg(not(target_os = "watchos"))]
30extern_conformance!(
31 unsafe impl CALayerDelegate for UIToolbar {}
32);
33
34#[cfg(all(feature = "UIResponder", feature = "UIView"))]
35extern_conformance!(
36 unsafe impl NSCoding for UIToolbar {}
37);
38
39#[cfg(all(feature = "UIResponder", feature = "UIView"))]
40extern_conformance!(
41 unsafe impl NSObjectProtocol for UIToolbar {}
42);
43
44#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
45extern_conformance!(
46 unsafe impl UIAppearance for UIToolbar {}
47);
48
49#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
50extern_conformance!(
51 unsafe impl UIAppearanceContainer for UIToolbar {}
52);
53
54#[cfg(all(feature = "UIBarCommon", feature = "UIResponder", feature = "UIView"))]
55extern_conformance!(
56 unsafe impl UIBarPositioning for UIToolbar {}
57);
58
59#[cfg(all(feature = "UIResponder", feature = "UIView"))]
60extern_conformance!(
61 unsafe impl UICoordinateSpace for UIToolbar {}
62);
63
64#[cfg(all(
65 feature = "UIDynamicBehavior",
66 feature = "UIResponder",
67 feature = "UIView"
68))]
69extern_conformance!(
70 unsafe impl UIDynamicItem for UIToolbar {}
71);
72
73#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
74extern_conformance!(
75 unsafe impl UIFocusEnvironment for UIToolbar {}
76);
77
78#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
79extern_conformance!(
80 unsafe impl UIFocusItem for UIToolbar {}
81);
82
83#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
84extern_conformance!(
85 unsafe impl UIFocusItemContainer for UIToolbar {}
86);
87
88#[cfg(all(feature = "UIResponder", feature = "UIView"))]
89extern_conformance!(
90 unsafe impl UIResponderStandardEditActions for UIToolbar {}
91);
92
93#[cfg(all(
94 feature = "UIResponder",
95 feature = "UITraitCollection",
96 feature = "UIView"
97))]
98extern_conformance!(
99 unsafe impl UITraitEnvironment for UIToolbar {}
100);
101
102#[cfg(all(feature = "UIResponder", feature = "UIView"))]
103impl UIToolbar {
104 extern_methods!(
105 #[cfg(feature = "UIInterface")]
106 #[unsafe(method(barStyle))]
107 #[unsafe(method_family = none)]
108 pub fn barStyle(&self) -> UIBarStyle;
109
110 #[cfg(feature = "UIInterface")]
111 #[unsafe(method(setBarStyle:))]
113 #[unsafe(method_family = none)]
114 pub fn setBarStyle(&self, bar_style: UIBarStyle);
115
116 #[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
117 #[unsafe(method(items))]
118 #[unsafe(method_family = none)]
119 pub fn items(&self) -> Option<Retained<NSArray<UIBarButtonItem>>>;
120
121 #[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
122 #[unsafe(method(setItems:))]
126 #[unsafe(method_family = none)]
127 pub fn setItems(&self, items: Option<&NSArray<UIBarButtonItem>>);
128
129 #[unsafe(method(isTranslucent))]
130 #[unsafe(method_family = none)]
131 pub fn isTranslucent(&self) -> bool;
132
133 #[unsafe(method(setTranslucent:))]
135 #[unsafe(method_family = none)]
136 pub fn setTranslucent(&self, translucent: bool);
137
138 #[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
139 #[unsafe(method(setItems:animated:))]
140 #[unsafe(method_family = none)]
141 pub fn setItems_animated(&self, items: Option<&NSArray<UIBarButtonItem>>, animated: bool);
142
143 #[cfg(feature = "UIColor")]
144 #[unsafe(method(tintColor))]
145 #[unsafe(method_family = none)]
146 pub fn tintColor(&self) -> Option<Retained<UIColor>>;
147
148 #[cfg(feature = "UIColor")]
149 #[unsafe(method(setTintColor:))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);
157
158 #[cfg(feature = "UIColor")]
159 #[unsafe(method(barTintColor))]
160 #[unsafe(method_family = none)]
161 pub fn barTintColor(&self) -> Option<Retained<UIColor>>;
162
163 #[cfg(feature = "UIColor")]
164 #[unsafe(method(setBarTintColor:))]
166 #[unsafe(method_family = none)]
167 pub fn setBarTintColor(&self, bar_tint_color: Option<&UIColor>);
168
169 #[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
170 #[unsafe(method(setBackgroundImage:forToolbarPosition:barMetrics:))]
171 #[unsafe(method_family = none)]
172 pub fn setBackgroundImage_forToolbarPosition_barMetrics(
173 &self,
174 background_image: Option<&UIImage>,
175 top_or_bottom: UIBarPosition,
176 bar_metrics: UIBarMetrics,
177 );
178
179 #[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
180 #[unsafe(method(backgroundImageForToolbarPosition:barMetrics:))]
181 #[unsafe(method_family = none)]
182 pub fn backgroundImageForToolbarPosition_barMetrics(
183 &self,
184 top_or_bottom: UIBarPosition,
185 bar_metrics: UIBarMetrics,
186 ) -> Option<Retained<UIImage>>;
187
188 #[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
189 #[unsafe(method(setShadowImage:forToolbarPosition:))]
190 #[unsafe(method_family = none)]
191 pub fn setShadowImage_forToolbarPosition(
192 &self,
193 shadow_image: Option<&UIImage>,
194 top_or_bottom: UIBarPosition,
195 );
196
197 #[cfg(all(feature = "UIBarCommon", feature = "UIImage"))]
198 #[unsafe(method(shadowImageForToolbarPosition:))]
199 #[unsafe(method_family = none)]
200 pub fn shadowImageForToolbarPosition(
201 &self,
202 top_or_bottom: UIBarPosition,
203 ) -> Option<Retained<UIImage>>;
204
205 #[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
206 #[unsafe(method(standardAppearance))]
208 #[unsafe(method_family = none)]
209 pub fn standardAppearance(&self) -> Retained<UIToolbarAppearance>;
210
211 #[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
212 #[unsafe(method(setStandardAppearance:))]
216 #[unsafe(method_family = none)]
217 pub fn setStandardAppearance(&self, standard_appearance: &UIToolbarAppearance);
218
219 #[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
220 #[unsafe(method(compactAppearance))]
222 #[unsafe(method_family = none)]
223 pub fn compactAppearance(&self) -> Option<Retained<UIToolbarAppearance>>;
224
225 #[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
226 #[unsafe(method(setCompactAppearance:))]
230 #[unsafe(method_family = none)]
231 pub fn setCompactAppearance(&self, compact_appearance: Option<&UIToolbarAppearance>);
232
233 #[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
234 #[unsafe(method(scrollEdgeAppearance))]
236 #[unsafe(method_family = none)]
237 pub fn scrollEdgeAppearance(&self) -> Option<Retained<UIToolbarAppearance>>;
238
239 #[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
240 #[unsafe(method(setScrollEdgeAppearance:))]
244 #[unsafe(method_family = none)]
245 pub fn setScrollEdgeAppearance(&self, scroll_edge_appearance: Option<&UIToolbarAppearance>);
246
247 #[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
248 #[unsafe(method(compactScrollEdgeAppearance))]
250 #[unsafe(method_family = none)]
251 pub fn compactScrollEdgeAppearance(&self) -> Option<Retained<UIToolbarAppearance>>;
252
253 #[cfg(all(feature = "UIBarAppearance", feature = "UIToolbarAppearance"))]
254 #[unsafe(method(setCompactScrollEdgeAppearance:))]
258 #[unsafe(method_family = none)]
259 pub fn setCompactScrollEdgeAppearance(
260 &self,
261 compact_scroll_edge_appearance: Option<&UIToolbarAppearance>,
262 );
263
264 #[cfg(feature = "UIBarCommon")]
265 #[unsafe(method(delegate))]
266 #[unsafe(method_family = none)]
267 pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UIToolbarDelegate>>>;
268
269 #[cfg(feature = "UIBarCommon")]
270 #[unsafe(method(setDelegate:))]
274 #[unsafe(method_family = none)]
275 pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn UIToolbarDelegate>>);
276 );
277}
278
279#[cfg(all(feature = "UIResponder", feature = "UIView"))]
281impl UIToolbar {
282 extern_methods!(
283 #[cfg(feature = "objc2-core-foundation")]
284 #[unsafe(method(initWithFrame:))]
285 #[unsafe(method_family = init)]
286 pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
287
288 #[unsafe(method(initWithCoder:))]
292 #[unsafe(method_family = init)]
293 pub unsafe fn initWithCoder(
294 this: Allocated<Self>,
295 coder: &NSCoder,
296 ) -> Option<Retained<Self>>;
297
298 #[unsafe(method(init))]
299 #[unsafe(method_family = init)]
300 pub fn init(this: Allocated<Self>) -> Retained<Self>;
301 );
302}
303
304#[cfg(all(feature = "UIResponder", feature = "UIView"))]
306impl UIToolbar {
307 extern_methods!(
308 #[unsafe(method(new))]
309 #[unsafe(method_family = new)]
310 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
311 );
312}
313
314extern_protocol!(
315 #[cfg(feature = "UIBarCommon")]
317 pub unsafe trait UIToolbarDelegate: UIBarPositioningDelegate + MainThreadOnly {}
318);