objc2_ui_kit/generated/
UIBarItem.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
13 #[thread_kind = MainThreadOnly]
14 #[derive(Debug, PartialEq, Eq, Hash)]
15 pub struct UIBarItem;
16);
17
18unsafe impl NSCoding for UIBarItem {}
19
20unsafe impl NSObjectProtocol for UIBarItem {}
21
22#[cfg(feature = "UIAppearance")]
23unsafe impl UIAppearance for UIBarItem {}
24
25impl UIBarItem {
26 extern_methods!(
27 #[unsafe(method(init))]
28 #[unsafe(method_family = init)]
29 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
30
31 #[unsafe(method(initWithCoder:))]
32 #[unsafe(method_family = init)]
33 pub unsafe fn initWithCoder(
34 this: Allocated<Self>,
35 coder: &NSCoder,
36 ) -> Option<Retained<Self>>;
37
38 #[unsafe(method(isEnabled))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn isEnabled(&self) -> bool;
41
42 #[unsafe(method(setEnabled:))]
44 #[unsafe(method_family = none)]
45 pub unsafe fn setEnabled(&self, enabled: bool);
46
47 #[unsafe(method(title))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn title(&self) -> Option<Retained<NSString>>;
50
51 #[unsafe(method(setTitle:))]
53 #[unsafe(method_family = none)]
54 pub unsafe fn setTitle(&self, title: Option<&NSString>);
55
56 #[cfg(feature = "UIImage")]
57 #[unsafe(method(image))]
58 #[unsafe(method_family = none)]
59 pub unsafe fn image(&self) -> Option<Retained<UIImage>>;
60
61 #[cfg(feature = "UIImage")]
62 #[unsafe(method(setImage:))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn setImage(&self, image: Option<&UIImage>);
66
67 #[cfg(feature = "UIImage")]
68 #[unsafe(method(landscapeImagePhone))]
69 #[unsafe(method_family = none)]
70 pub unsafe fn landscapeImagePhone(&self) -> Option<Retained<UIImage>>;
71
72 #[cfg(feature = "UIImage")]
73 #[unsafe(method(setLandscapeImagePhone:))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn setLandscapeImagePhone(&self, landscape_image_phone: Option<&UIImage>);
77
78 #[cfg(feature = "UIImage")]
79 #[unsafe(method(largeContentSizeImage))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn largeContentSizeImage(&self) -> Option<Retained<UIImage>>;
82
83 #[cfg(feature = "UIImage")]
84 #[unsafe(method(setLargeContentSizeImage:))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn setLargeContentSizeImage(&self, large_content_size_image: Option<&UIImage>);
88
89 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
90 #[unsafe(method(imageInsets))]
91 #[unsafe(method_family = none)]
92 pub unsafe fn imageInsets(&self) -> UIEdgeInsets;
93
94 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
95 #[unsafe(method(setImageInsets:))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn setImageInsets(&self, image_insets: UIEdgeInsets);
99
100 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
101 #[unsafe(method(landscapeImagePhoneInsets))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn landscapeImagePhoneInsets(&self) -> UIEdgeInsets;
104
105 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
106 #[unsafe(method(setLandscapeImagePhoneInsets:))]
108 #[unsafe(method_family = none)]
109 pub unsafe fn setLandscapeImagePhoneInsets(
110 &self,
111 landscape_image_phone_insets: UIEdgeInsets,
112 );
113
114 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
115 #[unsafe(method(largeContentSizeImageInsets))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn largeContentSizeImageInsets(&self) -> UIEdgeInsets;
118
119 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
120 #[unsafe(method(setLargeContentSizeImageInsets:))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn setLargeContentSizeImageInsets(
124 &self,
125 large_content_size_image_insets: UIEdgeInsets,
126 );
127
128 #[unsafe(method(tag))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn tag(&self) -> NSInteger;
131
132 #[unsafe(method(setTag:))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn setTag(&self, tag: NSInteger);
136
137 #[cfg(feature = "UIControl")]
138 #[unsafe(method(setTitleTextAttributes:forState:))]
139 #[unsafe(method_family = none)]
140 pub unsafe fn setTitleTextAttributes_forState(
141 &self,
142 attributes: Option<&NSDictionary<NSAttributedStringKey, AnyObject>>,
143 state: UIControlState,
144 );
145
146 #[cfg(feature = "UIControl")]
147 #[unsafe(method(titleTextAttributesForState:))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn titleTextAttributesForState(
150 &self,
151 state: UIControlState,
152 ) -> Option<Retained<NSDictionary<NSAttributedStringKey, AnyObject>>>;
153 );
154}
155
156impl UIBarItem {
158 extern_methods!(
159 #[unsafe(method(new))]
160 #[unsafe(method_family = new)]
161 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
162 );
163}