objc2_ui_kit/generated/
UIBezierPath.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::*;
8#[cfg(feature = "objc2-core-graphics")]
9use objc2_core_graphics::*;
10use objc2_foundation::*;
11
12use crate::*;
13
14extern_class!(
15    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uibezierpath?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct UIBezierPath;
19);
20
21extern_conformance!(
22    unsafe impl NSCoding for UIBezierPath {}
23);
24
25extern_conformance!(
26    unsafe impl NSCopying for UIBezierPath {}
27);
28
29unsafe impl CopyingHelper for UIBezierPath {
30    type Result = Self;
31}
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for UIBezierPath {}
35);
36
37extern_conformance!(
38    unsafe impl NSSecureCoding for UIBezierPath {}
39);
40
41impl UIBezierPath {
42    extern_methods!(
43        #[unsafe(method(bezierPath))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn bezierPath() -> Retained<Self>;
46
47        #[cfg(feature = "objc2-core-foundation")]
48        #[unsafe(method(bezierPathWithRect:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn bezierPathWithRect(rect: CGRect) -> Retained<Self>;
51
52        #[cfg(feature = "objc2-core-foundation")]
53        #[unsafe(method(bezierPathWithOvalInRect:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn bezierPathWithOvalInRect(rect: CGRect) -> Retained<Self>;
56
57        #[cfg(feature = "objc2-core-foundation")]
58        #[unsafe(method(bezierPathWithRoundedRect:cornerRadius:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn bezierPathWithRoundedRect_cornerRadius(
61            rect: CGRect,
62            corner_radius: CGFloat,
63        ) -> Retained<Self>;
64
65        #[cfg(all(feature = "UIGeometry", feature = "objc2-core-foundation"))]
66        #[unsafe(method(bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn bezierPathWithRoundedRect_byRoundingCorners_cornerRadii(
69            rect: CGRect,
70            corners: UIRectCorner,
71            corner_radii: CGSize,
72        ) -> Retained<Self>;
73
74        #[cfg(feature = "objc2-core-foundation")]
75        #[unsafe(method(bezierPathWithArcCenter:radius:startAngle:endAngle:clockwise:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn bezierPathWithArcCenter_radius_startAngle_endAngle_clockwise(
78            center: CGPoint,
79            radius: CGFloat,
80            start_angle: CGFloat,
81            end_angle: CGFloat,
82            clockwise: bool,
83        ) -> Retained<Self>;
84
85        #[cfg(feature = "objc2-core-graphics")]
86        #[unsafe(method(bezierPathWithCGPath:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn bezierPathWithCGPath(cg_path: &CGPath) -> Retained<Self>;
89
90        #[unsafe(method(init))]
91        #[unsafe(method_family = init)]
92        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
93
94        #[unsafe(method(initWithCoder:))]
95        #[unsafe(method_family = init)]
96        pub unsafe fn initWithCoder(
97            this: Allocated<Self>,
98            coder: &NSCoder,
99        ) -> Option<Retained<Self>>;
100
101        #[cfg(feature = "objc2-core-graphics")]
102        #[unsafe(method(CGPath))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn CGPath(&self) -> Retained<CGPath>;
105
106        #[cfg(feature = "objc2-core-graphics")]
107        /// Setter for [`CGPath`][Self::CGPath].
108        #[unsafe(method(setCGPath:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn setCGPath(&self, cg_path: &CGPath);
111
112        #[cfg(feature = "objc2-core-foundation")]
113        #[unsafe(method(moveToPoint:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn moveToPoint(&self, point: CGPoint);
116
117        #[cfg(feature = "objc2-core-foundation")]
118        #[unsafe(method(addLineToPoint:))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn addLineToPoint(&self, point: CGPoint);
121
122        #[cfg(feature = "objc2-core-foundation")]
123        #[unsafe(method(addCurveToPoint:controlPoint1:controlPoint2:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn addCurveToPoint_controlPoint1_controlPoint2(
126            &self,
127            end_point: CGPoint,
128            control_point1: CGPoint,
129            control_point2: CGPoint,
130        );
131
132        #[cfg(feature = "objc2-core-foundation")]
133        #[unsafe(method(addQuadCurveToPoint:controlPoint:))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn addQuadCurveToPoint_controlPoint(
136            &self,
137            end_point: CGPoint,
138            control_point: CGPoint,
139        );
140
141        #[cfg(feature = "objc2-core-foundation")]
142        #[unsafe(method(addArcWithCenter:radius:startAngle:endAngle:clockwise:))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn addArcWithCenter_radius_startAngle_endAngle_clockwise(
145            &self,
146            center: CGPoint,
147            radius: CGFloat,
148            start_angle: CGFloat,
149            end_angle: CGFloat,
150            clockwise: bool,
151        );
152
153        #[unsafe(method(closePath))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn closePath(&self);
156
157        #[unsafe(method(removeAllPoints))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn removeAllPoints(&self);
160
161        #[unsafe(method(appendPath:))]
162        #[unsafe(method_family = none)]
163        pub unsafe fn appendPath(&self, bezier_path: &UIBezierPath);
164
165        #[unsafe(method(bezierPathByReversingPath))]
166        #[unsafe(method_family = none)]
167        pub unsafe fn bezierPathByReversingPath(&self) -> Retained<UIBezierPath>;
168
169        #[cfg(feature = "objc2-core-foundation")]
170        #[unsafe(method(applyTransform:))]
171        #[unsafe(method_family = none)]
172        pub unsafe fn applyTransform(&self, transform: CGAffineTransform);
173
174        #[unsafe(method(isEmpty))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn isEmpty(&self) -> bool;
177
178        #[cfg(feature = "objc2-core-foundation")]
179        #[unsafe(method(bounds))]
180        #[unsafe(method_family = none)]
181        pub unsafe fn bounds(&self) -> CGRect;
182
183        #[cfg(feature = "objc2-core-foundation")]
184        #[unsafe(method(currentPoint))]
185        #[unsafe(method_family = none)]
186        pub unsafe fn currentPoint(&self) -> CGPoint;
187
188        #[cfg(feature = "objc2-core-foundation")]
189        #[unsafe(method(containsPoint:))]
190        #[unsafe(method_family = none)]
191        pub unsafe fn containsPoint(&self, point: CGPoint) -> bool;
192
193        #[cfg(feature = "objc2-core-foundation")]
194        #[unsafe(method(lineWidth))]
195        #[unsafe(method_family = none)]
196        pub unsafe fn lineWidth(&self) -> CGFloat;
197
198        #[cfg(feature = "objc2-core-foundation")]
199        /// Setter for [`lineWidth`][Self::lineWidth].
200        #[unsafe(method(setLineWidth:))]
201        #[unsafe(method_family = none)]
202        pub unsafe fn setLineWidth(&self, line_width: CGFloat);
203
204        #[cfg(feature = "objc2-core-graphics")]
205        #[unsafe(method(lineCapStyle))]
206        #[unsafe(method_family = none)]
207        pub unsafe fn lineCapStyle(&self) -> CGLineCap;
208
209        #[cfg(feature = "objc2-core-graphics")]
210        /// Setter for [`lineCapStyle`][Self::lineCapStyle].
211        #[unsafe(method(setLineCapStyle:))]
212        #[unsafe(method_family = none)]
213        pub unsafe fn setLineCapStyle(&self, line_cap_style: CGLineCap);
214
215        #[cfg(feature = "objc2-core-graphics")]
216        #[unsafe(method(lineJoinStyle))]
217        #[unsafe(method_family = none)]
218        pub unsafe fn lineJoinStyle(&self) -> CGLineJoin;
219
220        #[cfg(feature = "objc2-core-graphics")]
221        /// Setter for [`lineJoinStyle`][Self::lineJoinStyle].
222        #[unsafe(method(setLineJoinStyle:))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn setLineJoinStyle(&self, line_join_style: CGLineJoin);
225
226        #[cfg(feature = "objc2-core-foundation")]
227        #[unsafe(method(miterLimit))]
228        #[unsafe(method_family = none)]
229        pub unsafe fn miterLimit(&self) -> CGFloat;
230
231        #[cfg(feature = "objc2-core-foundation")]
232        /// Setter for [`miterLimit`][Self::miterLimit].
233        #[unsafe(method(setMiterLimit:))]
234        #[unsafe(method_family = none)]
235        pub unsafe fn setMiterLimit(&self, miter_limit: CGFloat);
236
237        #[cfg(feature = "objc2-core-foundation")]
238        #[unsafe(method(flatness))]
239        #[unsafe(method_family = none)]
240        pub unsafe fn flatness(&self) -> CGFloat;
241
242        #[cfg(feature = "objc2-core-foundation")]
243        /// Setter for [`flatness`][Self::flatness].
244        #[unsafe(method(setFlatness:))]
245        #[unsafe(method_family = none)]
246        pub unsafe fn setFlatness(&self, flatness: CGFloat);
247
248        #[unsafe(method(usesEvenOddFillRule))]
249        #[unsafe(method_family = none)]
250        pub unsafe fn usesEvenOddFillRule(&self) -> bool;
251
252        /// Setter for [`usesEvenOddFillRule`][Self::usesEvenOddFillRule].
253        #[unsafe(method(setUsesEvenOddFillRule:))]
254        #[unsafe(method_family = none)]
255        pub unsafe fn setUsesEvenOddFillRule(&self, uses_even_odd_fill_rule: bool);
256
257        #[cfg(feature = "objc2-core-foundation")]
258        #[unsafe(method(setLineDash:count:phase:))]
259        #[unsafe(method_family = none)]
260        pub unsafe fn setLineDash_count_phase(
261            &self,
262            pattern: *const CGFloat,
263            count: NSInteger,
264            phase: CGFloat,
265        );
266
267        #[cfg(feature = "objc2-core-foundation")]
268        #[unsafe(method(getLineDash:count:phase:))]
269        #[unsafe(method_family = none)]
270        pub unsafe fn getLineDash_count_phase(
271            &self,
272            pattern: *mut CGFloat,
273            count: *mut NSInteger,
274            phase: *mut CGFloat,
275        );
276
277        #[unsafe(method(fill))]
278        #[unsafe(method_family = none)]
279        pub unsafe fn fill(&self);
280
281        #[unsafe(method(stroke))]
282        #[unsafe(method_family = none)]
283        pub unsafe fn stroke(&self);
284
285        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
286        #[unsafe(method(fillWithBlendMode:alpha:))]
287        #[unsafe(method_family = none)]
288        pub unsafe fn fillWithBlendMode_alpha(&self, blend_mode: CGBlendMode, alpha: CGFloat);
289
290        #[cfg(all(feature = "objc2-core-foundation", feature = "objc2-core-graphics"))]
291        #[unsafe(method(strokeWithBlendMode:alpha:))]
292        #[unsafe(method_family = none)]
293        pub unsafe fn strokeWithBlendMode_alpha(&self, blend_mode: CGBlendMode, alpha: CGFloat);
294
295        #[unsafe(method(addClip))]
296        #[unsafe(method_family = none)]
297        pub unsafe fn addClip(&self);
298    );
299}
300
301/// Methods declared on superclass `NSObject`.
302impl UIBezierPath {
303    extern_methods!(
304        #[unsafe(method(new))]
305        #[unsafe(method_family = new)]
306        pub unsafe fn new() -> Retained<Self>;
307    );
308}