objc2_ui_kit/generated/
UIProgressView.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use 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/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiprogressviewstyle?language=objc)
16// NS_ENUM
17#[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    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiprogressview?language=objc)
37    #[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"))]
50extern_conformance!(
51    unsafe impl CALayerDelegate for UIProgressView {}
52);
53
54#[cfg(all(feature = "UIResponder", feature = "UIView"))]
55extern_conformance!(
56    unsafe impl NSCoding for UIProgressView {}
57);
58
59#[cfg(all(feature = "UIResponder", feature = "UIView"))]
60extern_conformance!(
61    unsafe impl NSObjectProtocol for UIProgressView {}
62);
63
64#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
65extern_conformance!(
66    unsafe impl UIAppearance for UIProgressView {}
67);
68
69#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
70extern_conformance!(
71    unsafe impl UIAppearanceContainer for UIProgressView {}
72);
73
74#[cfg(all(feature = "UIResponder", feature = "UIView"))]
75extern_conformance!(
76    unsafe impl UICoordinateSpace for UIProgressView {}
77);
78
79#[cfg(all(
80    feature = "UIDynamicBehavior",
81    feature = "UIResponder",
82    feature = "UIView"
83))]
84extern_conformance!(
85    unsafe impl UIDynamicItem for UIProgressView {}
86);
87
88#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
89extern_conformance!(
90    unsafe impl UIFocusEnvironment for UIProgressView {}
91);
92
93#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
94extern_conformance!(
95    unsafe impl UIFocusItem for UIProgressView {}
96);
97
98#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
99extern_conformance!(
100    unsafe impl UIFocusItemContainer for UIProgressView {}
101);
102
103#[cfg(all(feature = "UIResponder", feature = "UIView"))]
104extern_conformance!(
105    unsafe impl UIResponderStandardEditActions for UIProgressView {}
106);
107
108#[cfg(all(
109    feature = "UIResponder",
110    feature = "UITraitCollection",
111    feature = "UIView"
112))]
113extern_conformance!(
114    unsafe impl UITraitEnvironment for UIProgressView {}
115);
116
117#[cfg(all(feature = "UIResponder", feature = "UIView"))]
118impl UIProgressView {
119    extern_methods!(
120        #[cfg(feature = "objc2-core-foundation")]
121        #[unsafe(method(initWithFrame:))]
122        #[unsafe(method_family = init)]
123        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
124
125        #[unsafe(method(initWithCoder:))]
126        #[unsafe(method_family = init)]
127        pub unsafe fn initWithCoder(
128            this: Allocated<Self>,
129            coder: &NSCoder,
130        ) -> Option<Retained<Self>>;
131
132        #[unsafe(method(initWithProgressViewStyle:))]
133        #[unsafe(method_family = init)]
134        pub unsafe fn initWithProgressViewStyle(
135            this: Allocated<Self>,
136            style: UIProgressViewStyle,
137        ) -> Retained<Self>;
138
139        #[unsafe(method(progressViewStyle))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn progressViewStyle(&self) -> UIProgressViewStyle;
142
143        /// Setter for [`progressViewStyle`][Self::progressViewStyle].
144        #[unsafe(method(setProgressViewStyle:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn setProgressViewStyle(&self, progress_view_style: UIProgressViewStyle);
147
148        #[unsafe(method(progress))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn progress(&self) -> c_float;
151
152        /// Setter for [`progress`][Self::progress].
153        #[unsafe(method(setProgress:))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn setProgress(&self, progress: c_float);
156
157        #[cfg(feature = "UIColor")]
158        #[unsafe(method(progressTintColor))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn progressTintColor(&self) -> Option<Retained<UIColor>>;
161
162        #[cfg(feature = "UIColor")]
163        /// Setter for [`progressTintColor`][Self::progressTintColor].
164        #[unsafe(method(setProgressTintColor:))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn setProgressTintColor(&self, progress_tint_color: Option<&UIColor>);
167
168        #[cfg(feature = "UIColor")]
169        #[unsafe(method(trackTintColor))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn trackTintColor(&self) -> Option<Retained<UIColor>>;
172
173        #[cfg(feature = "UIColor")]
174        /// Setter for [`trackTintColor`][Self::trackTintColor].
175        #[unsafe(method(setTrackTintColor:))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn setTrackTintColor(&self, track_tint_color: Option<&UIColor>);
178
179        #[cfg(feature = "UIImage")]
180        #[unsafe(method(progressImage))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn progressImage(&self) -> Option<Retained<UIImage>>;
183
184        #[cfg(feature = "UIImage")]
185        /// Setter for [`progressImage`][Self::progressImage].
186        #[unsafe(method(setProgressImage:))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn setProgressImage(&self, progress_image: Option<&UIImage>);
189
190        #[cfg(feature = "UIImage")]
191        #[unsafe(method(trackImage))]
192        #[unsafe(method_family = none)]
193        pub unsafe fn trackImage(&self) -> Option<Retained<UIImage>>;
194
195        #[cfg(feature = "UIImage")]
196        /// Setter for [`trackImage`][Self::trackImage].
197        #[unsafe(method(setTrackImage:))]
198        #[unsafe(method_family = none)]
199        pub unsafe fn setTrackImage(&self, track_image: Option<&UIImage>);
200
201        #[unsafe(method(setProgress:animated:))]
202        #[unsafe(method_family = none)]
203        pub unsafe fn setProgress_animated(&self, progress: c_float, animated: bool);
204
205        #[unsafe(method(observedProgress))]
206        #[unsafe(method_family = none)]
207        pub unsafe fn observedProgress(&self) -> Option<Retained<NSProgress>>;
208
209        /// Setter for [`observedProgress`][Self::observedProgress].
210        #[unsafe(method(setObservedProgress:))]
211        #[unsafe(method_family = none)]
212        pub unsafe fn setObservedProgress(&self, observed_progress: Option<&NSProgress>);
213    );
214}
215
216/// Methods declared on superclass `NSObject`.
217#[cfg(all(feature = "UIResponder", feature = "UIView"))]
218impl UIProgressView {
219    extern_methods!(
220        #[unsafe(method(init))]
221        #[unsafe(method_family = init)]
222        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
223
224        #[unsafe(method(new))]
225        #[unsafe(method_family = new)]
226        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
227    );
228}