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
18unsafe impl NSObjectProtocol for UIBarButtonItemStateAppearance {}
19
20impl UIBarButtonItemStateAppearance {
21 extern_methods!(
22 #[unsafe(method(init))]
23 #[unsafe(method_family = init)]
24 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
25
26 #[unsafe(method(new))]
27 #[unsafe(method_family = new)]
28 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
29
30 #[unsafe(method(titleTextAttributes))]
32 #[unsafe(method_family = none)]
33 pub unsafe fn titleTextAttributes(
34 &self,
35 ) -> Retained<NSDictionary<NSAttributedStringKey, AnyObject>>;
36
37 #[unsafe(method(setTitleTextAttributes:))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn setTitleTextAttributes(
41 &self,
42 title_text_attributes: &NSDictionary<NSAttributedStringKey, AnyObject>,
43 );
44
45 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
46 #[unsafe(method(titlePositionAdjustment))]
48 #[unsafe(method_family = none)]
49 pub unsafe fn titlePositionAdjustment(&self) -> UIOffset;
50
51 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
52 #[unsafe(method(setTitlePositionAdjustment:))]
54 #[unsafe(method_family = none)]
55 pub unsafe fn setTitlePositionAdjustment(&self, title_position_adjustment: UIOffset);
56
57 #[cfg(feature = "UIImage")]
58 #[unsafe(method(backgroundImage))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn backgroundImage(&self) -> Option<Retained<UIImage>>;
62
63 #[cfg(feature = "UIImage")]
64 #[unsafe(method(setBackgroundImage:))]
66 #[unsafe(method_family = none)]
67 pub unsafe fn setBackgroundImage(&self, background_image: Option<&UIImage>);
68
69 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
70 #[unsafe(method(backgroundImagePositionAdjustment))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn backgroundImagePositionAdjustment(&self) -> UIOffset;
74
75 #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
76 #[unsafe(method(setBackgroundImagePositionAdjustment:))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn setBackgroundImagePositionAdjustment(
80 &self,
81 background_image_position_adjustment: UIOffset,
82 );
83 );
84}
85
86extern_class!(
87 #[unsafe(super(NSObject))]
89 #[thread_kind = MainThreadOnly]
90 #[derive(Debug, PartialEq, Eq, Hash)]
91 pub struct UIBarButtonItemAppearance;
92);
93
94unsafe impl NSCoding for UIBarButtonItemAppearance {}
95
96unsafe impl NSCopying for UIBarButtonItemAppearance {}
97
98unsafe impl CopyingHelper for UIBarButtonItemAppearance {
99 type Result = Self;
100}
101
102unsafe impl NSObjectProtocol for UIBarButtonItemAppearance {}
103
104unsafe impl NSSecureCoding for UIBarButtonItemAppearance {}
105
106impl UIBarButtonItemAppearance {
107 extern_methods!(
108 #[unsafe(method(init))]
110 #[unsafe(method_family = init)]
111 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
112
113 #[cfg(feature = "UIBarButtonItem")]
114 #[unsafe(method(initWithStyle:))]
116 #[unsafe(method_family = init)]
117 pub unsafe fn initWithStyle(
118 this: Allocated<Self>,
119 style: UIBarButtonItemStyle,
120 ) -> Retained<Self>;
121
122 #[unsafe(method(initWithCoder:))]
123 #[unsafe(method_family = init)]
124 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
125
126 #[unsafe(method(copy))]
127 #[unsafe(method_family = copy)]
128 pub unsafe fn copy(&self) -> Retained<Self>;
129
130 #[cfg(feature = "UIBarButtonItem")]
131 #[unsafe(method(configureWithDefaultForStyle:))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn configureWithDefaultForStyle(&self, style: UIBarButtonItemStyle);
135
136 #[unsafe(method(normal))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn normal(&self) -> Retained<UIBarButtonItemStateAppearance>;
140
141 #[unsafe(method(highlighted))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn highlighted(&self) -> Retained<UIBarButtonItemStateAppearance>;
145
146 #[unsafe(method(disabled))]
148 #[unsafe(method_family = none)]
149 pub unsafe fn disabled(&self) -> Retained<UIBarButtonItemStateAppearance>;
150
151 #[unsafe(method(focused))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn focused(&self) -> Retained<UIBarButtonItemStateAppearance>;
155 );
156}
157
158impl UIBarButtonItemAppearance {
160 extern_methods!(
161 #[unsafe(method(new))]
162 #[unsafe(method_family = new)]
163 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
164 );
165}