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"))]
31unsafe impl CALayerDelegate for UIRefreshControl {}
32
33#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
34unsafe impl NSCoding for UIRefreshControl {}
35
36#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
37unsafe impl NSObjectProtocol for UIRefreshControl {}
38
39#[cfg(all(
40    feature = "UIAppearance",
41    feature = "UIControl",
42    feature = "UIResponder",
43    feature = "UIView"
44))]
45unsafe impl UIAppearance for UIRefreshControl {}
46
47#[cfg(all(
48    feature = "UIAppearance",
49    feature = "UIControl",
50    feature = "UIResponder",
51    feature = "UIView"
52))]
53unsafe impl UIAppearanceContainer for UIRefreshControl {}
54
55#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
56unsafe impl UICoordinateSpace for UIRefreshControl {}
57
58#[cfg(all(
59    feature = "UIControl",
60    feature = "UIDynamicBehavior",
61    feature = "UIResponder",
62    feature = "UIView"
63))]
64unsafe impl UIDynamicItem for UIRefreshControl {}
65
66#[cfg(all(
67    feature = "UIControl",
68    feature = "UIFocus",
69    feature = "UIResponder",
70    feature = "UIView"
71))]
72unsafe impl UIFocusEnvironment for UIRefreshControl {}
73
74#[cfg(all(
75    feature = "UIControl",
76    feature = "UIFocus",
77    feature = "UIResponder",
78    feature = "UIView"
79))]
80unsafe impl UIFocusItem for UIRefreshControl {}
81
82#[cfg(all(
83    feature = "UIControl",
84    feature = "UIFocus",
85    feature = "UIResponder",
86    feature = "UIView"
87))]
88unsafe impl UIFocusItemContainer for UIRefreshControl {}
89
90#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
91unsafe impl UIResponderStandardEditActions for UIRefreshControl {}
92
93#[cfg(all(
94    feature = "UIControl",
95    feature = "UIResponder",
96    feature = "UITraitCollection",
97    feature = "UIView"
98))]
99unsafe impl UITraitEnvironment for UIRefreshControl {}
100
101#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
102impl UIRefreshControl {
103    extern_methods!(
104        #[unsafe(method(init))]
105        #[unsafe(method_family = init)]
106        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
107
108        #[unsafe(method(isRefreshing))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn isRefreshing(&self) -> bool;
111
112        #[cfg(feature = "UIColor")]
113        #[unsafe(method(tintColor))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn tintColor(&self) -> Option<Retained<UIColor>>;
116
117        #[cfg(feature = "UIColor")]
118        /// Setter for [`tintColor`][Self::tintColor].
119        #[unsafe(method(setTintColor:))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn setTintColor(&self, tint_color: Option<&UIColor>);
122
123        #[unsafe(method(attributedTitle))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn attributedTitle(&self) -> Option<Retained<NSAttributedString>>;
126
127        /// Setter for [`attributedTitle`][Self::attributedTitle].
128        #[unsafe(method(setAttributedTitle:))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn setAttributedTitle(&self, attributed_title: Option<&NSAttributedString>);
131
132        #[unsafe(method(beginRefreshing))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn beginRefreshing(&self);
135
136        #[unsafe(method(endRefreshing))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn endRefreshing(&self);
139    );
140}
141
142/// Methods declared on superclass `UIControl`.
143#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
144impl UIRefreshControl {
145    extern_methods!(
146        #[cfg(feature = "objc2-core-foundation")]
147        #[unsafe(method(initWithFrame:))]
148        #[unsafe(method_family = init)]
149        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
150
151        #[unsafe(method(initWithCoder:))]
152        #[unsafe(method_family = init)]
153        pub unsafe fn initWithCoder(
154            this: Allocated<Self>,
155            coder: &NSCoder,
156        ) -> Option<Retained<Self>>;
157
158        #[cfg(all(
159            feature = "UIAction",
160            feature = "UIMenuElement",
161            feature = "objc2-core-foundation"
162        ))]
163        /// 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.
164        #[unsafe(method(initWithFrame:primaryAction:))]
165        #[unsafe(method_family = init)]
166        pub unsafe fn initWithFrame_primaryAction(
167            this: Allocated<Self>,
168            frame: CGRect,
169            primary_action: Option<&UIAction>,
170        ) -> Retained<Self>;
171    );
172}
173
174/// Methods declared on superclass `NSObject`.
175#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
176impl UIRefreshControl {
177    extern_methods!(
178        #[unsafe(method(new))]
179        #[unsafe(method_family = new)]
180        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
181    );
182}