objc2_ui_kit/generated/
UIRefreshControl.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
15extern_class!(
16    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uirefreshcontrol?language=objc)
17    #[unsafe(super(UIControl, UIView, UIResponder, NSObject))]
18    #[thread_kind = MainThreadOnly]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    #[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
21    pub struct UIRefreshControl;
22);
23
24#[cfg(all(
25    feature = "UIControl",
26    feature = "UIResponder",
27    feature = "UIView",
28    feature = "objc2-quartz-core"
29))]
30#[cfg(not(target_os = "watchos"))]
31extern_conformance!(
32    unsafe impl CALayerDelegate for UIRefreshControl {}
33);
34
35#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
36extern_conformance!(
37    unsafe impl NSCoding for UIRefreshControl {}
38);
39
40#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
41extern_conformance!(
42    unsafe impl NSObjectProtocol for UIRefreshControl {}
43);
44
45#[cfg(all(
46    feature = "UIAppearance",
47    feature = "UIControl",
48    feature = "UIResponder",
49    feature = "UIView"
50))]
51extern_conformance!(
52    unsafe impl UIAppearance for UIRefreshControl {}
53);
54
55#[cfg(all(
56    feature = "UIAppearance",
57    feature = "UIControl",
58    feature = "UIResponder",
59    feature = "UIView"
60))]
61extern_conformance!(
62    unsafe impl UIAppearanceContainer for UIRefreshControl {}
63);
64
65#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
66extern_conformance!(
67    unsafe impl UICoordinateSpace for UIRefreshControl {}
68);
69
70#[cfg(all(
71    feature = "UIControl",
72    feature = "UIDynamicBehavior",
73    feature = "UIResponder",
74    feature = "UIView"
75))]
76extern_conformance!(
77    unsafe impl UIDynamicItem for UIRefreshControl {}
78);
79
80#[cfg(all(
81    feature = "UIControl",
82    feature = "UIFocus",
83    feature = "UIResponder",
84    feature = "UIView"
85))]
86extern_conformance!(
87    unsafe impl UIFocusEnvironment for UIRefreshControl {}
88);
89
90#[cfg(all(
91    feature = "UIControl",
92    feature = "UIFocus",
93    feature = "UIResponder",
94    feature = "UIView"
95))]
96extern_conformance!(
97    unsafe impl UIFocusItem for UIRefreshControl {}
98);
99
100#[cfg(all(
101    feature = "UIControl",
102    feature = "UIFocus",
103    feature = "UIResponder",
104    feature = "UIView"
105))]
106extern_conformance!(
107    unsafe impl UIFocusItemContainer for UIRefreshControl {}
108);
109
110#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
111extern_conformance!(
112    unsafe impl UIResponderStandardEditActions for UIRefreshControl {}
113);
114
115#[cfg(all(
116    feature = "UIControl",
117    feature = "UIResponder",
118    feature = "UITraitCollection",
119    feature = "UIView"
120))]
121extern_conformance!(
122    unsafe impl UITraitEnvironment for UIRefreshControl {}
123);
124
125#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
126impl UIRefreshControl {
127    extern_methods!(
128        #[unsafe(method(init))]
129        #[unsafe(method_family = init)]
130        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
131
132        #[unsafe(method(isRefreshing))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn isRefreshing(&self) -> bool;
135
136        #[cfg(feature = "UIColor")]
137        #[unsafe(method(tintColor))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn tintColor(&self) -> Option<Retained<UIColor>>;
140
141        #[cfg(feature = "UIColor")]
142        /// Setter for [`tintColor`][Self::tintColor].
143        #[unsafe(method(setTintColor:))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);
146
147        #[unsafe(method(attributedTitle))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn attributedTitle(&self) -> Option<Retained<NSAttributedString>>;
150
151        /// Setter for [`attributedTitle`][Self::attributedTitle].
152        #[unsafe(method(setAttributedTitle:))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn setAttributedTitle(&self, attributed_title: Option<&NSAttributedString>);
155
156        #[unsafe(method(beginRefreshing))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn beginRefreshing(&self);
159
160        #[unsafe(method(endRefreshing))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn endRefreshing(&self);
163    );
164}
165
166/// Methods declared on superclass `UIControl`.
167#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
168impl UIRefreshControl {
169    extern_methods!(
170        #[cfg(feature = "objc2-core-foundation")]
171        #[unsafe(method(initWithFrame:))]
172        #[unsafe(method_family = init)]
173        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
174
175        #[unsafe(method(initWithCoder:))]
176        #[unsafe(method_family = init)]
177        pub unsafe fn initWithCoder(
178            this: Allocated<Self>,
179            coder: &NSCoder,
180        ) -> Option<Retained<Self>>;
181
182        #[cfg(all(
183            feature = "UIAction",
184            feature = "UIMenuElement",
185            feature = "objc2-core-foundation"
186        ))]
187        /// Initializes the control and adds primaryAction for the UIControlEventPrimaryActionTriggered control event. Subclasses of UIControl may alter or add behaviors around the usage of primaryAction, see subclass documentation of this initializer for additional information.
188        #[unsafe(method(initWithFrame:primaryAction:))]
189        #[unsafe(method_family = init)]
190        pub unsafe fn initWithFrame_primaryAction(
191            this: Allocated<Self>,
192            frame: CGRect,
193            primary_action: Option<&UIAction>,
194        ) -> Retained<Self>;
195    );
196}
197
198/// Methods declared on superclass `NSObject`.
199#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
200impl UIRefreshControl {
201    extern_methods!(
202        #[unsafe(method(new))]
203        #[unsafe(method_family = new)]
204        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
205    );
206}