objc2_ui_kit/generated/
UIGlassEffect.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct UIGlassEffectStyle(pub NSInteger);
17impl UIGlassEffectStyle {
18 #[doc(alias = "UIGlassEffectStyleRegular")]
20 pub const Regular: Self = Self(0);
21 #[doc(alias = "UIGlassEffectStyleClear")]
23 pub const Clear: Self = Self(1);
24}
25
26unsafe impl Encode for UIGlassEffectStyle {
27 const ENCODING: Encoding = NSInteger::ENCODING;
28}
29
30unsafe impl RefEncode for UIGlassEffectStyle {
31 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34extern_class!(
35 #[unsafe(super(UIVisualEffect, NSObject))]
39 #[thread_kind = MainThreadOnly]
40 #[derive(Debug, PartialEq, Eq, Hash)]
41 #[cfg(feature = "UIVisualEffect")]
42 pub struct UIGlassEffect;
43);
44
45#[cfg(feature = "UIVisualEffect")]
46extern_conformance!(
47 unsafe impl NSCoding for UIGlassEffect {}
48);
49
50#[cfg(feature = "UIVisualEffect")]
51extern_conformance!(
52 unsafe impl NSCopying for UIGlassEffect {}
53);
54
55#[cfg(feature = "UIVisualEffect")]
56unsafe impl CopyingHelper for UIGlassEffect {
57 type Result = Self;
58}
59
60#[cfg(feature = "UIVisualEffect")]
61extern_conformance!(
62 unsafe impl NSObjectProtocol for UIGlassEffect {}
63);
64
65#[cfg(feature = "UIVisualEffect")]
66extern_conformance!(
67 unsafe impl NSSecureCoding for UIGlassEffect {}
68);
69
70#[cfg(feature = "UIVisualEffect")]
71impl UIGlassEffect {
72 extern_methods!(
73 #[unsafe(method(isInteractive))]
75 #[unsafe(method_family = none)]
76 pub fn isInteractive(&self) -> bool;
77
78 #[unsafe(method(setInteractive:))]
80 #[unsafe(method_family = none)]
81 pub fn setInteractive(&self, interactive: bool);
82
83 #[cfg(feature = "UIColor")]
84 #[unsafe(method(tintColor))]
86 #[unsafe(method_family = none)]
87 pub fn tintColor(&self) -> Option<Retained<UIColor>>;
88
89 #[cfg(feature = "UIColor")]
90 #[unsafe(method(setTintColor:))]
94 #[unsafe(method_family = none)]
95 pub fn setTintColor(&self, tint_color: Option<&UIColor>);
96
97 #[unsafe(method(effectWithStyle:))]
99 #[unsafe(method_family = none)]
100 pub fn effectWithStyle(
101 style: UIGlassEffectStyle,
102 mtm: MainThreadMarker,
103 ) -> Retained<UIGlassEffect>;
104 );
105}
106
107#[cfg(feature = "UIVisualEffect")]
109impl UIGlassEffect {
110 extern_methods!(
111 #[unsafe(method(init))]
112 #[unsafe(method_family = init)]
113 pub fn init(this: Allocated<Self>) -> Retained<Self>;
114
115 #[unsafe(method(new))]
116 #[unsafe(method_family = new)]
117 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
118 );
119}
120
121extern_class!(
122 #[unsafe(super(UIVisualEffect, NSObject))]
131 #[thread_kind = MainThreadOnly]
132 #[derive(Debug, PartialEq, Eq, Hash)]
133 #[cfg(feature = "UIVisualEffect")]
134 pub struct UIGlassContainerEffect;
135);
136
137#[cfg(feature = "UIVisualEffect")]
138extern_conformance!(
139 unsafe impl NSCoding for UIGlassContainerEffect {}
140);
141
142#[cfg(feature = "UIVisualEffect")]
143extern_conformance!(
144 unsafe impl NSCopying for UIGlassContainerEffect {}
145);
146
147#[cfg(feature = "UIVisualEffect")]
148unsafe impl CopyingHelper for UIGlassContainerEffect {
149 type Result = Self;
150}
151
152#[cfg(feature = "UIVisualEffect")]
153extern_conformance!(
154 unsafe impl NSObjectProtocol for UIGlassContainerEffect {}
155);
156
157#[cfg(feature = "UIVisualEffect")]
158extern_conformance!(
159 unsafe impl NSSecureCoding for UIGlassContainerEffect {}
160);
161
162#[cfg(feature = "UIVisualEffect")]
163impl UIGlassContainerEffect {
164 extern_methods!(
165 #[cfg(feature = "objc2-core-foundation")]
166 #[unsafe(method(spacing))]
168 #[unsafe(method_family = none)]
169 pub fn spacing(&self) -> CGFloat;
170
171 #[cfg(feature = "objc2-core-foundation")]
172 #[unsafe(method(setSpacing:))]
174 #[unsafe(method_family = none)]
175 pub fn setSpacing(&self, spacing: CGFloat);
176 );
177}
178
179#[cfg(feature = "UIVisualEffect")]
181impl UIGlassContainerEffect {
182 extern_methods!(
183 #[unsafe(method(init))]
184 #[unsafe(method_family = init)]
185 pub fn init(this: Allocated<Self>) -> Retained<Self>;
186
187 #[unsafe(method(new))]
188 #[unsafe(method_family = new)]
189 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
190 );
191}