objc2_ui_kit/generated/
UIBarButtonItemAppearance.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 UIBarButtonItemStateAppearance;
16);
17
18extern_conformance!(
19 unsafe impl NSObjectProtocol for UIBarButtonItemStateAppearance {}
20);
21
22impl UIBarButtonItemStateAppearance {
23 extern_methods!(
24 #[unsafe(method(init))]
25 #[unsafe(method_family = init)]
26 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
27
28 #[unsafe(method(new))]
29 #[unsafe(method_family = new)]
30 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
31
32 #[unsafe(method(titleTextAttributes))]
34 #[unsafe(method_family = none)]
35 pub fn titleTextAttributes(
36 &self,
37 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
38
39 #[unsafe(method(setTitleTextAttributes:))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn setTitleTextAttributes(
49 &self,
50 title_text_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
51 );
52
53 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
54 #[unsafe(method(titlePositionAdjustment))]
56 #[unsafe(method_family = none)]
57 pub fn titlePositionAdjustment(&self) -> UIOffset;
58
59 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
60 #[unsafe(method(setTitlePositionAdjustment:))]
62 #[unsafe(method_family = none)]
63 pub fn setTitlePositionAdjustment(&self, title_position_adjustment: UIOffset);
64
65 #[cfg(feature = "UIImage")]
66 #[unsafe(method(backgroundImage))]
68 #[unsafe(method_family = none)]
69 pub fn backgroundImage(&self) -> Option<Retained<UIImage>>;
70
71 #[cfg(feature = "UIImage")]
72 #[unsafe(method(setBackgroundImage:))]
74 #[unsafe(method_family = none)]
75 pub fn setBackgroundImage(&self, background_image: Option<&UIImage>);
76
77 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
78 #[unsafe(method(backgroundImagePositionAdjustment))]
80 #[unsafe(method_family = none)]
81 pub fn backgroundImagePositionAdjustment(&self) -> UIOffset;
82
83 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
84 #[unsafe(method(setBackgroundImagePositionAdjustment:))]
86 #[unsafe(method_family = none)]
87 pub fn setBackgroundImagePositionAdjustment(
88 &self,
89 background_image_position_adjustment: UIOffset,
90 );
91 );
92}
93
94extern_class!(
95 #[unsafe(super(NSObject))]
97 #[thread_kind = MainThreadOnly]
98 #[derive(Debug, PartialEq, Eq, Hash)]
99 pub struct UIBarButtonItemAppearance;
100);
101
102extern_conformance!(
103 unsafe impl NSCoding for UIBarButtonItemAppearance {}
104);
105
106extern_conformance!(
107 unsafe impl NSCopying for UIBarButtonItemAppearance {}
108);
109
110unsafe impl CopyingHelper for UIBarButtonItemAppearance {
111 type Result = Self;
112}
113
114extern_conformance!(
115 unsafe impl NSObjectProtocol for UIBarButtonItemAppearance {}
116);
117
118extern_conformance!(
119 unsafe impl NSSecureCoding for UIBarButtonItemAppearance {}
120);
121
122impl UIBarButtonItemAppearance {
123 extern_methods!(
124 #[unsafe(method(init))]
126 #[unsafe(method_family = init)]
127 pub fn init(this: Allocated<Self>) -> Retained<Self>;
128
129 #[cfg(feature = "UIBarButtonItem")]
130 #[unsafe(method(initWithStyle:))]
132 #[unsafe(method_family = init)]
133 pub fn initWithStyle(this: Allocated<Self>, style: UIBarButtonItemStyle) -> Retained<Self>;
134
135 #[unsafe(method(initWithCoder:))]
139 #[unsafe(method_family = init)]
140 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
141
142 #[unsafe(method(copy))]
143 #[unsafe(method_family = copy)]
144 pub fn copy(&self) -> Retained<Self>;
145
146 #[cfg(feature = "UIBarButtonItem")]
147 #[unsafe(method(configureWithDefaultForStyle:))]
149 #[unsafe(method_family = none)]
150 pub fn configureWithDefaultForStyle(&self, style: UIBarButtonItemStyle);
151
152 #[unsafe(method(normal))]
154 #[unsafe(method_family = none)]
155 pub fn normal(&self) -> Retained<UIBarButtonItemStateAppearance>;
156
157 #[unsafe(method(highlighted))]
159 #[unsafe(method_family = none)]
160 pub fn highlighted(&self) -> Retained<UIBarButtonItemStateAppearance>;
161
162 #[unsafe(method(disabled))]
164 #[unsafe(method_family = none)]
165 pub fn disabled(&self) -> Retained<UIBarButtonItemStateAppearance>;
166
167 #[unsafe(method(focused))]
169 #[unsafe(method_family = none)]
170 pub fn focused(&self) -> Retained<UIBarButtonItemStateAppearance>;
171 );
172}
173
174impl UIBarButtonItemAppearance {
176 extern_methods!(
177 #[unsafe(method(new))]
178 #[unsafe(method_family = new)]
179 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
180 );
181}