objc2_ui_kit/generated/
UIProgressView.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#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct UIProgressViewStyle(pub NSInteger);
20impl UIProgressViewStyle {
21 #[doc(alias = "UIProgressViewStyleDefault")]
22 pub const Default: Self = Self(0);
23 #[doc(alias = "UIProgressViewStyleBar")]
24 pub const Bar: Self = Self(1);
25}
26
27unsafe impl Encode for UIProgressViewStyle {
28 const ENCODING: Encoding = NSInteger::ENCODING;
29}
30
31unsafe impl RefEncode for UIProgressViewStyle {
32 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35extern_class!(
36 #[unsafe(super(UIView, UIResponder, NSObject))]
38 #[thread_kind = MainThreadOnly]
39 #[derive(Debug, PartialEq, Eq, Hash)]
40 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
41 pub struct UIProgressView;
42);
43
44#[cfg(all(
45 feature = "UIResponder",
46 feature = "UIView",
47 feature = "objc2-quartz-core"
48))]
49#[cfg(not(target_os = "watchos"))]
50unsafe impl CALayerDelegate for UIProgressView {}
51
52#[cfg(all(feature = "UIResponder", feature = "UIView"))]
53unsafe impl NSCoding for UIProgressView {}
54
55#[cfg(all(feature = "UIResponder", feature = "UIView"))]
56unsafe impl NSObjectProtocol for UIProgressView {}
57
58#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
59unsafe impl UIAppearance for UIProgressView {}
60
61#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
62unsafe impl UIAppearanceContainer for UIProgressView {}
63
64#[cfg(all(feature = "UIResponder", feature = "UIView"))]
65unsafe impl UICoordinateSpace for UIProgressView {}
66
67#[cfg(all(
68 feature = "UIDynamicBehavior",
69 feature = "UIResponder",
70 feature = "UIView"
71))]
72unsafe impl UIDynamicItem for UIProgressView {}
73
74#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
75unsafe impl UIFocusEnvironment for UIProgressView {}
76
77#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
78unsafe impl UIFocusItem for UIProgressView {}
79
80#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
81unsafe impl UIFocusItemContainer for UIProgressView {}
82
83#[cfg(all(feature = "UIResponder", feature = "UIView"))]
84unsafe impl UIResponderStandardEditActions for UIProgressView {}
85
86#[cfg(all(
87 feature = "UIResponder",
88 feature = "UITraitCollection",
89 feature = "UIView"
90))]
91unsafe impl UITraitEnvironment for UIProgressView {}
92
93#[cfg(all(feature = "UIResponder", feature = "UIView"))]
94impl UIProgressView {
95 extern_methods!(
96 #[cfg(feature = "objc2-core-foundation")]
97 #[unsafe(method(initWithFrame:))]
98 #[unsafe(method_family = init)]
99 pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
100
101 #[unsafe(method(initWithCoder:))]
102 #[unsafe(method_family = init)]
103 pub unsafe fn initWithCoder(
104 this: Allocated<Self>,
105 coder: &NSCoder,
106 ) -> Option<Retained<Self>>;
107
108 #[unsafe(method(initWithProgressViewStyle:))]
109 #[unsafe(method_family = init)]
110 pub unsafe fn initWithProgressViewStyle(
111 this: Allocated<Self>,
112 style: UIProgressViewStyle,
113 ) -> Retained<Self>;
114
115 #[unsafe(method(progressViewStyle))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn progressViewStyle(&self) -> UIProgressViewStyle;
118
119 #[unsafe(method(setProgressViewStyle:))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn setProgressViewStyle(&self, progress_view_style: UIProgressViewStyle);
123
124 #[unsafe(method(progress))]
125 #[unsafe(method_family = none)]
126 pub unsafe fn progress(&self) -> c_float;
127
128 #[unsafe(method(setProgress:))]
130 #[unsafe(method_family = none)]
131 pub unsafe fn setProgress(&self, progress: c_float);
132
133 #[cfg(feature = "UIColor")]
134 #[unsafe(method(progressTintColor))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn progressTintColor(&self) -> Option<Retained<UIColor>>;
137
138 #[cfg(feature = "UIColor")]
139 #[unsafe(method(setProgressTintColor:))]
141 #[unsafe(method_family = none)]
142 pub unsafe fn setProgressTintColor(&self, progress_tint_color: Option<&UIColor>);
143
144 #[cfg(feature = "UIColor")]
145 #[unsafe(method(trackTintColor))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn trackTintColor(&self) -> Option<Retained<UIColor>>;
148
149 #[cfg(feature = "UIColor")]
150 #[unsafe(method(setTrackTintColor:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn setTrackTintColor(&self, track_tint_color: Option<&UIColor>);
154
155 #[cfg(feature = "UIImage")]
156 #[unsafe(method(progressImage))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn progressImage(&self) -> Option<Retained<UIImage>>;
159
160 #[cfg(feature = "UIImage")]
161 #[unsafe(method(setProgressImage:))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn setProgressImage(&self, progress_image: Option<&UIImage>);
165
166 #[cfg(feature = "UIImage")]
167 #[unsafe(method(trackImage))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn trackImage(&self) -> Option<Retained<UIImage>>;
170
171 #[cfg(feature = "UIImage")]
172 #[unsafe(method(setTrackImage:))]
174 #[unsafe(method_family = none)]
175 pub unsafe fn setTrackImage(&self, track_image: Option<&UIImage>);
176
177 #[unsafe(method(setProgress:animated:))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn setProgress_animated(&self, progress: c_float, animated: bool);
180
181 #[unsafe(method(observedProgress))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn observedProgress(&self) -> Option<Retained<NSProgress>>;
184
185 #[unsafe(method(setObservedProgress:))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn setObservedProgress(&self, observed_progress: Option<&NSProgress>);
189 );
190}
191
192#[cfg(all(feature = "UIResponder", feature = "UIView"))]
194impl UIProgressView {
195 extern_methods!(
196 #[unsafe(method(init))]
197 #[unsafe(method_family = init)]
198 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
199
200 #[unsafe(method(new))]
201 #[unsafe(method_family = new)]
202 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
203 );
204}