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    #[deprecated]
26    #[doc(alias = "UIActivityIndicatorViewStyleWhiteLarge")]
27    pub const WhiteLarge: Self = Self(0);
28    #[deprecated]
29    #[doc(alias = "UIActivityIndicatorViewStyleWhite")]
30    pub const White: Self = Self(1);
31    #[deprecated]
32    #[doc(alias = "UIActivityIndicatorViewStyleGray")]
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"))]
59unsafe impl CALayerDelegate for UIActivityIndicatorView {}
60
61#[cfg(all(feature = "UIResponder", feature = "UIView"))]
62unsafe impl NSCoding for UIActivityIndicatorView {}
63
64#[cfg(all(feature = "UIResponder", feature = "UIView"))]
65unsafe impl NSObjectProtocol for UIActivityIndicatorView {}
66
67#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
68unsafe impl UIAppearance for UIActivityIndicatorView {}
69
70#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
71unsafe impl UIAppearanceContainer for UIActivityIndicatorView {}
72
73#[cfg(all(feature = "UIResponder", feature = "UIView"))]
74unsafe impl UICoordinateSpace for UIActivityIndicatorView {}
75
76#[cfg(all(
77    feature = "UIDynamicBehavior",
78    feature = "UIResponder",
79    feature = "UIView"
80))]
81unsafe impl UIDynamicItem for UIActivityIndicatorView {}
82
83#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
84unsafe impl UIFocusEnvironment for UIActivityIndicatorView {}
85
86#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
87unsafe impl UIFocusItem for UIActivityIndicatorView {}
88
89#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
90unsafe impl UIFocusItemContainer for UIActivityIndicatorView {}
91
92#[cfg(all(feature = "UIResponder", feature = "UIView"))]
93unsafe impl UIResponderStandardEditActions for UIActivityIndicatorView {}
94
95#[cfg(all(
96    feature = "UIResponder",
97    feature = "UITraitCollection",
98    feature = "UIView"
99))]
100unsafe impl UITraitEnvironment for UIActivityIndicatorView {}
101
102#[cfg(all(feature = "UIResponder", feature = "UIView"))]
103impl UIActivityIndicatorView {
104    extern_methods!(
105        #[unsafe(method(initWithActivityIndicatorStyle:))]
106        #[unsafe(method_family = init)]
107        pub unsafe fn initWithActivityIndicatorStyle(
108            this: Allocated<Self>,
109            style: UIActivityIndicatorViewStyle,
110        ) -> Retained<Self>;
111
112        #[cfg(feature = "objc2-core-foundation")]
113        #[unsafe(method(initWithFrame:))]
114        #[unsafe(method_family = init)]
115        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
116
117        #[unsafe(method(initWithCoder:))]
118        #[unsafe(method_family = init)]
119        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
120
121        #[unsafe(method(activityIndicatorViewStyle))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn activityIndicatorViewStyle(&self) -> UIActivityIndicatorViewStyle;
124
125        /// Setter for [`activityIndicatorViewStyle`][Self::activityIndicatorViewStyle].
126        #[unsafe(method(setActivityIndicatorViewStyle:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn setActivityIndicatorViewStyle(
129            &self,
130            activity_indicator_view_style: UIActivityIndicatorViewStyle,
131        );
132
133        #[unsafe(method(hidesWhenStopped))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn hidesWhenStopped(&self) -> bool;
136
137        /// Setter for [`hidesWhenStopped`][Self::hidesWhenStopped].
138        #[unsafe(method(setHidesWhenStopped:))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn setHidesWhenStopped(&self, hides_when_stopped: bool);
141
142        #[cfg(feature = "UIColor")]
143        #[unsafe(method(color))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn color(&self) -> Option<Retained<UIColor>>;
146
147        #[cfg(feature = "UIColor")]
148        /// Setter for [`color`][Self::color].
149        #[unsafe(method(setColor:))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn setColor(&self, color: Option<&UIColor>);
152
153        #[unsafe(method(startAnimating))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn startAnimating(&self);
156
157        #[unsafe(method(stopAnimating))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn stopAnimating(&self);
160
161        #[unsafe(method(isAnimating))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn isAnimating(&self) -> bool;
164    );
165}
166
167/// Methods declared on superclass `NSObject`.
168#[cfg(all(feature = "UIResponder", feature = "UIView"))]
169impl UIActivityIndicatorView {
170    extern_methods!(
171        #[unsafe(method(init))]
172        #[unsafe(method_family = init)]
173        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
174
175        #[unsafe(method(new))]
176        #[unsafe(method_family = new)]
177        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
178    );
179}