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 unsafe 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 unsafe 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 unsafe fn delegate(
64 &self,
65 ) -> Option<Retained<ProtocolObject<dyn UIPageControlProgressDelegate>>>;
66
67 #[unsafe(method(setDelegate:))]
70 #[unsafe(method_family = none)]
71 pub unsafe fn setDelegate(
72 &self,
73 delegate: Option<&ProtocolObject<dyn UIPageControlProgressDelegate>>,
74 );
75
76 #[unsafe(method(currentProgress))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn currentProgress(&self) -> c_float;
81
82 #[unsafe(method(setCurrentProgress:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn setCurrentProgress(&self, current_progress: c_float);
86
87 #[unsafe(method(isProgressVisible))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn isProgressVisible(&self) -> bool;
92 );
93}
94
95impl UIPageControlProgress {
97 extern_methods!(
98 #[unsafe(method(init))]
99 #[unsafe(method_family = init)]
100 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
101
102 #[unsafe(method(new))]
103 #[unsafe(method_family = new)]
104 pub unsafe fn new() -> Retained<Self>;
105 );
106}
107
108extern_protocol!(
109 pub unsafe trait UIPageControlTimerProgressDelegate:
111 UIPageControlProgressDelegate
112 {
113 #[optional]
115 #[unsafe(method(pageControlTimerProgressDidChange:))]
116 #[unsafe(method_family = none)]
117 unsafe fn pageControlTimerProgressDidChange(&self, progress: &UIPageControlTimerProgress);
118
119 #[optional]
122 #[unsafe(method(pageControlTimerProgress:shouldAdvanceToPage:))]
123 #[unsafe(method_family = none)]
124 unsafe fn pageControlTimerProgress_shouldAdvanceToPage(
125 &self,
126 progress: &UIPageControlTimerProgress,
127 page: NSInteger,
128 ) -> bool;
129 }
130);
131
132extern_class!(
133 #[unsafe(super(UIPageControlProgress, NSObject))]
135 #[derive(Debug, PartialEq, Eq, Hash)]
136 pub struct UIPageControlTimerProgress;
137);
138
139extern_conformance!(
140 unsafe impl NSObjectProtocol for UIPageControlTimerProgress {}
141);
142
143impl UIPageControlTimerProgress {
144 extern_methods!(
145 #[unsafe(method(initWithPreferredDuration:))]
147 #[unsafe(method_family = init)]
148 pub unsafe fn initWithPreferredDuration(
149 this: Allocated<Self>,
150 preferred_duration: NSTimeInterval,
151 ) -> Retained<Self>;
152
153 #[unsafe(method(delegate))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn delegate(
157 &self,
158 ) -> Option<Retained<ProtocolObject<dyn UIPageControlTimerProgressDelegate>>>;
159
160 #[unsafe(method(setDelegate:))]
163 #[unsafe(method_family = none)]
164 pub unsafe fn setDelegate(
165 &self,
166 delegate: Option<&ProtocolObject<dyn UIPageControlTimerProgressDelegate>>,
167 );
168
169 #[unsafe(method(resetsToInitialPageAfterEnd))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn resetsToInitialPageAfterEnd(&self) -> bool;
173
174 #[unsafe(method(setResetsToInitialPageAfterEnd:))]
176 #[unsafe(method_family = none)]
177 pub unsafe fn setResetsToInitialPageAfterEnd(&self, resets_to_initial_page_after_end: bool);
178
179 #[unsafe(method(isRunning))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn isRunning(&self) -> bool;
183
184 #[unsafe(method(resumeTimer))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn resumeTimer(&self);
188
189 #[unsafe(method(pauseTimer))]
191 #[unsafe(method_family = none)]
192 pub unsafe fn pauseTimer(&self);
193
194 #[unsafe(method(preferredDuration))]
197 #[unsafe(method_family = none)]
198 pub unsafe fn preferredDuration(&self) -> NSTimeInterval;
199
200 #[unsafe(method(setPreferredDuration:))]
202 #[unsafe(method_family = none)]
203 pub unsafe fn setPreferredDuration(&self, preferred_duration: NSTimeInterval);
204
205 #[unsafe(method(setDuration:forPage:))]
207 #[unsafe(method_family = none)]
208 pub unsafe fn setDuration_forPage(&self, duration: NSTimeInterval, page: NSInteger);
209
210 #[unsafe(method(durationForPage:))]
213 #[unsafe(method_family = none)]
214 pub unsafe fn durationForPage(&self, page: NSInteger) -> NSTimeInterval;
215
216 #[unsafe(method(init))]
217 #[unsafe(method_family = init)]
218 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
219
220 #[unsafe(method(new))]
221 #[unsafe(method_family = new)]
222 pub unsafe fn new() -> Retained<Self>;
223 );
224}