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 unsafe fn titleTextAttributes(
36 &self,
37 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
38
39 #[unsafe(method(setTitleTextAttributes:))]
41 #[unsafe(method_family = none)]
42 pub unsafe fn setTitleTextAttributes(
43 &self,
44 title_text_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
45 );
46
47 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
48 #[unsafe(method(titlePositionAdjustment))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn titlePositionAdjustment(&self) -> UIOffset;
52
53 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
54 #[unsafe(method(setTitlePositionAdjustment:))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn setTitlePositionAdjustment(&self, title_position_adjustment: UIOffset);
58
59 #[cfg(feature = "UIImage")]
60 #[unsafe(method(backgroundImage))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn backgroundImage(&self) -> Option<Retained<UIImage>>;
64
65 #[cfg(feature = "UIImage")]
66 #[unsafe(method(setBackgroundImage:))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn setBackgroundImage(&self, background_image: Option<&UIImage>);
70
71 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
72 #[unsafe(method(backgroundImagePositionAdjustment))]
74 #[unsafe(method_family = none)]
75 pub unsafe fn backgroundImagePositionAdjustment(&self) -> UIOffset;
76
77 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
78 #[unsafe(method(setBackgroundImagePositionAdjustment:))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn setBackgroundImagePositionAdjustment(
82 &self,
83 background_image_position_adjustment: UIOffset,
84 );
85 );
86}
87
88extern_class!(
89 #[unsafe(super(NSObject))]
91 #[thread_kind = MainThreadOnly]
92 #[derive(Debug, PartialEq, Eq, Hash)]
93 pub struct UIBarButtonItemAppearance;
94);
95
96extern_conformance!(
97 unsafe impl NSCoding for UIBarButtonItemAppearance {}
98);
99
100extern_conformance!(
101 unsafe impl NSCopying for UIBarButtonItemAppearance {}
102);
103
104unsafe impl CopyingHelper for UIBarButtonItemAppearance {
105 type Result = Self;
106}
107
108extern_conformance!(
109 unsafe impl NSObjectProtocol for UIBarButtonItemAppearance {}
110);
111
112extern_conformance!(
113 unsafe impl NSSecureCoding for UIBarButtonItemAppearance {}
114);
115
116impl UIBarButtonItemAppearance {
117 extern_methods!(
118 #[unsafe(method(init))]
120 #[unsafe(method_family = init)]
121 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
122
123 #[cfg(feature = "UIBarButtonItem")]
124 #[unsafe(method(initWithStyle:))]
126 #[unsafe(method_family = init)]
127 pub unsafe fn initWithStyle(
128 this: Allocated<Self>,
129 style: UIBarButtonItemStyle,
130 ) -> Retained<Self>;
131
132 #[unsafe(method(initWithCoder:))]
133 #[unsafe(method_family = init)]
134 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
135
136 #[unsafe(method(copy))]
137 #[unsafe(method_family = copy)]
138 pub unsafe fn copy(&self) -> Retained<Self>;
139
140 #[cfg(feature = "UIBarButtonItem")]
141 #[unsafe(method(configureWithDefaultForStyle:))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn configureWithDefaultForStyle(&self, style: UIBarButtonItemStyle);
145
146 #[unsafe(method(normal))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn normal(&self) -> Retained<UIBarButtonItemStateAppearance>;
150
151 #[unsafe(method(highlighted))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn highlighted(&self) -> Retained<UIBarButtonItemStateAppearance>;
155
156 #[unsafe(method(disabled))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn disabled(&self) -> Retained<UIBarButtonItemStateAppearance>;
160
161 #[unsafe(method(focused))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn focused(&self) -> Retained<UIBarButtonItemStateAppearance>;
165 );
166}
167
168impl UIBarButtonItemAppearance {
170 extern_methods!(
171 #[unsafe(method(new))]
172 #[unsafe(method_family = new)]
173 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
174 );
175}