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
54unsafe impl NSObjectProtocol for UIPageControlProgress {}
55
56impl UIPageControlProgress {
57 extern_methods!(
58 #[unsafe(method(delegate))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn delegate(
62 &self,
63 ) -> Option<Retained<ProtocolObject<dyn UIPageControlProgressDelegate>>>;
64
65 #[unsafe(method(setDelegate:))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn setDelegate(
70 &self,
71 delegate: Option<&ProtocolObject<dyn UIPageControlProgressDelegate>>,
72 );
73
74 #[unsafe(method(currentProgress))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn currentProgress(&self) -> c_float;
79
80 #[unsafe(method(setCurrentProgress:))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn setCurrentProgress(&self, current_progress: c_float);
84
85 #[unsafe(method(isProgressVisible))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn isProgressVisible(&self) -> bool;
90 );
91}
92
93impl UIPageControlProgress {
95 extern_methods!(
96 #[unsafe(method(init))]
97 #[unsafe(method_family = init)]
98 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
99
100 #[unsafe(method(new))]
101 #[unsafe(method_family = new)]
102 pub unsafe fn new() -> Retained<Self>;
103 );
104}
105
106extern_protocol!(
107 pub unsafe trait UIPageControlTimerProgressDelegate:
109 UIPageControlProgressDelegate
110 {
111 #[optional]
113 #[unsafe(method(pageControlTimerProgressDidChange:))]
114 #[unsafe(method_family = none)]
115 unsafe fn pageControlTimerProgressDidChange(&self, progress: &UIPageControlTimerProgress);
116
117 #[optional]
120 #[unsafe(method(pageControlTimerProgress:shouldAdvanceToPage:))]
121 #[unsafe(method_family = none)]
122 unsafe fn pageControlTimerProgress_shouldAdvanceToPage(
123 &self,
124 progress: &UIPageControlTimerProgress,
125 page: NSInteger,
126 ) -> bool;
127 }
128);
129
130extern_class!(
131 #[unsafe(super(UIPageControlProgress, NSObject))]
133 #[derive(Debug, PartialEq, Eq, Hash)]
134 pub struct UIPageControlTimerProgress;
135);
136
137unsafe impl NSObjectProtocol for UIPageControlTimerProgress {}
138
139impl UIPageControlTimerProgress {
140 extern_methods!(
141 #[unsafe(method(initWithPreferredDuration:))]
143 #[unsafe(method_family = init)]
144 pub unsafe fn initWithPreferredDuration(
145 this: Allocated<Self>,
146 preferred_duration: NSTimeInterval,
147 ) -> Retained<Self>;
148
149 #[unsafe(method(delegate))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn delegate(
153 &self,
154 ) -> Option<Retained<ProtocolObject<dyn UIPageControlTimerProgressDelegate>>>;
155
156 #[unsafe(method(setDelegate:))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn setDelegate(
161 &self,
162 delegate: Option<&ProtocolObject<dyn UIPageControlTimerProgressDelegate>>,
163 );
164
165 #[unsafe(method(resetsToInitialPageAfterEnd))]
167 #[unsafe(method_family = none)]
168 pub unsafe fn resetsToInitialPageAfterEnd(&self) -> bool;
169
170 #[unsafe(method(setResetsToInitialPageAfterEnd:))]
172 #[unsafe(method_family = none)]
173 pub unsafe fn setResetsToInitialPageAfterEnd(&self, resets_to_initial_page_after_end: bool);
174
175 #[unsafe(method(isRunning))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn isRunning(&self) -> bool;
179
180 #[unsafe(method(resumeTimer))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn resumeTimer(&self);
184
185 #[unsafe(method(pauseTimer))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn pauseTimer(&self);
189
190 #[unsafe(method(preferredDuration))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn preferredDuration(&self) -> NSTimeInterval;
195
196 #[unsafe(method(setPreferredDuration:))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn setPreferredDuration(&self, preferred_duration: NSTimeInterval);
200
201 #[unsafe(method(setDuration:forPage:))]
203 #[unsafe(method_family = none)]
204 pub unsafe fn setDuration_forPage(&self, duration: NSTimeInterval, page: NSInteger);
205
206 #[unsafe(method(durationForPage:))]
209 #[unsafe(method_family = none)]
210 pub unsafe fn durationForPage(&self, page: NSInteger) -> NSTimeInterval;
211
212 #[unsafe(method(init))]
213 #[unsafe(method_family = init)]
214 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
215
216 #[unsafe(method(new))]
217 #[unsafe(method_family = new)]
218 pub unsafe fn new() -> Retained<Self>;
219 );
220}