objc2_ui_kit/generated/
UIPageControlProgress.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11 pub unsafe trait UIPageControlProgressDelegate: NSObjectProtocol {
13 #[optional]
15 #[unsafe(method(pageControlProgress:initialProgressForPage:))]
16 #[unsafe(method_family = none)]
17 fn pageControlProgress_initialProgressForPage(
18 &self,
19 progress: &UIPageControlProgress,
20 page: NSInteger,
21 ) -> c_float;
22
23 #[optional]
41 #[unsafe(method(pageControlProgressVisibilityDidChange:))]
42 #[unsafe(method_family = none)]
43 fn pageControlProgressVisibilityDidChange(&self, progress: &UIPageControlProgress);
44 }
45);
46
47extern_class!(
48 #[unsafe(super(NSObject))]
50 #[derive(Debug, PartialEq, Eq, Hash)]
51 pub struct UIPageControlProgress;
52);
53
54extern_conformance!(
55 unsafe impl NSObjectProtocol for UIPageControlProgress {}
56);
57
58impl UIPageControlProgress {
59 extern_methods!(
60 #[unsafe(method(delegate))]
62 #[unsafe(method_family = none)]
63 pub fn delegate(
64 &self,
65 ) -> Option<Retained<ProtocolObject<dyn UIPageControlProgressDelegate>>>;
66
67 #[unsafe(method(setDelegate:))]
71 #[unsafe(method_family = none)]
72 pub unsafe fn setDelegate(
73 &self,
74 delegate: Option<&ProtocolObject<dyn UIPageControlProgressDelegate>>,
75 );
76
77 #[unsafe(method(currentProgress))]
80 #[unsafe(method_family = none)]
81 pub fn currentProgress(&self) -> c_float;
82
83 #[unsafe(method(setCurrentProgress:))]
85 #[unsafe(method_family = none)]
86 pub fn setCurrentProgress(&self, current_progress: c_float);
87
88 #[unsafe(method(isProgressVisible))]
91 #[unsafe(method_family = none)]
92 pub fn isProgressVisible(&self) -> bool;
93 );
94}
95
96impl UIPageControlProgress {
98 extern_methods!(
99 #[unsafe(method(init))]
100 #[unsafe(method_family = init)]
101 pub fn init(this: Allocated<Self>) -> Retained<Self>;
102
103 #[unsafe(method(new))]
104 #[unsafe(method_family = new)]
105 pub fn new() -> Retained<Self>;
106 );
107}
108
109impl DefaultRetained for UIPageControlProgress {
110 #[inline]
111 fn default_retained() -> Retained<Self> {
112 Self::new()
113 }
114}
115
116extern_protocol!(
117 pub unsafe trait UIPageControlTimerProgressDelegate:
119 UIPageControlProgressDelegate
120 {
121 #[optional]
123 #[unsafe(method(pageControlTimerProgressDidChange:))]
124 #[unsafe(method_family = none)]
125 fn pageControlTimerProgressDidChange(&self, progress: &UIPageControlTimerProgress);
126
127 #[optional]
130 #[unsafe(method(pageControlTimerProgress:shouldAdvanceToPage:))]
131 #[unsafe(method_family = none)]
132 fn pageControlTimerProgress_shouldAdvanceToPage(
133 &self,
134 progress: &UIPageControlTimerProgress,
135 page: NSInteger,
136 ) -> bool;
137 }
138);
139
140extern_class!(
141 #[unsafe(super(UIPageControlProgress, NSObject))]
143 #[derive(Debug, PartialEq, Eq, Hash)]
144 pub struct UIPageControlTimerProgress;
145);
146
147extern_conformance!(
148 unsafe impl NSObjectProtocol for UIPageControlTimerProgress {}
149);
150
151impl UIPageControlTimerProgress {
152 extern_methods!(
153 #[unsafe(method(initWithPreferredDuration:))]
155 #[unsafe(method_family = init)]
156 pub fn initWithPreferredDuration(
157 this: Allocated<Self>,
158 preferred_duration: NSTimeInterval,
159 ) -> Retained<Self>;
160
161 #[unsafe(method(delegate))]
163 #[unsafe(method_family = none)]
164 pub fn delegate(
165 &self,
166 ) -> Option<Retained<ProtocolObject<dyn UIPageControlTimerProgressDelegate>>>;
167
168 #[unsafe(method(setDelegate:))]
172 #[unsafe(method_family = none)]
173 pub unsafe fn setDelegate(
174 &self,
175 delegate: Option<&ProtocolObject<dyn UIPageControlTimerProgressDelegate>>,
176 );
177
178 #[unsafe(method(resetsToInitialPageAfterEnd))]
180 #[unsafe(method_family = none)]
181 pub fn resetsToInitialPageAfterEnd(&self) -> bool;
182
183 #[unsafe(method(setResetsToInitialPageAfterEnd:))]
185 #[unsafe(method_family = none)]
186 pub fn setResetsToInitialPageAfterEnd(&self, resets_to_initial_page_after_end: bool);
187
188 #[unsafe(method(isRunning))]
190 #[unsafe(method_family = none)]
191 pub fn isRunning(&self) -> bool;
192
193 #[unsafe(method(resumeTimer))]
195 #[unsafe(method_family = none)]
196 pub fn resumeTimer(&self);
197
198 #[unsafe(method(pauseTimer))]
200 #[unsafe(method_family = none)]
201 pub fn pauseTimer(&self);
202
203 #[unsafe(method(preferredDuration))]
206 #[unsafe(method_family = none)]
207 pub fn preferredDuration(&self) -> NSTimeInterval;
208
209 #[unsafe(method(setPreferredDuration:))]
211 #[unsafe(method_family = none)]
212 pub fn setPreferredDuration(&self, preferred_duration: NSTimeInterval);
213
214 #[unsafe(method(setDuration:forPage:))]
216 #[unsafe(method_family = none)]
217 pub fn setDuration_forPage(&self, duration: NSTimeInterval, page: NSInteger);
218
219 #[unsafe(method(durationForPage:))]
222 #[unsafe(method_family = none)]
223 pub fn durationForPage(&self, page: NSInteger) -> NSTimeInterval;
224
225 #[unsafe(method(init))]
226 #[unsafe(method_family = init)]
227 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
228
229 #[unsafe(method(new))]
230 #[unsafe(method_family = new)]
231 pub unsafe fn new() -> Retained<Self>;
232 );
233}