objc2_ui_kit/generated/
UIActivityIndicatorView.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/uiactivityindicatorviewstyle?language=objc)
16// NS_ENUM
17#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct UIActivityIndicatorViewStyle(pub NSInteger);
20impl UIActivityIndicatorViewStyle {
21    #[doc(alias = "UIActivityIndicatorViewStyleMedium")]
22    pub const Medium: Self = Self(100);
23    #[doc(alias = "UIActivityIndicatorViewStyleLarge")]
24    pub const Large: Self = Self(101);
25    #[doc(alias = "UIActivityIndicatorViewStyleWhiteLarge")]
26    #[deprecated]
27    pub const WhiteLarge: Self = Self(0);
28    #[doc(alias = "UIActivityIndicatorViewStyleWhite")]
29    #[deprecated]
30    pub const White: Self = Self(1);
31    #[doc(alias = "UIActivityIndicatorViewStyleGray")]
32    #[deprecated]
33    pub const Gray: Self = Self(2);
34}
35
36unsafe impl Encode for UIActivityIndicatorViewStyle {
37    const ENCODING: Encoding = NSInteger::ENCODING;
38}
39
40unsafe impl RefEncode for UIActivityIndicatorViewStyle {
41    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
42}
43
44extern_class!(
45    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiactivityindicatorview?language=objc)
46    #[unsafe(super(UIView, UIResponder, NSObject))]
47    #[thread_kind = MainThreadOnly]
48    #[derive(Debug, PartialEq, Eq, Hash)]
49    #[cfg(all(feature = "UIResponder", feature = "UIView"))]
50    pub struct UIActivityIndicatorView;
51);
52
53#[cfg(all(
54    feature = "UIResponder",
55    feature = "UIView",
56    feature = "objc2-quartz-core"
57))]
58#[cfg(not(target_os = "watchos"))]
59extern_conformance!(
60    unsafe impl CALayerDelegate for UIActivityIndicatorView {}
61);
62
63#[cfg(all(feature = "UIResponder", feature = "UIView"))]
64extern_conformance!(
65    unsafe impl NSCoding for UIActivityIndicatorView {}
66);
67
68#[cfg(all(feature = "UIResponder", feature = "UIView"))]
69extern_conformance!(
70    unsafe impl NSObjectProtocol for UIActivityIndicatorView {}
71);
72
73#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
74extern_conformance!(
75    unsafe impl UIAppearance for UIActivityIndicatorView {}
76);
77
78#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
79extern_conformance!(
80    unsafe impl UIAppearanceContainer for UIActivityIndicatorView {}
81);
82
83#[cfg(all(feature = "UIResponder", feature = "UIView"))]
84extern_conformance!(
85    unsafe impl UICoordinateSpace for UIActivityIndicatorView {}
86);
87
88#[cfg(all(
89    feature = "UIDynamicBehavior",
90    feature = "UIResponder",
91    feature = "UIView"
92))]
93extern_conformance!(
94    unsafe impl UIDynamicItem for UIActivityIndicatorView {}
95);
96
97#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
98extern_conformance!(
99    unsafe impl UIFocusEnvironment for UIActivityIndicatorView {}
100);
101
102#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
103extern_conformance!(
104    unsafe impl UIFocusItem for UIActivityIndicatorView {}
105);
106
107#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
108extern_conformance!(
109    unsafe impl UIFocusItemContainer for UIActivityIndicatorView {}
110);
111
112#[cfg(all(feature = "UIResponder", feature = "UIView"))]
113extern_conformance!(
114    unsafe impl UIResponderStandardEditActions for UIActivityIndicatorView {}
115);
116
117#[cfg(all(
118    feature = "UIResponder",
119    feature = "UITraitCollection",
120    feature = "UIView"
121))]
122extern_conformance!(
123    unsafe impl UITraitEnvironment for UIActivityIndicatorView {}
124);
125
126#[cfg(all(feature = "UIResponder", feature = "UIView"))]
127impl UIActivityIndicatorView {
128    extern_methods!(
129        #[unsafe(method(initWithActivityIndicatorStyle:))]
130        #[unsafe(method_family = init)]
131        pub unsafe fn initWithActivityIndicatorStyle(
132            this: Allocated<Self>,
133            style: UIActivityIndicatorViewStyle,
134        ) -> Retained<Self>;
135
136        #[cfg(feature = "objc2-core-foundation")]
137        #[unsafe(method(initWithFrame:))]
138        #[unsafe(method_family = init)]
139        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
140
141        #[unsafe(method(initWithCoder:))]
142        #[unsafe(method_family = init)]
143        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
144
145        #[unsafe(method(activityIndicatorViewStyle))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn activityIndicatorViewStyle(&self) -> UIActivityIndicatorViewStyle;
148
149        /// Setter for [`activityIndicatorViewStyle`][Self::activityIndicatorViewStyle].
150        #[unsafe(method(setActivityIndicatorViewStyle:))]
151        #[unsafe(method_family = none)]
152        pub unsafe fn setActivityIndicatorViewStyle(
153            &self,
154            activity_indicator_view_style: UIActivityIndicatorViewStyle,
155        );
156
157        #[unsafe(method(hidesWhenStopped))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn hidesWhenStopped(&self) -> bool;
160
161        /// Setter for [`hidesWhenStopped`][Self::hidesWhenStopped].
162        #[unsafe(method(setHidesWhenStopped:))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn setHidesWhenStopped(&self, hides_when_stopped: bool);
165
166        #[cfg(feature = "UIColor")]
167        #[unsafe(method(color))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn color(&self) -> Option<Retained<UIColor>>;
170
171        #[cfg(feature = "UIColor")]
172        /// Setter for [`color`][Self::color].
173        #[unsafe(method(setColor:))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn setColor(&self, color: Option<&UIColor>);
176
177        #[unsafe(method(startAnimating))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn startAnimating(&self);
180
181        #[unsafe(method(stopAnimating))]
182        #[unsafe(method_family = none)]
183        pub unsafe fn stopAnimating(&self);
184
185        #[unsafe(method(isAnimating))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn isAnimating(&self) -> bool;
188    );
189}
190
191/// Methods declared on superclass `NSObject`.
192#[cfg(all(feature = "UIResponder", feature = "UIView"))]
193impl UIActivityIndicatorView {
194    extern_methods!(
195        #[unsafe(method(init))]
196        #[unsafe(method_family = init)]
197        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
198
199        #[unsafe(method(new))]
200        #[unsafe(method_family = new)]
201        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
202    );
203}