1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uibarappearance?language=objc)
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIBarAppearance;
);
extern_conformance!(
unsafe impl NSCoding for UIBarAppearance {}
);
extern_conformance!(
unsafe impl NSCopying for UIBarAppearance {}
);
unsafe impl CopyingHelper for UIBarAppearance {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UIBarAppearance {}
);
extern_conformance!(
unsafe impl NSSecureCoding for UIBarAppearance {}
);
impl UIBarAppearance {
extern_methods!(
/// Constructs a new bar appearance, configured with default values and targeting the device idiom.
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "UIDevice")]
/// Constructs a new bar appearance, targeting the passed-in idiom as a hint. Not all platforms support all available idioms. See the idiom property to determine the resolved idiom.
#[unsafe(method(initWithIdiom:))]
#[unsafe(method_family = init)]
pub fn initWithIdiom(this: Allocated<Self>, idiom: UIUserInterfaceIdiom) -> Retained<Self>;
#[cfg(feature = "UIDevice")]
/// The idiom that this appearance object targets.
#[unsafe(method(idiom))]
#[unsafe(method_family = none)]
pub fn idiom(&self) -> UIUserInterfaceIdiom;
/// Constructs a new bar appearance, copying all relevant properties from the given appearance object. This initializer is useful for migrating configuration between UIBarAppearance subclasses. For example, you can initialize a UINavigationBarAppearance with a UIToolbarAppearance instance, and shared attributes will be identical between the two.
#[unsafe(method(initWithBarAppearance:))]
#[unsafe(method_family = init)]
pub fn initWithBarAppearance(
this: Allocated<Self>,
bar_appearance: &UIBarAppearance,
) -> Retained<Self>;
/// # Safety
///
/// `coder` possibly has further requirements.
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
#[unsafe(method(copy))]
#[unsafe(method_family = copy)]
pub fn copy(&self) -> Retained<Self>;
/// Reset background and shadow properties to their defaults.
#[unsafe(method(configureWithDefaultBackground))]
#[unsafe(method_family = none)]
pub fn configureWithDefaultBackground(&self);
/// Reset background and shadow properties to display theme-appropriate opaque colors.
#[unsafe(method(configureWithOpaqueBackground))]
#[unsafe(method_family = none)]
pub fn configureWithOpaqueBackground(&self);
/// Reset background and shadow properties to be transparent.
#[unsafe(method(configureWithTransparentBackground))]
#[unsafe(method_family = none)]
pub fn configureWithTransparentBackground(&self);
#[cfg(all(feature = "UIBlurEffect", feature = "UIVisualEffect"))]
/// A specific blur effect to use for the bar background. This effect is composited first when constructing the bar's background.
#[unsafe(method(backgroundEffect))]
#[unsafe(method_family = none)]
pub fn backgroundEffect(&self) -> Option<Retained<UIBlurEffect>>;
#[cfg(all(feature = "UIBlurEffect", feature = "UIVisualEffect"))]
/// Setter for [`backgroundEffect`][Self::backgroundEffect].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setBackgroundEffect:))]
#[unsafe(method_family = none)]
pub fn setBackgroundEffect(&self, background_effect: Option<&UIBlurEffect>);
#[cfg(feature = "UIColor")]
/// A color to use for the bar background. This color is composited over backgroundEffects.
#[unsafe(method(backgroundColor))]
#[unsafe(method_family = none)]
pub fn backgroundColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
/// Setter for [`backgroundColor`][Self::backgroundColor].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setBackgroundColor:))]
#[unsafe(method_family = none)]
pub fn setBackgroundColor(&self, background_color: Option<&UIColor>);
#[cfg(feature = "UIImage")]
/// An image to use for the bar background. This image is composited over the backgroundColor, and resized per the backgroundImageContentMode.
#[unsafe(method(backgroundImage))]
#[unsafe(method_family = none)]
pub fn backgroundImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
/// Setter for [`backgroundImage`][Self::backgroundImage].
#[unsafe(method(setBackgroundImage:))]
#[unsafe(method_family = none)]
pub fn setBackgroundImage(&self, background_image: Option<&UIImage>);
#[cfg(feature = "UIView")]
/// The content mode to use when rendering the backgroundImage. Defaults to UIViewContentModeScaleToFill. UIViewContentModeRedraw will be reinterpreted as UIViewContentModeScaleToFill.
#[unsafe(method(backgroundImageContentMode))]
#[unsafe(method_family = none)]
pub fn backgroundImageContentMode(&self) -> UIViewContentMode;
#[cfg(feature = "UIView")]
/// Setter for [`backgroundImageContentMode`][Self::backgroundImageContentMode].
#[unsafe(method(setBackgroundImageContentMode:))]
#[unsafe(method_family = none)]
pub fn setBackgroundImageContentMode(
&self,
background_image_content_mode: UIViewContentMode,
);
#[cfg(feature = "UIColor")]
/// A color to use for the shadow. Its specific behavior depends on the value of shadowImage. If shadowImage is nil, then the shadowColor is used to color the bar's default shadow; a nil or clearColor shadowColor will result in no shadow. If shadowImage is a template image, then the shadowColor is used to tint the image; a nil or clearColor shadowColor will also result in no shadow. If the shadowImage is not a template image, then it will be rendered regardless of the value of shadowColor.
#[unsafe(method(shadowColor))]
#[unsafe(method_family = none)]
pub fn shadowColor(&self) -> Option<Retained<UIColor>>;
#[cfg(feature = "UIColor")]
/// Setter for [`shadowColor`][Self::shadowColor].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setShadowColor:))]
#[unsafe(method_family = none)]
pub fn setShadowColor(&self, shadow_color: Option<&UIColor>);
#[cfg(feature = "UIImage")]
/// Use an image for the shadow. See shadowColor for how they interact.
#[unsafe(method(shadowImage))]
#[unsafe(method_family = none)]
pub fn shadowImage(&self) -> Option<Retained<UIImage>>;
#[cfg(feature = "UIImage")]
/// Setter for [`shadowImage`][Self::shadowImage].
#[unsafe(method(setShadowImage:))]
#[unsafe(method_family = none)]
pub fn setShadowImage(&self, shadow_image: Option<&UIImage>);
);
}
/// Methods declared on superclass `NSObject`.
impl UIBarAppearance {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}